【发布时间】:2021-10-14 12:52:48
【问题描述】:
我有一个 Azure 应用服务。我想以编程方式安装站点扩展ASP.NET Core Logging Integration。
到目前为止,我所做的是:
- 通过 Azure 浏览器 GUI(开发工具 -> 扩展)手动安装站点扩展。
- 提取 ARM 模板(自动化 -> 导出模板)。
- 修剪 ARM 模板,使其仅包含站点和站点扩展。
- 通过 Azure 浏览器 GUI 删除站点扩展。
- 使用 CLI (
az deployment group create -f template.json...) 安装 ARM 模板(到同一个应用服务)。 - 在 Azure 浏览器 GUI 中,验证现在是否安装了站点扩展。
以上有效。 ARM 模板正确安装站点扩展。但我不明白如何。整个模板如下所示:
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"siteName": {
"type": "string"
},
"location": {
"type": "string"
}
},
"variables": {},
"resources": [
{
"type": "Microsoft.Web/sites",
"apiVersion": "2021-01-15",
"name": "[parameters('siteName')]",
"location": "[parameters('location')]",
"kind": "app",
"properties": {}
},
{
"type": "Microsoft.Web/sites/siteextensions",
"apiVersion": "2021-01-15",
"name": "[concat(parameters('siteName'), '/Microsoft.AspNetCore.AzureAppServices.SiteExtension')]",
"location": "West Europe",
"dependsOn": [
"[resourceId('Microsoft.Web/sites', parameters('siteName'))]"
]
}
]
}
据我所知,它没有指定要安装哪个站点扩展。所以我不明白为什么我的 ARM 模板会这样做。
谁能告诉我如何修改这个模板来安装不同的站点扩展?
【问题讨论】:
标签: azure arm-template azure-cli