使用 ARM 模板问题的 Azure 仪表板部署

Azure dashboard deployment using ARM template issue

尝试通过 ARM 模板部署 Azure 仪表板并在部署后遇到问题(请参见下面的屏幕截图)。

以下文档用于构建模板: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

通过组合数组中的值解决了一个问题:

{
  "name": "Scope",
  "value": {
     "resourceIds": [
     "[parameters('log-analytics-workspace-id')]"
     ]
  }
},