{ "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", "contentVersion": "1.0.0.0", "parameters": { "dashboardName": { "type": "string" }, "location": { "type": "string" }, "targetMG": { "type": "string", "metadata": { "description": "Target Management Group" } } }, "variables": { "budgetid": "[concat('budget-', parameters('dashboardName'))]", "dashtitle": "[concat(parameters('dashboardName'), ' Azure Dashboard')]" }, "resources": [ { "properties": { "lenses": { "0": { "order": 0, "parts": { "0": { "position": { "x": 0, "y": 0, "colSpan": 4, "rowSpan": 4 }, "metadata": { "inputs": [], "type": "Extension/HubsExtension/PartType/MarkdownPart", "settings": { "content": { "settings": { "content": "__Dashboard usage__\n\nUse the dashboard to get a comprehensive view of the Azure environment. \n", "title": "[variables('dashtitle')]", "subtitle": "State of the Day", "markdownSource": 1, "markdownUri": null } } } } }, "1": { "position": { "x": 4, "y": 0, "colSpan": 2, "rowSpan": 2 }, "metadata": { "inputs": [], "type": "Extension/Microsoft_AAD_IAM/PartType/OrganizationIdentityPart" } }, "2": { "position": { "x": 6, "y": 0, "colSpan": 2, "rowSpan": 3 }, "metadata": { "inputs": [], "type": "Extension/Microsoft_Azure_Security/PartType/SecurityMetricGalleryTileViewModel" } }, "3": { "position": { "x": 8, "y": 0, "colSpan": 6, "rowSpan": 4 }, "metadata": { "inputs": [ { "name": "scope", "value": "[subscription().id]" }, { "name": "scopeName", "value": "[subscription().displayName]" }, { "name": "view", "value": { "currency": "EUR", "dateRange": "CurrentBillingPeriod", "query": { "type": "ActualCost", "dataSet": { "granularity": "Daily", "aggregation": { "totalCost": { "name": "Cost", "function": "Sum" } }, "sorting": [ { "direction": "ascending", "name": "UsageDate" } ] }, "timeframe": "None" }, "chart": "Area", "accumulated": "true", "pivots": [ { "type": "Dimension", "name": "ServiceName" }, { "type": "Dimension", "name": "ResourceLocation" }, { "type": "Dimension", "name": "Subscription" } ], "scope": "[subscription().id]", "kpis": [ { "type": "Budget", "id": "[subscriptionResourceId('Microsoft.Consumption/budgets', variables('budgetid'))]", "enabled": true, "extendedProperties": {} }, { "type": "Forecast", "enabled": true } ], "displayName": "DefaultCostAnalysis" }, "isOptional": true }, { "name": "externalState", "isOptional": true } ], "type": "Extension/Microsoft_Azure_CostManagement/PartType/CostAnalysisPinPart", "deepLink": "#blade/Microsoft_Azure_CostManagement/Menu/costanalysis" } }, "4": { "position": { "x": 4, "y": 2, "colSpan": 2, "rowSpan": 2 }, "metadata": { "inputs": [], "type": "Extension/HubsExtension/PartType/ClockPart", "settings": { "content": { "settings": { "timezoneId": "W. Europe Standard Time", "timeFormat": "HH:mm", "version": 1 } } } } }, "5": { "position": { "x": 0, "y": 4, "colSpan": 8, "rowSpan": 2 }, "metadata": { "inputs": [], "type": "Extension/HubsExtension/PartType/MarkdownPart", "settings": { "content": { "settings": { "content": "[concat('View all policies on managementgroup ', parameters('targetMG'))]", "title": "All Policies assigned to ManagementGroups", "subtitle": "My subtitle", "markdownSource": 1, "markdownUri": null } } } } }, "6": { "position": { "x": 0, "y": 6, "colSpan": 10, "rowSpan": 4 }, "metadata": { "inputs": [ { "name": "chartType", "isOptional": true }, { "name": "isShared", "isOptional": true }, { "name": "queryId", "isOptional": true }, { "name": "partTitle", "value": "Query 1", "isOptional": true }, { "name": "query", "value": "//Combine compliant with non-compliant\npolicyresources\n| where properties['policyAssignmentScope'] has \"/providers/Microsoft.Management/managementGroups/\"\n| extend ComplianceState = properties['complianceState']\n| summarize NonCompliantResources = countif(ComplianceState == \"NonCompliant\") by policyAssignmentName = tostring(properties['policyAssignmentName'])\n| join ( policyresources\n\t| where properties['policyAssignmentScope'] has \"/providers/Microsoft.Management/managementGroups/\"\n\t| extend ComplianceState = properties['complianceState']\n\t| summarize CompliantResources = countif(ComplianceState == \"Compliant\") by policyAssignmentName = tostring(properties['policyAssignmentName'])\n\t) on policyAssignmentName\n| project policyAssignmentName, NonCompliantResources, CompliantResources", "isOptional": true }, { "name": "formatResults", "value": true, "isOptional": true } ], "type": "Extension/HubsExtension/PartType/ArgQueryGridTile", "settings": {} } }, "7": { "position": { "x": 0, "y": 10, "colSpan": 7, "rowSpan": 1 }, "metadata": { "inputs": [], "type": "Extension/HubsExtension/PartType/MarkdownPart", "settings": { "content": { "settings": { "content": "\n", "title": "Non-Compliant Resources", "subtitle": "For policy Assignment location-lock", "markdownSource": 1, "markdownUri": null } } } } }, "8": { "position": { "x": 0, "y": 11, "colSpan": 25, "rowSpan": 6 }, "metadata": { "inputs": [ { "name": "chartType", "isOptional": true }, { "name": "isShared", "isOptional": true }, { "name": "queryId", "isOptional": true }, { "name": "partTitle", "value": "Query 1", "isOptional": true }, { "name": "query", "value": "policyresources\r\n| where properties['complianceState'] == \"NonCompliant\" and properties['policyAssignmentName'] == \"location-lock\"\r\n| project location, resourceGroup, properties['policyAssignmentName'], properties['resourceType'], properties['resourceId']", "isOptional": true }, { "name": "formatResults", "value": true, "isOptional": true } ], "type": "Extension/HubsExtension/PartType/ArgQueryGridTile", "settings": {} } }, "9": { "position": { "x": 0, "y": 17, "colSpan": 7, "rowSpan": 1 }, "metadata": { "inputs": [], "type": "Extension/HubsExtension/PartType/MarkdownPart", "settings": { "content": { "settings": { "content": "", "title": "Resource Information", "subtitle": "Overview of Resources | VM Sizes", "markdownSource": 1, "markdownUri": null } } } } }, "10": { "position": { "x": 0, "y": 18, "colSpan": 6, "rowSpan": 7 }, "metadata": { "inputs": [ { "name": "resourceType", "value": "Microsoft.Resources/resources", "isOptional": true }, { "name": "filter", "isOptional": true }, { "name": "scope", "isOptional": true }, { "name": "kind", "isOptional": true } ], "type": "Extension/HubsExtension/PartType/BrowseAllResourcesPinnedPart" } }, "11": { "position": { "x": 6, "y": 18, "colSpan": 7, "rowSpan": 7 }, "metadata": { "inputs": [ { "name": "isShared", "isOptional": true }, { "name": "queryId", "isOptional": true }, { "name": "formatResults", "isOptional": true }, { "name": "partTitle", "value": "Query 1", "isOptional": true }, { "name": "query", "value": "// VM Count by size\nextend sku = aliases['Microsoft.Compute/virtualMachines/sku.name'] \n| where type=~'Microsoft.Compute/virtualMachines' \n| summarize count() by tostring(sku) \n| project sku, total=count_", "isOptional": true }, { "name": "chartType", "value": 1, "isOptional": true } ], "type": "Extension/HubsExtension/PartType/ArgQueryChartTile", "settings": {} } }, "12": { "position": { "x": 13, "y": 18, "colSpan": 11, "rowSpan": 6 }, "metadata": { "inputs": [ { "name": "chartType", "isOptional": true }, { "name": "isShared", "isOptional": true }, { "name": "queryId", "isOptional": true }, { "name": "formatResults", "isOptional": true }, { "name": "partTitle", "value": "Query 1", "isOptional": true }, { "name": "query", "value": "Resources\n| where type =~ 'microsoft.compute/virtualmachines'\n| extend nics=array_length(properties.networkProfile.networkInterfaces) \n| mv-expand nic=properties.networkProfile.networkInterfaces \n| where nics == 1 or nic.properties.primary =~ 'true' or isempty(nic) \n| project vmId = id, vmName = name, vmSize=tostring(properties.hardwareProfile.vmSize), nicId = tostring(nic.id) \n| join kind=leftouter (\n Resources\n | where type =~ 'microsoft.network/networkinterfaces'\n | extend ipConfigsCount=array_length(properties.ipConfigurations) \n | mv-expand ipconfig=properties.ipConfigurations \n | where ipConfigsCount == 1 or ipconfig.properties.primary =~ 'true'\n | project nicId = id, publicIpId = tostring(ipconfig.properties.publicIPAddress.id))\non nicId\n| project-away nicId1\n| summarize by vmId, vmName, vmSize, nicId, publicIpId\n| join kind=leftouter (\n Resources\n | where type =~ 'microsoft.network/publicipaddresses'\n | project publicIpId = id, publicIpAddress = properties.ipAddress)\non publicIpId\n| project-away publicIpId1", "isOptional": true } ], "type": "Extension/HubsExtension/PartType/ArgQueryGridTile", "settings": {} } }, "13": { "position": { "x": 0, "y": 25, "colSpan": 7, "rowSpan": 1 }, "metadata": { "inputs": [], "type": "Extension/HubsExtension/PartType/MarkdownPart", "settings": { "content": { "settings": { "content": "", "title": "Public IP Addresses", "subtitle": "", "markdownSource": 1, "markdownUri": null } } } } }, "14": { "position": { "x": 0, "y": 26, "colSpan": 6, "rowSpan": 4 }, "metadata": { "inputs": [ { "name": "chartType", "isOptional": true }, { "name": "isShared", "isOptional": true }, { "name": "queryId", "isOptional": true }, { "name": "formatResults", "isOptional": true }, { "name": "partTitle", "value": "Query 1", "isOptional": true }, { "name": "query", "value": "Resources\n| where type contains 'publicIPAddresses' and isnotempty(properties.ipAddress)\n| project properties.ipAddress\n| limit 100", "isOptional": true } ], "type": "Extension/HubsExtension/PartType/ArgQueryGridTile", "settings": {} } } } } }, "metadata": { "model": { "timeRange": { "value": { "relative": { "duration": 24, "timeUnit": 1 } }, "type": "MsPortalFx.Composition.Configuration.ValueTypes.TimeRange" }, "filterLocale": { "value": "en-us" }, "filters": { "value": { "MsPortalFx_TimeRange": { "model": { "format": "utc", "granularity": "auto", "relative": "24h" }, "displayCache": { "name": "UTC Time", "value": "Past 24 hours" }, "filteredPartIds": [] } } } } } }, "name": "[parameters('dashboardName')]", "type": "Microsoft.Portal/dashboards", "location": "[parameters('location')]", "tags": { "hidden-title": "[parameters('dashboardName')]" }, "apiVersion": "2015-08-01-preview" } ] }