gpt4 book ai didi

azure - 如何将自定义域名与Azure ARM模板部署绑定(bind)

转载 作者:行者123 更新时间:2023-12-03 04:42:40 25 4
gpt4 key购买 nike

我正在尝试使用以下独立部署策略将 Multi-Tenancy 应用程序部署到 azure。

  1. 为 Azure 弹性池中的每个租户创建一个新数据库。
  2. 为每个租户创建一个新的应用服务实例。
  3. 使用已从 Azure 购买的域名(例如:tenantname.mydomain.com)映射应用服务实例的自定义域名

我尝试使用以下 ARM 模板来执行此操作(为了降低复杂性,我仅提到了模板的相关区域)

{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"sites_finaptestwebsite_name": {
"defaultValue": "finaptestwebsite",
"type": "String"
},
"hostNameBindings_mydomain.finapsl.com_name": {
"defaultValue": "mydomain.finapsl.com",
"type": "String"
},
"hostNameBindings_finaptestwebsite.azurewebsites.net_name": {
"defaultValue": "finaptestwebsite.azurewebsites.net",
"type": "String"
},
"sites_finaptestwebsite_serverFarmId": {
"defaultValue": "appServicePlanName",
"type": "String"
}
},
"variables": {},
"resources": [
{
"type": "Microsoft.Web/sites",
"kind": "app",
"name": "[parameters('sites_finaptestwebsite_name')]",
"apiVersion": "2016-08-01",
"location": "Central US",
"scale": null,
"properties": {
"enabled": true,
"hostNameSslStates": [
{
"name": "[concat(parameters('sites_finaptestwebsite_name'),'.azurewebsites.net')]",
"sslState": "Disabled",
"virtualIP": null,
"thumbprint": null,
"toUpdate": null,
"hostType": "Standard"
},
{
"name": "[concat(parameters('sites_finaptestwebsite_name'),'.scm.azurewebsites.net')]",
"sslState": "Disabled",
"virtualIP": null,
"thumbprint": null,
"toUpdate": null,
"hostType": "Repository"
},
{
"name": "mydomain.finapsl.com",
"sslState": "Disabled",
"virtualIP": null,
"thumbprint": null,
"toUpdate": null,
"hostType": "Standard"
}
],
"serverFarmId": "[parameters('sites_finaptestwebsite_serverFarmId')]",
"reserved": false,
"siteConfig": null,
"scmSiteAlsoStopped": false,
"hostingEnvironmentProfile": null,
"clientAffinityEnabled": true,
"clientCertEnabled": false,
"hostNamesDisabled": false,
"containerSize": 0,
"dailyMemoryTimeQuota": 0,
"cloningInfo": null
},
"dependsOn": []
},
{
"type": "Microsoft.Web/sites/hostNameBindings",
"name": "[concat(parameters('sites_finaptestwebsite_name'), '/', parameters('hostNameBindings_finaptestwebsite.azurewebsites.net_name'))]",
"apiVersion": "2016-08-01",
"location": "Central US",
"scale": null,
"properties": {
"siteName": "finaptestwebsite",
"domainId": null,
"hostNameType": "Verified"
},
"dependsOn": [
"[resourceId('Microsoft.Web/sites', parameters('sites_finaptestwebsite_name'))]"
]
},
{
"type": "Microsoft.Web/sites/hostNameBindings",
"name": "[concat(parameters('sites_finaptestwebsite_name'), '/', parameters('hostNameBindings_mydomain.finapsl.com_name'))]",
"apiVersion": "2016-08-01",
"location": "Central US",
"scale": null,
"properties": {
"siteName": "finaptestwebsite",
"domainId": null,
"azureResourceName": "finaptestwebsite",
"azureResourceType": "Website",
"customHostNameDnsRecordType": "CName",
"hostNameType": "Managed"
},
"dependsOn": [
"[resourceId('Microsoft.Web/sites', parameters('sites_finaptestwebsite_name'))]"
]
}
]

}

部署失败,并出现错误“未找到从 mydomain.finapsl.com 指向 {1} 的 CNAME 记录。未找到指向 awverify.finaptestwebsite2.azurewebsites.net 的备用记录 awverify.mydomain.finapsl.com要么。

是否可以通过这种方式将自定义域名绑定(bind)到azure应用程序服务?非常感谢您的帮助来解决这个问题。我已经尝试了两天多了。

最佳答案

试试这个:

https://github.com/Azure/azure-quickstart-templates/tree/master/quickstarts/microsoft.web/web-app-custom-domain-and-ssl

此外,也许可以使用 https://mxtoolbox.com/CNAMELookup.aspx 这样的第三方工具来验证您的 CNAME 记录(该错误消息非常具体)。

关于azure - 如何将自定义域名与Azure ARM模板部署绑定(bind),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52540074/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com