【发布时间】:2015-10-28 05:32:20
【问题描述】:
您好,我在 Azure 服务器上运行 PHP CRM,我的要求是用户应该能够通过 CRM 站点将自己的自定义域(他们将单独进行 DNS 配置)添加到应用程序,是否有任何 REST API 调用为了实现这一点,我进行了很多搜索,但在 Azure 中找不到任何文档, 我确实从堆栈中找到了这些 Programatically add domain name to azure website
Add a domain to an Azure web site via code
我使用 Chrome Postman 应用尝试了上述示例
App(instanceName) 名称为“示例”
“https://management.azure.com/subscriptions/{subscriptionId}/resourcegroups/{myResourceGroup}/providers/Microsoft.Web/sites/{instanceName}/config/web?api-version=2015-08-01”
同时使用 POST 和 PUT 方法
{ "properties": { "HostNames":"example.com, crm.example.com" } }
我尝试了这些方法,但我得到的只是一个错误“身份验证失败。'Authorization' 标头不存在或以无效格式提供”,我认为 json 值有问题,
example.com.au 是我现有的网站,crm.example.com 是我要添加的域名,是否正确,我是否遗漏了什么,请帮助我
【问题讨论】:
标签: php azure azure-web-app-service azure-resource-manager