我有一个用于配置功能应用程序的ARM模板。
这是我的用于Function App的ARM模板的示例:
{
"apiVersion": "2015-08-01",
"type": "Microsoft.Web/sites",
"name": "MyAzureFunctionName",
"location": "[resourceGroup().location]",
"kind": "functionapp",
"dependsOn": [
"[resourceId('Microsoft.Web/serverfarms', variables('nameWithDashes'))]",
"[resourceId('Microsoft.Storage/storageAccounts', variables('storageName'))]"
],
"properties": {
"serverFarmId": "[resourceId('Microsoft.Web/serverfarms', 'MyAzureFunctionName')]",
"httpsOnly": true,
"siteConfig": {
"appSettings": [
{
...
}]
}
}
}
我已使用以下配置在我的功能应用程序中成功配置了自定义域“ mydomain.ca”:
{
"apiVersion": "2020-06-01",
"type": "Microsoft.Web/sites/hostNameBindings",
"name": "[concat('MyFunctionApp', '/', 'mydomain.ca')]",
"location": "[resourceGroup().location]",
"scale": null,
"properties": {
},
"dependsOn": [
"[resourceId('Microsoft.Web/sites', variables('nameWithDashes'))]"
]
}
保护我的Function App的下一步是将自定义域绑定到SSL证书。我正在尝试找到一种使用App Service托管证书的方法,以便Azure将创建和管理证书本身(请参阅Create App Service Managed Certificate
下面的选项)。
题
如何在Azure资源管理器模板中为我的功能应用程序的自定义域配置应用程序服务托管证书?
亚历克斯的评论很有帮助; 它具有所有重要的部分。但是,我无法使用链接的模板使其工作。
我没有使用链接的模板,而是回到使用嵌套的模板,它立即起作用。
{
"apiVersion": "2020-06-01",
"name": "nestedTemplate",
"type": "Microsoft.Resources/deployments",
"dependsOn": [
"[resourceId('Microsoft.Web/sites', variables('siteName'))]",
"[resourceId('Microsoft.Web/certificates', variables('certificateName'))]"
],
"properties": {
"mode": "Incremental",
"template": {
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"resources": [{
"apiVersion": "2019-08-01",
"type": "Microsoft.Web/sites/hostnameBindings",
"name": "[variables('hostNameBindingsName')]",
"location": "[resourceGroup().location)]",
"properties": {
"sslState": "SniEnabled",
"thumbprint": "[reference(resourceId('Microsoft.Web/certificates', variables('certificateName'))).Thumbprint]"
}
}]
}
}
}
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句