Search code examples
azuredashboardazure-rm-template

Azure dashboard deployment using ARM template issue


Trying to deploy Azure Dashboard through ARM template and getting an issue after deployment (see screenshot below).

The following document was used to construct template: Azure Dashboard

ARM template looks like:

      "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 value defined like:

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

...and paremeter defined 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 Dashboard has deployed successfully, however, the dashboard is not operational yet:

Azure dashboard view


Solution

  • Fixed an issue by combining the value in array:

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