├── Dashboard-ResourceGraph.json └── README.md /Dashboard-ResourceGraph.json: -------------------------------------------------------------------------------- 1 | { 2 | "properties": { 3 | "lenses": { 4 | "0": { 5 | "order": 0, 6 | "parts": { 7 | "0": { 8 | "position": { 9 | "x": 0, 10 | "y": 0, 11 | "colSpan": 19, 12 | "rowSpan": 1 13 | }, 14 | "metadata": { 15 | "inputs": [], 16 | "type": "Extension/HubsExtension/PartType/MarkdownPart", 17 | "settings": { 18 | "content": { 19 | "settings": { 20 | "content": "# General information\n", 21 | "title": "", 22 | "subtitle": "" 23 | } 24 | } 25 | } 26 | } 27 | }, 28 | "1": { 29 | "position": { 30 | "x": 0, 31 | "y": 1, 32 | "colSpan": 5, 33 | "rowSpan": 4 34 | }, 35 | "metadata": { 36 | "inputs": [ 37 | { 38 | "name": "partTitle", 39 | "value": "Current Context (Tenant and Subscriptions)", 40 | "isOptional": true 41 | }, 42 | { 43 | "name": "query", 44 | "value": "distinct(tenantId), subscriptionId", 45 | "isOptional": true 46 | }, 47 | { 48 | "name": "chartType", 49 | "isOptional": true 50 | } 51 | ], 52 | "type": "Extension/HubsExtension/PartType/ArgQueryGridTile", 53 | "settings": {} 54 | } 55 | }, 56 | "2": { 57 | "position": { 58 | "x": 5, 59 | "y": 1, 60 | "colSpan": 9, 61 | "rowSpan": 4 62 | }, 63 | "metadata": { 64 | "inputs": [ 65 | { 66 | "name": "partTitle", 67 | "value": "Resources by location", 68 | "isOptional": true 69 | }, 70 | { 71 | "name": "query", 72 | "value": "summarize count() by location | project location, total=count_ \r\n\r\n", 73 | "isOptional": true 74 | }, 75 | { 76 | "name": "chartType", 77 | "value": 1, 78 | "isOptional": true 79 | } 80 | ], 81 | "type": "Extension/HubsExtension/PartType/ArgQueryChartTile", 82 | "settings": {} 83 | } 84 | }, 85 | "3": { 86 | "position": { 87 | "x": 14, 88 | "y": 1, 89 | "colSpan": 5, 90 | "rowSpan": 4 91 | }, 92 | "metadata": { 93 | "inputs": [ 94 | { 95 | "name": "partTitle", 96 | "value": "Top 10 Resources by Type", 97 | "isOptional": true 98 | }, 99 | { 100 | "name": "chartType", 101 | "value": 2, 102 | "isOptional": true 103 | }, 104 | { 105 | "name": "query", 106 | "value": "summarize count() by type\r\n| project type, total=count_\r\n| top 10 by total", 107 | "isOptional": true 108 | } 109 | ], 110 | "type": "Extension/HubsExtension/PartType/ArgQueryChartTile", 111 | "settings": {} 112 | } 113 | }, 114 | "4": { 115 | "position": { 116 | "x": 0, 117 | "y": 5, 118 | "colSpan": 19, 119 | "rowSpan": 1 120 | }, 121 | "metadata": { 122 | "inputs": [], 123 | "type": "Extension/HubsExtension/PartType/MarkdownPart", 124 | "settings": { 125 | "content": { 126 | "settings": { 127 | "content": "# Virtual Machines", 128 | "title": "", 129 | "subtitle": "" 130 | } 131 | } 132 | } 133 | } 134 | }, 135 | "5": { 136 | "position": { 137 | "x": 0, 138 | "y": 6, 139 | "colSpan": 5, 140 | "rowSpan": 4 141 | }, 142 | "metadata": { 143 | "inputs": [ 144 | { 145 | "name": "partTitle", 146 | "value": "VMs by Operating System", 147 | "isOptional": true 148 | }, 149 | { 150 | "name": "chartType", 151 | "value": 2, 152 | "isOptional": true 153 | }, 154 | { 155 | "name": "query", 156 | "value": "extend OsOffer = aliases['Microsoft.Compute/virtualMachines/storageProfile.imageReference.offer']\r\n| where type =~ 'Microsoft.Compute/virtualmachines'\r\n| summarize count() by tostring(OsOffer)\r\n| project OsOffer, total=count_", 157 | "isOptional": true 158 | } 159 | ], 160 | "type": "Extension/HubsExtension/PartType/ArgQueryChartTile", 161 | "settings": {} 162 | } 163 | }, 164 | "6": { 165 | "position": { 166 | "x": 5, 167 | "y": 6, 168 | "colSpan": 9, 169 | "rowSpan": 4 170 | }, 171 | "metadata": { 172 | "inputs": [ 173 | { 174 | "name": "partTitle", 175 | "value": "VMs by SKU", 176 | "isOptional": true 177 | }, 178 | { 179 | "name": "query", 180 | "value": "extend sku = aliases['Microsoft.Compute/virtualMachines/sku.name'] \r\n| where type=~'Microsoft.Compute/virtualMachines'\r\n| summarize count() by tostring(sku)\r\n| project sku, total=count_", 181 | "isOptional": true 182 | }, 183 | { 184 | "name": "chartType", 185 | "value": 1, 186 | "isOptional": true 187 | } 188 | ], 189 | "type": "Extension/HubsExtension/PartType/ArgQueryChartTile", 190 | "settings": {} 191 | } 192 | }, 193 | "7": { 194 | "position": { 195 | "x": 14, 196 | "y": 6, 197 | "colSpan": 5, 198 | "rowSpan": 4 199 | }, 200 | "metadata": { 201 | "inputs": [ 202 | { 203 | "name": "partTitle", 204 | "value": "VMs by Location", 205 | "isOptional": true 206 | }, 207 | { 208 | "name": "query", 209 | "value": "where type =~ 'Microsoft.Compute/virtualmachines'\r\n| summarize count() by location\r\n| project location, total=count_", 210 | "isOptional": true 211 | }, 212 | { 213 | "name": "chartType", 214 | "value": 2, 215 | "isOptional": true 216 | } 217 | ], 218 | "type": "Extension/HubsExtension/PartType/ArgQueryChartTile", 219 | "settings": {} 220 | } 221 | }, 222 | "8": { 223 | "position": { 224 | "x": 0, 225 | "y": 10, 226 | "colSpan": 19, 227 | "rowSpan": 1 228 | }, 229 | "metadata": { 230 | "inputs": [], 231 | "type": "Extension/HubsExtension/PartType/MarkdownPart", 232 | "settings": { 233 | "content": { 234 | "settings": { 235 | "content": "# App Services", 236 | "title": "", 237 | "subtitle": "" 238 | } 239 | } 240 | } 241 | } 242 | }, 243 | "9": { 244 | "position": { 245 | "x": 0, 246 | "y": 11, 247 | "colSpan": 5, 248 | "rowSpan": 4 249 | }, 250 | "metadata": { 251 | "inputs": [ 252 | { 253 | "name": "partTitle", 254 | "value": "App Services by Kind", 255 | "isOptional": true 256 | }, 257 | { 258 | "name": "query", 259 | "value": "extend httpsOnly = aliases['Microsoft.Web/sites/httpsOnly'] \r\n| where type=~'Microsoft.Web/Sites'\r\n| summarize count() by kind\r\n| project kind, total=count_", 260 | "isOptional": true 261 | }, 262 | { 263 | "name": "chartType", 264 | "value": 2, 265 | "isOptional": true 266 | } 267 | ], 268 | "type": "Extension/HubsExtension/PartType/ArgQueryChartTile", 269 | "settings": {} 270 | } 271 | }, 272 | "10": { 273 | "position": { 274 | "x": 5, 275 | "y": 11, 276 | "colSpan": 9, 277 | "rowSpan": 4 278 | }, 279 | "metadata": { 280 | "inputs": [ 281 | { 282 | "name": "partTitle", 283 | "value": "App Service Plans by SKU", 284 | "isOptional": true 285 | }, 286 | { 287 | "name": "query", 288 | "value": "extend sku = aliases['Microsoft.Web/serverfarms/sku.name'] \r\n| where type=~'Microsoft.Web/serverfarms'\r\n| summarize count() by tostring(sku)\r\n| project sku, total=count_", 289 | "isOptional": true 290 | }, 291 | { 292 | "name": "chartType", 293 | "value": 1, 294 | "isOptional": true 295 | } 296 | ], 297 | "type": "Extension/HubsExtension/PartType/ArgQueryChartTile", 298 | "settings": {} 299 | } 300 | }, 301 | "11": { 302 | "position": { 303 | "x": 14, 304 | "y": 11, 305 | "colSpan": 5, 306 | "rowSpan": 4 307 | }, 308 | "metadata": { 309 | "inputs": [ 310 | { 311 | "name": "partTitle", 312 | "value": "HTTPS Only configuration disabled on App Services", 313 | "isOptional": true 314 | }, 315 | { 316 | "name": "query", 317 | "value": "extend httpsOnly = aliases['Microsoft.Web/sites/httpsOnly'] \r\n| where type=~'Microsoft.Web/Sites' and httpsOnly =~ 'false'\r\n| summarize count() by subscriptionId\r\n| project subscriptionId, total=count_", 318 | "isOptional": true 319 | }, 320 | { 321 | "name": "chartType", 322 | "value": 2, 323 | "isOptional": true 324 | } 325 | ], 326 | "type": "Extension/HubsExtension/PartType/ArgQueryChartTile", 327 | "settings": {} 328 | } 329 | }, 330 | "12": { 331 | "position": { 332 | "x": 0, 333 | "y": 15, 334 | "colSpan": 9, 335 | "rowSpan": 3 336 | }, 337 | "metadata": { 338 | "inputs": [ 339 | { 340 | "name": "partTitle", 341 | "value": "Stopped App Sevices", 342 | "isOptional": true 343 | }, 344 | { 345 | "name": "query", 346 | "value": "extend state = aliases['Microsoft.Web/sites/state'] \r\n|extend hostname = aliases['Microsoft.Web/sites/defaultHostName']\r\n| where type=~'Microsoft.Web/Sites' and state =~ 'stopped'\r\n| project state, name, kind, hostname", 347 | "isOptional": true 348 | }, 349 | { 350 | "name": "chartType", 351 | "isOptional": true 352 | } 353 | ], 354 | "type": "Extension/HubsExtension/PartType/ArgQueryGridTile", 355 | "settings": {} 356 | } 357 | }, 358 | "13": { 359 | "position": { 360 | "x": 9, 361 | "y": 15, 362 | "colSpan": 10, 363 | "rowSpan": 3 364 | }, 365 | "metadata": { 366 | "inputs": [ 367 | { 368 | "name": "partTitle", 369 | "value": "App Service Plan Basic Information", 370 | "isOptional": true 371 | }, 372 | { 373 | "name": "query", 374 | "value": "extend NumberOfApps = aliases['Microsoft.Web/serverFarms/numberOfSites'] \r\n|where type=~'Microsoft.Web/serverfarms'\r\n| project Name=['name'], NumberOfApps, Location=['location']", 375 | "isOptional": true 376 | }, 377 | { 378 | "name": "chartType", 379 | "isOptional": true 380 | } 381 | ], 382 | "type": "Extension/HubsExtension/PartType/ArgQueryGridTile", 383 | "settings": {} 384 | } 385 | }, 386 | "14": { 387 | "position": { 388 | "x": 0, 389 | "y": 18, 390 | "colSpan": 19, 391 | "rowSpan": 1 392 | }, 393 | "metadata": { 394 | "inputs": [], 395 | "type": "Extension/HubsExtension/PartType/MarkdownPart", 396 | "settings": { 397 | "content": { 398 | "settings": { 399 | "content": "# Storage Accounts", 400 | "title": "", 401 | "subtitle": "" 402 | } 403 | } 404 | } 405 | } 406 | }, 407 | "15": { 408 | "position": { 409 | "x": 0, 410 | "y": 19, 411 | "colSpan": 5, 412 | "rowSpan": 4 413 | }, 414 | "metadata": { 415 | "inputs": [ 416 | { 417 | "name": "partTitle", 418 | "value": "Storage Account Configured with HTTPS Only Access", 419 | "isOptional": true 420 | }, 421 | { 422 | "name": "chartType", 423 | "value": 2, 424 | "isOptional": true 425 | }, 426 | { 427 | "name": "query", 428 | "value": "extend HTTPSOnly = aliases['Microsoft.Storage/storageAccounts/supportsHttpsTrafficOnly']\r\n| where type =~ \"microsoft.storage/storageaccounts\" and HTTPSOnly =~ 'false'\r\n| summarize count() by subscriptionId\r\n| project subscriptionId, Total=count_", 429 | "isOptional": true 430 | } 431 | ], 432 | "type": "Extension/HubsExtension/PartType/ArgQueryChartTile", 433 | "settings": {} 434 | } 435 | }, 436 | "16": { 437 | "position": { 438 | "x": 5, 439 | "y": 19, 440 | "colSpan": 9, 441 | "rowSpan": 4 442 | }, 443 | "metadata": { 444 | "inputs": [ 445 | { 446 | "name": "partTitle", 447 | "value": "Storage Accounts General Information", 448 | "isOptional": true 449 | }, 450 | { 451 | "name": "query", 452 | "value": "extend HTTPSOnly = aliases['Microsoft.Storage/storageAccounts/supportsHttpsTrafficOnly']\r\n| extend Type = aliases['Microsoft.Storage/storageAccounts/accountType']\r\n| extend BlobEncryption = aliases['Microsoft.Storage/storageAccounts/enableBlobEncryption']\r\n| extend FileEncryption = aliases['Microsoft.Storage/storageAccounts/enableFileEncryption']\r\n| where type =~ \"microsoft.storage/storageaccounts\"\r\n| project Name=['name'], Kind=['kind'], Type, HTTPSOnly, BlobEncryption, FileEncryption, Location=['location']", 453 | "isOptional": true 454 | }, 455 | { 456 | "name": "chartType", 457 | "isOptional": true 458 | } 459 | ], 460 | "type": "Extension/HubsExtension/PartType/ArgQueryGridTile", 461 | "settings": {} 462 | } 463 | }, 464 | "17": { 465 | "position": { 466 | "x": 14, 467 | "y": 19, 468 | "colSpan": 5, 469 | "rowSpan": 4 470 | }, 471 | "metadata": { 472 | "inputs": [ 473 | { 474 | "name": "partTitle", 475 | "value": "Storage Accounts by Location", 476 | "isOptional": true 477 | }, 478 | { 479 | "name": "query", 480 | "value": "where type =~ \"microsoft.storage/storageaccounts\"\r\n| summarize count() by location\r\n|project Location=['location'], Total=count_", 481 | "isOptional": true 482 | }, 483 | { 484 | "name": "chartType", 485 | "value": 2, 486 | "isOptional": true 487 | } 488 | ], 489 | "type": "Extension/HubsExtension/PartType/ArgQueryChartTile", 490 | "settings": {} 491 | } 492 | } 493 | } 494 | } 495 | }, 496 | "metadata": { 497 | "model": { 498 | "timeRange": { 499 | "value": { 500 | "relative": { 501 | "duration": 24, 502 | "timeUnit": 1 503 | } 504 | }, 505 | "type": "MsPortalFx.Composition.Configuration.ValueTypes.TimeRange" 506 | }, 507 | "filterLocale": { 508 | "value": "en-us" 509 | }, 510 | "filters": { 511 | "value": { 512 | "MsPortalFx_Subscription": { 513 | "model": { 514 | "operator": "equals", 515 | "selectAllState": "all" 516 | }, 517 | "displayCache": { 518 | "name": "Subscription", 519 | "value": "all" 520 | }, 521 | "filteredPartIds": [ 522 | "StartboardPart-ArgQueryGridTile-3abb28c9-dda1-4a3c-9abf-0fac6d48d007", 523 | "StartboardPart-ArgQueryChartTile-3abb28c9-dda1-4a3c-9abf-0fac6d48d009", 524 | "StartboardPart-ArgQueryChartTile-3abb28c9-dda1-4a3c-9abf-0fac6d48d00b", 525 | "StartboardPart-ArgQueryChartTile-3abb28c9-dda1-4a3c-9abf-0fac6d48d00f", 526 | "StartboardPart-ArgQueryChartTile-3abb28c9-dda1-4a3c-9abf-0fac6d48d011", 527 | "StartboardPart-ArgQueryChartTile-3abb28c9-dda1-4a3c-9abf-0fac6d48d013", 528 | "StartboardPart-ArgQueryChartTile-3abb28c9-dda1-4a3c-9abf-0fac6d48d017", 529 | "StartboardPart-ArgQueryChartTile-3abb28c9-dda1-4a3c-9abf-0fac6d48d019", 530 | "StartboardPart-ArgQueryChartTile-3abb28c9-dda1-4a3c-9abf-0fac6d48d01b", 531 | "StartboardPart-ArgQueryGridTile-3abb28c9-dda1-4a3c-9abf-0fac6d48d01d", 532 | "StartboardPart-ArgQueryChartTile-3abb28c9-dda1-4a3c-9abf-0fac6d48d021", 533 | "StartboardPart-ArgQueryChartTile-3abb28c9-dda1-4a3c-9abf-0fac6d48d335", 534 | "StartboardPart-ArgQueryGridTile-f5b655df-dbdd-4b95-a396-57353d989007", 535 | "StartboardPart-ArgQueryChartTile-f5b655df-dbdd-4b95-a396-57353d989009", 536 | "StartboardPart-ArgQueryChartTile-f5b655df-dbdd-4b95-a396-57353d98900b", 537 | "StartboardPart-ArgQueryChartTile-f5b655df-dbdd-4b95-a396-57353d98900f", 538 | "StartboardPart-ArgQueryChartTile-f5b655df-dbdd-4b95-a396-57353d989011", 539 | "StartboardPart-ArgQueryChartTile-f5b655df-dbdd-4b95-a396-57353d989013", 540 | "StartboardPart-ArgQueryChartTile-f5b655df-dbdd-4b95-a396-57353d989017", 541 | "StartboardPart-ArgQueryChartTile-f5b655df-dbdd-4b95-a396-57353d989019", 542 | "StartboardPart-ArgQueryChartTile-f5b655df-dbdd-4b95-a396-57353d98901b", 543 | "StartboardPart-ArgQueryChartTile-f5b655df-dbdd-4b95-a396-57353d98901d", 544 | "StartboardPart-ArgQueryGridTile-f5b655df-dbdd-4b95-a396-57353d98901f", 545 | "StartboardPart-ArgQueryChartTile-f5b655df-dbdd-4b95-a396-57353d989023", 546 | "StartboardPart-ArgQueryChartTile-f5b655df-dbdd-4b95-a396-57353d989149", 547 | "StartboardPart-ArgQueryGridTile-b10e488f-b1e2-4529-ad78-c969dcd96007", 548 | "StartboardPart-ArgQueryChartTile-b10e488f-b1e2-4529-ad78-c969dcd96009", 549 | "StartboardPart-ArgQueryChartTile-b10e488f-b1e2-4529-ad78-c969dcd9600b", 550 | "StartboardPart-ArgQueryChartTile-b10e488f-b1e2-4529-ad78-c969dcd9600f", 551 | "StartboardPart-ArgQueryChartTile-b10e488f-b1e2-4529-ad78-c969dcd96011", 552 | "StartboardPart-ArgQueryChartTile-b10e488f-b1e2-4529-ad78-c969dcd96013", 553 | "StartboardPart-ArgQueryChartTile-b10e488f-b1e2-4529-ad78-c969dcd96017", 554 | "StartboardPart-ArgQueryChartTile-b10e488f-b1e2-4529-ad78-c969dcd96019", 555 | "StartboardPart-ArgQueryChartTile-b10e488f-b1e2-4529-ad78-c969dcd9601b", 556 | "StartboardPart-ArgQueryChartTile-b10e488f-b1e2-4529-ad78-c969dcd9601d", 557 | "StartboardPart-ArgQueryGridTile-b10e488f-b1e2-4529-ad78-c969dcd9601f", 558 | "StartboardPart-ArgQueryChartTile-b10e488f-b1e2-4529-ad78-c969dcd96023", 559 | "StartboardPart-ArgQueryChartTile-b10e488f-b1e2-4529-ad78-c969dcd96025", 560 | "StartboardPart-ArgQueryGridTile-ad7c3293-3d36-4bc0-b6a5-66b10c4cb007", 561 | "StartboardPart-ArgQueryChartTile-ad7c3293-3d36-4bc0-b6a5-66b10c4cb009", 562 | "StartboardPart-ArgQueryChartTile-ad7c3293-3d36-4bc0-b6a5-66b10c4cb00b", 563 | "StartboardPart-ArgQueryChartTile-ad7c3293-3d36-4bc0-b6a5-66b10c4cb00f", 564 | "StartboardPart-ArgQueryChartTile-ad7c3293-3d36-4bc0-b6a5-66b10c4cb011", 565 | "StartboardPart-ArgQueryChartTile-ad7c3293-3d36-4bc0-b6a5-66b10c4cb013", 566 | "StartboardPart-ArgQueryChartTile-ad7c3293-3d36-4bc0-b6a5-66b10c4cb017", 567 | "StartboardPart-ArgQueryChartTile-ad7c3293-3d36-4bc0-b6a5-66b10c4cb019", 568 | "StartboardPart-ArgQueryChartTile-ad7c3293-3d36-4bc0-b6a5-66b10c4cb01b", 569 | "StartboardPart-ArgQueryChartTile-ad7c3293-3d36-4bc0-b6a5-66b10c4cb01d", 570 | "StartboardPart-ArgQueryGridTile-ad7c3293-3d36-4bc0-b6a5-66b10c4cb01f", 571 | "StartboardPart-ArgQueryChartTile-ad7c3293-3d36-4bc0-b6a5-66b10c4cb023", 572 | "StartboardPart-ArgQueryChartTile-ad7c3293-3d36-4bc0-b6a5-66b10c4cb025", 573 | "StartboardPart-ArgQueryGridTile-ad7c3293-3d36-4bc0-b6a5-66b10c4cb67b", 574 | "StartboardPart-ArgQueryGridTile-ad7c3293-3d36-4bc0-b6a5-66b10c4cb6ab", 575 | "StartboardPart-ArgQueryChartTile-ad7c3293-3d36-4bc0-b6a5-66b10c4cb8a4", 576 | "StartboardPart-ArgQueryGridTile-ad7c3293-3d36-4bc0-b6a5-66b10c4cb8e0", 577 | "StartboardPart-ArgQueryChartTile-ad7c3293-3d36-4bc0-b6a5-66b10c4cb8f8", 578 | "StartboardPart-ArgQueryGridTile-208e2285-9873-4429-8951-2f4aaaa64007", 579 | "StartboardPart-ArgQueryChartTile-208e2285-9873-4429-8951-2f4aaaa64009", 580 | "StartboardPart-ArgQueryChartTile-208e2285-9873-4429-8951-2f4aaaa6400b", 581 | "StartboardPart-ArgQueryChartTile-208e2285-9873-4429-8951-2f4aaaa6400f", 582 | "StartboardPart-ArgQueryChartTile-208e2285-9873-4429-8951-2f4aaaa64011", 583 | "StartboardPart-ArgQueryChartTile-208e2285-9873-4429-8951-2f4aaaa64013", 584 | "StartboardPart-ArgQueryChartTile-208e2285-9873-4429-8951-2f4aaaa64017", 585 | "StartboardPart-ArgQueryChartTile-208e2285-9873-4429-8951-2f4aaaa64019", 586 | "StartboardPart-ArgQueryChartTile-208e2285-9873-4429-8951-2f4aaaa6401d", 587 | "StartboardPart-ArgQueryGridTile-208e2285-9873-4429-8951-2f4aaaa6401f", 588 | "StartboardPart-ArgQueryChartTile-208e2285-9873-4429-8951-2f4aaaa64023", 589 | "StartboardPart-ArgQueryChartTile-208e2285-9873-4429-8951-2f4aaaa64027", 590 | "StartboardPart-ArgQueryChartTile-208e2285-9873-4429-8951-2f4aaaa6402d", 591 | "StartboardPart-ArgQueryGridTile-208e2285-9873-4429-8951-2f4aaaa6402f", 592 | "StartboardPart-ArgQueryChartTile-208e2285-9873-4429-8951-2f4aaaa64031", 593 | "StartboardPart-ArgQueryGridTile-208e2285-9873-4429-8951-2f4aaaa64398", 594 | "StartboardPart-ArgQueryGridTile-208e2285-9873-4429-8951-2f4aaaa643f8", 595 | "StartboardPart-ArgQueryChartTile-208e2285-9873-4429-8951-2f4aaaa643fa", 596 | "StartboardPart-ArgQueryChartTile-208e2285-9873-4429-8951-2f4aaaa643fc", 597 | "StartboardPart-ArgQueryChartTile-208e2285-9873-4429-8951-2f4aaaa64400", 598 | "StartboardPart-ArgQueryChartTile-208e2285-9873-4429-8951-2f4aaaa64402", 599 | "StartboardPart-ArgQueryChartTile-208e2285-9873-4429-8951-2f4aaaa64404", 600 | "StartboardPart-ArgQueryChartTile-208e2285-9873-4429-8951-2f4aaaa64408", 601 | "StartboardPart-ArgQueryChartTile-208e2285-9873-4429-8951-2f4aaaa6440a", 602 | "StartboardPart-ArgQueryChartTile-208e2285-9873-4429-8951-2f4aaaa6440c", 603 | "StartboardPart-ArgQueryGridTile-208e2285-9873-4429-8951-2f4aaaa6440e", 604 | "StartboardPart-ArgQueryGridTile-208e2285-9873-4429-8951-2f4aaaa64410", 605 | "StartboardPart-ArgQueryChartTile-208e2285-9873-4429-8951-2f4aaaa64414", 606 | "StartboardPart-ArgQueryGridTile-208e2285-9873-4429-8951-2f4aaaa64416", 607 | "StartboardPart-ArgQueryChartTile-208e2285-9873-4429-8951-2f4aaaa64418", 608 | "StartboardPart-ArgQueryChartTile-208e2285-9873-4429-8951-2f4aaaa6441c", 609 | "StartboardPart-ArgQueryChartTile-208e2285-9873-4429-8951-2f4aaaa6441e", 610 | "StartboardPart-ArgQueryGridTile-208e2285-9873-4429-8951-2f4aaaa644e3", 611 | "StartboardPart-ArgQueryChartTile-208e2285-9873-4429-8951-2f4aaaa644e5", 612 | "StartboardPart-ArgQueryChartTile-208e2285-9873-4429-8951-2f4aaaa644e7", 613 | "StartboardPart-ArgQueryChartTile-208e2285-9873-4429-8951-2f4aaaa644eb", 614 | "StartboardPart-ArgQueryChartTile-208e2285-9873-4429-8951-2f4aaaa644ed", 615 | "StartboardPart-ArgQueryChartTile-208e2285-9873-4429-8951-2f4aaaa644ef", 616 | "StartboardPart-ArgQueryChartTile-208e2285-9873-4429-8951-2f4aaaa644f3", 617 | "StartboardPart-ArgQueryChartTile-208e2285-9873-4429-8951-2f4aaaa644f5", 618 | "StartboardPart-ArgQueryChartTile-208e2285-9873-4429-8951-2f4aaaa644f7", 619 | "StartboardPart-ArgQueryGridTile-208e2285-9873-4429-8951-2f4aaaa644f9", 620 | "StartboardPart-ArgQueryGridTile-208e2285-9873-4429-8951-2f4aaaa644fb", 621 | "StartboardPart-ArgQueryChartTile-208e2285-9873-4429-8951-2f4aaaa644ff", 622 | "StartboardPart-ArgQueryGridTile-208e2285-9873-4429-8951-2f4aaaa64501", 623 | "StartboardPart-ArgQueryChartTile-208e2285-9873-4429-8951-2f4aaaa64503", 624 | "StartboardPart-ArgQueryChartTile-208e2285-9873-4429-8951-2f4aaaa64507", 625 | "StartboardPart-ArgQueryChartTile-208e2285-9873-4429-8951-2f4aaaa64509", 626 | "StartboardPart-ArgQueryGridTile-f45a1dbe-2953-47bf-aa1a-20a5d10f8007", 627 | "StartboardPart-ArgQueryChartTile-f45a1dbe-2953-47bf-aa1a-20a5d10f8009", 628 | "StartboardPart-ArgQueryChartTile-f45a1dbe-2953-47bf-aa1a-20a5d10f800b", 629 | "StartboardPart-ArgQueryChartTile-f45a1dbe-2953-47bf-aa1a-20a5d10f800f", 630 | "StartboardPart-ArgQueryChartTile-f45a1dbe-2953-47bf-aa1a-20a5d10f8011", 631 | "StartboardPart-ArgQueryChartTile-f45a1dbe-2953-47bf-aa1a-20a5d10f8013", 632 | "StartboardPart-ArgQueryChartTile-f45a1dbe-2953-47bf-aa1a-20a5d10f8017", 633 | "StartboardPart-ArgQueryChartTile-f45a1dbe-2953-47bf-aa1a-20a5d10f8019", 634 | "StartboardPart-ArgQueryChartTile-f45a1dbe-2953-47bf-aa1a-20a5d10f801b", 635 | "StartboardPart-ArgQueryGridTile-f45a1dbe-2953-47bf-aa1a-20a5d10f801d", 636 | "StartboardPart-ArgQueryGridTile-f45a1dbe-2953-47bf-aa1a-20a5d10f801f", 637 | "StartboardPart-ArgQueryChartTile-f45a1dbe-2953-47bf-aa1a-20a5d10f8023", 638 | "StartboardPart-ArgQueryGridTile-f45a1dbe-2953-47bf-aa1a-20a5d10f8025", 639 | "StartboardPart-ArgQueryChartTile-f45a1dbe-2953-47bf-aa1a-20a5d10f8027" 640 | ] 641 | } 642 | } 643 | } 644 | } 645 | } 646 | }, 647 | "name": "Resource Graph - Inventory", 648 | "type": "Microsoft.Portal/dashboards", 649 | "location": "INSERT LOCATION", 650 | "tags": { 651 | "hidden-title": "Resource Graph - Inventory" 652 | }, 653 | "apiVersion": "2015-08-01-preview" 654 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## Example Azure Resource Graph queries 2 | Guiding article for dashboards here: https://www.wesleyhaakman.org/azure-lighthouse-resource-graph-dashboards/ 3 | 4 | ## Usage 5 | Make sure the Az.ResourceGraph module is installed (Install-Module -Name Az.ResourceGraph) 6 | Login using "Login-AzAccount" and simply copy/paste the query. 7 | 8 | If you prefer to query a single subscription, al you need to do so add the "-subscription" parameter to the Search-AzGraph command 9 | like Search-AzGraph -subscription "" -Query "distinct(tenantId), subscriptionId" 10 | 11 | ## Basic Information 12 | Get delegated Tenants + Subscriptions 13 | 14 | ``` 15 | Search-AzGraph -Query "distinct(tenantId), subscriptionId" 16 | ``` 17 | 18 | Top 10 resource by type 19 | 20 | ``` 21 | Search-AzGraph -Query "summarize count() by type 22 | | project type, total=count_ 23 | | top 10 by type 24 | | order by total desc" 25 | ``` 26 | 27 | Resources by location 28 | 29 | ``` 30 | Search-AzGraph -Query "summarize count() by location 31 | | project location, total=count_ 32 | | order by total desc" 33 | ``` 34 | 35 | ## Web Apps 36 | 37 | Check for HTTPS Only on App Services 38 | 39 | ``` 40 | Search-AzGraph -Query "extend httpsOnly = aliases['Microsoft.Web/sites/httpsOnly'] 41 | | where type =~'Microsoft.Web/Sites' and httpsOnly =~ 'false' 42 | | project AppService=['name'], Kind=['kind'], Subscription=['subscriptionId']" 43 | ``` 44 | 45 | Stopped App Services 46 | 47 | ``` 48 | Search-AzGraph -Query "extend state = aliases['Microsoft.Web/sites/state'] 49 | | where type=~'Microsoft.Web/Sites' and state =~ 'stopped' 50 | | project AppService=['name'], Kind=['kind'], State=['state'], Subscription=['subscriptionId']" 51 | ``` 52 | 53 | App Service Plans count by SKU 54 | 55 | ``` 56 | Search-AzGraph -Query "extend sku = aliases['Microsoft.Web/serverfarms/sku.name'] 57 | | where type=~'Microsoft.Web/serverfarms' 58 | | summarize count() by tostring(sku) 59 | | project sku, total=count_" 60 | ``` 61 | 62 | App Service Plans Basic Information 63 | 64 | ``` 65 | Search-AzGraph -Query "extend sku = aliases['Microsoft.Web/serverfarms/sku.name'] 66 | | extend NumberOfApps = aliases['Microsoft.Web/serverFarms/numberOfSites'] 67 | | where type=~'Microsoft.Web/serverfarms' 68 | | project Name=['name'], sku, NumberOfApps, Location=['location']" 69 | ``` 70 | 71 | App Service plans count by Web Apps 72 | 73 | ``` 74 | Search-AzGraph -Query "extend NumberOfApps = aliases['Microsoft.Web/serverFarms/numberOfSites'] 75 | | where type=~'Microsoft.Web/serverfarms' 76 | | project Name=['name'], NumberOfApps, Location=['location']" 77 | ``` 78 | 79 | ## Virtual machines 80 | 81 | VMs overview 82 | 83 | ``` 84 | Search-AzGraph -Query "extend OS = aliases['Microsoft.Compute/virtualMachines/storageProfile.osDisk.osType'] 85 | | extend 86 | SKU = aliases['Microsoft.Compute/virtualMachines/sku.name'], 87 | OSSpecific = aliases['Microsoft.Compute/virtualMachines/storageProfile.imageReference.offer'], 88 | Version = aliases['Microsoft.Compute/virtualMachines/storageProfile.imageReference.sku'] 89 | | where type =~ 'Microsoft.Compute/VirtualMachines' 90 | | project name, OS, OSSpecific, Version, SKU, Location=['location'], Subscription=['subscriptionId']" |ft 91 | ``` 92 | 93 | VMs count by operating system 94 | 95 | ``` 96 | Search-AzGraph -Query "extend Os = aliases['Microsoft.Compute/virtualMachines/storageProfile.osDisk.osType'] 97 | | where type =~ 'Microsoft.Compute/virtualmachines' 98 | | summarize count() by tostring(Os) 99 | | project Os, total=count_" 100 | ``` 101 | 102 | VMs count by image offer 103 | 104 | ``` 105 | Search-AzGraph -Query "extend OsOffer = aliases['Microsoft.Compute/virtualMachines/storageProfile.imageReference.offer'] 106 | | where type =~ 'Microsoft.Compute/virtualmachines' 107 | | summarize count() by tostring(OsOffer) 108 | | project OsOffer, total=count_" 109 | ``` 110 | 111 | VMs count by size 112 | 113 | ``` 114 | Search-AzGraph -Query "extend sku = aliases['Microsoft.Compute/virtualMachines/sku.name'] 115 | | where type=~'Microsoft.Compute/virtualMachines' 116 | | summarize count() by tostring(sku) 117 | | project sku, total=count_" 118 | ``` 119 | 120 | Disks with illogical sizes 121 | 122 | ``` 123 | Search-AzGraph -Query "where type == 'microsoft.compute/disks' 124 | | where properties.diskSizeGB > 128 125 | or properties.diskSizeGB < 126 126 | | where properties.diskSizeGB > 256 127 | or properties.diskSizeGB < 250 128 | | where properties.diskSizeGB > 512 129 | or properties.diskSizeGB < 490 130 | | where properties.diskSizeGB > 1024 131 | or properties.diskSizeGB < 1000 132 | | where properties.diskSizeGB > 2048 133 | or properties.diskSizeGB < 2030 134 | | where properties.diskSizeGB > 4096 135 | or properties.diskSizeGB < 4090 136 | | project Name=name, Size=properties.diskSizeGB, ResourceGroup=resourceGroup, Subscription=subscriptionId" 137 | ``` 138 | 139 | ## SQL Databases 140 | 141 | PaaS SQL Databases count by type 142 | 143 | ``` 144 | Search-AzGraph -Query "where type=~ 'Microsoft.DBforMySQL/servers' 145 | or type=~'Microsoft.SQL/servers/databases' 146 | or type=~'Microsoft.DBforPostgreSQL/servers' 147 | or type=~'Microsoft.DBforMariaDB/servers' 148 | | summarize count() by type 149 | | project type, total=count_ 150 | | order by total desc" 151 | ``` 152 | 153 | PaaS SQL Databases count by location 154 | 155 | ``` 156 | Search-AzGraph -Query "where type=~ 'Microsoft.DBforMySQL/servers' 157 | or type=~'Microsoft.SQL/servers/databases' 158 | or type=~'Microsoft.DBforPostgreSQL/servers' 159 | or type=~'Microsoft.DBforMariaDB/servers' 160 | | summarize count() by location 161 | | project location, total=count_ 162 | | order by total desc" 163 | ``` 164 | 165 | PaaS SQL Databases overview 166 | 167 | ``` 168 | Search-AzGraph -Query "where type=~ 'Microsoft.DBforMySQL/servers' 169 | or type=~'Microsoft.SQL/servers/databases' 170 | or type=~'Microsoft.DBforPostgreSQL/servers' 171 | or type=~'Microsoft.DBforMariaDB/servers' 172 | | project name, type, location, subscriptionId" 173 | ``` 174 | 175 | ## Storage Accounts 176 | 177 | Storage Accounts count by Location 178 | 179 | ``` 180 | Search-AzGraph -Query "where type =~ 'microsoft.storage/storageaccounts' 181 | | summarize count() by location| project Location=['location'], Total=count_" 182 | ``` 183 | 184 | Storage accounts HTTPS Only check count by Subscription 185 | 186 | ``` 187 | Search-AzGraph -Query "extend HTTPSOnly = aliases['Microsoft.Storage/storageAccounts/supportsHttpsTrafficOnly'] 188 | | where type =~ 'microsoft.storage/storageaccounts' and HTTPSOnly =~ 'false' 189 | | summarize count() by subscriptionId 190 | | project subscriptionId, Total=count_" 191 | ``` 192 | 193 | Storage Accounts overview 194 | 195 | ``` 196 | Search-AzGraph -Query "extend HTTPSOnly = aliases['Microsoft.Storage/storageAccounts/supportsHttpsTrafficOnly'] 197 | | extend 198 | Type = aliases['Microsoft.Storage/storageAccounts/accountType'], 199 | BlobEncryption = aliases['Microsoft.Storage/storageAccounts/enableBlobEncryption'], 200 | FileEncryption = aliases['Microsoft.Storage/storageAccounts/enableFileEncryption'] 201 | | where type =~ 'microsoft.storage/storageaccounts' 202 | | project Name=['name'], Kind=['kind'], Type, HTTPSOnly, BlobEncryption, FileEncryption, Location=['location'], SubscriptionID=['subscriptionId']" 203 | |ft 204 | ``` 205 | --------------------------------------------------------------------------------