Azure Portal Dashboard

This page shows how to write Terraform and Azure Resource Manager for Portal Dashboard and write them securely.

azurerm_dashboard (Terraform)

The Dashboard in Portal can be configured in Terraform with the resource name azurerm_dashboard. The following sections describe 9 examples of how to use the resource and its parameters.

Example Usage from GitHub

main.tf#L1
resource "azurerm_dashboard" "my-board" {
  name                = var.dashboard_name
  resource_group_name = var.resource_group_name
  location            = var.resource_group_location
  tags = var.tags
  dashboard_properties = templatefile(var.template_file)
05-dashboard.tf#L6
resource "azurerm_dashboard" "dashboard" {
  name                 = var.dashboard_name
  resource_group_name  = azurerm_resource_group.dashboard.name
  location             = var.dashboard_location
  dashboard_properties = templatefile("dashboard.tpl", {})
}
dashboard.tf#L1
resource "azurerm_dashboard" "azfinsim" {
  name                = format("%s-dashboard",var.prefix)
  resource_group_name = azurerm_resource_group.azfinsim.name
  location            = azurerm_resource_group.azfinsim.location
  tags = {
    source = "terraform"
dashboard.tf#L1
resource "azurerm_dashboard" "dashboard" {
  name                = local.dashboard_name
  resource_group_name = var.resource_group_name
  location            = var.location
  dashboard_properties = templatefile(var.dashboard_json_path,
    {
20-dashboard.tf#L1
resource "azurerm_dashboard" "chatbot-board" {
  name                = local.prefix
  resource_group_name = local.resource_groups_L2.Dashboard.name
  location            = local.resource_groups_L2.Dashboard.location
  tags = {
    source = "terraform"
20-dashboard.tf#L1
resource "azurerm_dashboard" "chatbot-board" {
  name                = local.prefix
  resource_group_name = local.resource_groups_L2.Dashboard.name
  location            = local.resource_groups_L2.Dashboard.location
  tags = {
    source = "terraform"
main.tf#L20
resource "azurerm_dashboard" "my-board" {
  name                = "my-cool-dashboard"
  resource_group_name = local.azure_asset_names.azurerm_resource_group
  location            = "eastus"
  tags = {
    source = "terraform"
resource.tf#L1
resource "azurerm_dashboard" "my_dashboard" {
  name                = var.res_dashboard_name
  resource_group_name = var.res_rg_name
  location            = var.res_location
  tags = {
    source = "terraform"
main.tf#L7
resource "azurerm_dashboard" "this" {
  dashboard_properties = var.dashboard_properties
  location             = var.location
  name                 = var.name
  resource_group_name  = var.resource_group_name
  tags                 = var.tags

Review your Terraform file for Azure best practices

Shisho Cloud, our free checker to make sure your Terraform configuration follows best practices, is available (beta).

Parameters

Explanation in Terraform Registry

Manages a shared dashboard in the Azure Portal.

Microsoft.Portal/dashboards (Azure Resource Manager)

The dashboards in Microsoft.Portal can be configured in Azure Resource Manager with the resource name Microsoft.Portal/dashboards. The following sections describe how to use the resource and its parameters.

Example Usage from GitHub

listDashboardsBySubscription.json#L50
            "type": "Microsoft.Portal/dashboards",
            "location": "eastus",
            "tags": {
              "aKey": "aValue",
              "anotherKey": "anotherValue"
            }
listDashboardsByResourceGroup.json#L51
            "type": "Microsoft.Portal/dashboards",
            "location": "eastus",
            "tags": {
              "aKey": "aValue",
              "anotherKey": "anotherValue"
            }
listDashboardsBySubscription.json#L50
            "type": "Microsoft.Portal/dashboards",
            "location": "eastus",
            "tags": {
              "aKey": "aValue",
              "anotherKey": "anotherValue"
            }
listDashboardsBySubscription.json#L50
            "type": "Microsoft.Portal/dashboards",
            "location": "eastus",
            "tags": {
              "aKey": "aValue",
              "anotherKey": "anotherValue"
            }
listDashboardsBySubscription.json#L50
            "type": "Microsoft.Portal/dashboards",
            "location": "eastus",
            "tags": {
              "aKey": "aValue",
              "anotherKey": "anotherValue"
            }
listDashboardsByResourceGroup.json#L51
            "type": "Microsoft.Portal/dashboards",
            "location": "eastus",
            "tags": {
              "aKey": "aValue",
              "anotherKey": "anotherValue"
            }
listDashboardsByResourceGroup.json#L51
            "type": "Microsoft.Portal/dashboards",
            "location": "eastus",
            "tags": {
              "aKey": "aValue",
              "anotherKey": "anotherValue"
            }
listDashboardsByResourceGroup.json#L51
            "type": "Microsoft.Portal/dashboards",
            "location": "eastus",
            "tags": {
              "aKey": "aValue",
              "anotherKey": "anotherValue"
            }
createOrUpdateDashboard.json#L94
        "type": "Microsoft.Portal/dashboards",
        "location": "eastus",
        "tags": {
          "aKey": "aValue",
          "anotherKey": "anotherValue"
        }
listDashboardsBySubscription.json#L50
            "type": "Microsoft.Portal/dashboards",
            "location": "eastus",
            "tags": {
              "aKey": "aValue",
              "anotherKey": "anotherValue"
            }

Frequently asked questions

What is Azure Portal Dashboard?

Azure Portal Dashboard is a resource for Portal of Microsoft Azure. Settings can be wrote in Terraform.

Where can I find the example code for the Azure Portal Dashboard?

For Terraform, the prashant101386/devops, jwendl/authorization-service-example and mkiernan/azfinsim source code examples are useful. See the Terraform Example section for further details.

For Azure Resource Manager, the otubukhay/kayrepotest, otubukhay/kayrepotest and otubukhay/kayrepotest source code examples are useful. See the Azure Resource Manager Example section for further details.

security-icon

Automate config file reviews on your commits

Fix issues in your infrastructure as code with auto-generated patches.