使用 ARM 模板问题的 Azure 仪表板部署
Posted
技术标签:
【中文标题】使用 ARM 模板问题的 Azure 仪表板部署【英文标题】:Azure dashboard deployment using ARM template issue 【发布时间】:2021-10-23 15:48:16 【问题描述】:尝试通过 ARM 模板部署 Azure Dashboard,部署后出现问题(见下方截图)。
以下文档用于构建模板:Azure Dashboard
ARM 模板如下:
"log-analytics-workspace-id":
"type": "string",
"defaultValue": "/subscriptions/xxxx-xxxx-xxxx-xxxx-xxxx/resourcegroups/rg-ProjectX-dev-infra",
"allowedValues": [
"/subscriptions/xxxx-xxxx-xxxx-xxxx-xxxx/resourcegroups/rg-ProjectX-dev-infra"
],
"metadata":
"description": "The resource ID for an existing Log Analytics workspace."
"variables":
"la-name": "[concat('la', '-', parameters('base-name'), '-', 'workspace')]",
"name": "Scope",
"value":
"resourceIds": "[resourceId('Microsoft.Operationalinsights/workspaces', parameters('log-analytics-workspace-id'), variables('la-name'))]"
,
"isOptional": true
resourceIds 值定义如下:
"name": "Scope",
"value":
"resourceIds": "[parameters('log-analytics-workspace-id')]"
,
"isOptional": true
,
...和参数定义log-analytics-workspace-id:
"log-analytics-workspace-id":
"type": "string",
"defaultValue": "/subscriptions/xxxx-xxxx-xxxx-xxxx-xxxx/resourcegroups/rg-ProjectX-dev-infra/providers/microsoft.operationalinsights/workspaces/la-ProjectX-dev-workspace",
"allowedValues": [
"/subscriptions/xxxx-xxxx-xxxx-xxxx-xxxx/resourcegroups/rg-ProjectX-dev-infra/providers/microsoft.operationalinsights/workspaces/la-ProjectX-dev-workspace"
],
"metadata":
"description": "The resource ID for an existing Log Analytics workspace."
Azure 仪表板已成功部署,但仪表板尚未运行:
Azure dashboard view
【问题讨论】:
【参考方案1】:通过组合数组中的值修复了一个问题:
"name": "Scope",
"value":
"resourceIds": [
"[parameters('log-analytics-workspace-id')]"
]
,
【讨论】:
以上是关于使用 ARM 模板问题的 Azure 仪表板部署的主要内容,如果未能解决你的问题,请参考以下文章
无法使用已装载存储的 Linux 部署 Azure 应用服务的 ARM 模板
在为 ARM 模板部署创建的 Azure DevOps Pipeline 中找不到 JSON 文件路径