-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-governance.workbook
7900 lines (7900 loc) · 424 KB
/
azure-governance.workbook
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
{
"version": "Notebook/1.0",
"items": [
{
"type": 12,
"content": {
"version": "NotebookGroup/1.0",
"groupType": "editable",
"items": [
{
"type": 11,
"content": {
"version": "LinkItem/1.0",
"style": "tabs",
"links": [
{
"id": "19b06e9e-eec2-4a7e-935d-92d77b2f87a3",
"cellValue": "SelectedTab",
"linkTarget": "parameter",
"linkLabel": "Overview",
"subTarget": "RC_Overview",
"preText": "",
"style": "link"
},
{
"id": "528e35b9-aca4-423f-9267-50f62011a3cb",
"cellValue": "SelectedTab",
"linkTarget": "parameter",
"linkLabel": "Virtual machine",
"subTarget": "RC_VM",
"style": "link"
},
{
"id": "7faacfc6-663e-4ff5-bb64-f86d995f9563",
"cellValue": "SelectedTab",
"linkTarget": "parameter",
"linkLabel": "Storage + backup",
"subTarget": "RC_Storage",
"style": "link"
},
{
"id": "c17ce2c0-83e6-4e5c-9c3e-f34cbf887e73",
"cellValue": "SelectedTab",
"linkTarget": "parameter",
"linkLabel": "Network",
"subTarget": "RC_Network",
"style": "link"
},
{
"id": "2f4e49d7-3198-4173-af1c-4cf4c5178000",
"cellValue": "SelectedTab",
"linkTarget": "parameter",
"linkLabel": "PaaS",
"subTarget": "RC_PaaS",
"style": "link"
},
{
"id": "f8f7e1fc-8f5d-442a-9788-3eabbf8ab275",
"cellValue": "SelectedTab",
"linkTarget": "parameter",
"linkLabel": "Security",
"subTarget": "RC_Security",
"style": "link"
},
{
"id": "80ad2db8-a21e-43e9-bd28-75d8d606eaf5",
"cellValue": "SelectedTab",
"linkTarget": "parameter",
"linkLabel": "Monitoring",
"subTarget": "RC_Monitoring",
"style": "link"
},
{
"id": "6fc0fef0-a016-4923-9239-b641eb5bdc4f",
"cellValue": "SelectedTab",
"linkTarget": "parameter",
"linkLabel": "Services retirement",
"subTarget": "RC_ServicesRetirement",
"style": "link"
},
{
"id": "e40dbf66-2abe-4bcf-acd7-1ee6d8fc950b",
"cellValue": "SelectedTab",
"linkTarget": "parameter",
"linkLabel": "Resource age",
"subTarget": "RC_Age",
"style": "link"
},
{
"id": "e112c6e1-db5e-4b0e-99e9-2edac0eba177",
"cellValue": "SelectedTab",
"linkTarget": "parameter",
"linkLabel": "Tag explorer",
"subTarget": "RC_Tag",
"style": "link"
},
{
"id": "840cd5ea-6b74-484b-846f-01d424b295cd",
"cellValue": "SelectedTab",
"linkTarget": "parameter",
"linkLabel": "Cost management",
"subTarget": "RC_Cost",
"style": "link"
},
{
"id": "5436a8c9-73c4-4121-a814-dd6fbb0c0d0c",
"cellValue": "SelectedTab",
"linkTarget": "parameter",
"linkLabel": "Usage + limits",
"subTarget": "RC_Quota",
"style": "link"
},
{
"id": "fa81b57a-8f3c-4502-beb0-128a7fc35f7c",
"cellValue": "SelectedTab",
"linkTarget": "parameter",
"linkLabel": "Compliance",
"subTarget": "RC_Compliance",
"style": "link"
},
{
"id": "e3acf38e-2dc4-423e-b91d-a173280b5808",
"cellValue": "SelectedTab",
"linkTarget": "parameter",
"linkLabel": "Governance",
"subTarget": "RC_Governance",
"style": "link"
}
]
},
"name": "RC_Menu"
},
{
"type": 9,
"content": {
"version": "KqlParameterItem/1.0",
"crossComponentResources": [ "value::tenant" ],
"parameters": [
{
"id": "5704765e-092d-41cb-b856-e5d1d5337ac5",
"version": "KqlParameterItem/1.0",
"name": "ManagementGroup",
"label": "Management group",
"type": 2,
"query": "resourcecontainers\r\n| where type == \"microsoft.management/managementgroups\"\r\n| extend name = properties.displayName\r\n| project name",
"crossComponentResources": [ "value::tenant" ],
"typeSettings": {
"additionalResourceOptions": [],
"showDefault": false
},
"timeContext": {
"durationMs": 86400000
},
"queryType": 1,
"resourceType": "microsoft.resources/tenants",
"value": null
},
{
"id": "30297a43-7d69-4daf-93c9-8170d5a995b0",
"version": "KqlParameterItem/1.0",
"name": "Subscription",
"type": 6,
"isRequired": true,
"multiSelect": true,
"quote": "'",
"delimiter": ",",
"query": "resourcecontainers\r\n| where type == \"microsoft.resources/subscriptions\"\r\n| where properties['managementGroupAncestorsChain'] contains '{ManagementGroup:label}'",
"crossComponentResources": [ "value::tenant" ],
"typeSettings": {
"additionalResourceOptions": [ "value::all" ],
"showDefault": false
},
"timeContext": {
"durationMs": 86400000
},
"queryType": 1,
"resourceType": "microsoft.resources/tenants",
"value": []
}
],
"style": "above",
"queryType": 1,
"resourceType": "microsoft.resources/tenants"
},
"conditionalVisibilities": [
{
"parameterName": "SelectedTab",
"comparison": "isNotEqualTo",
"value": "RC_Age"
},
{
"parameterName": "SelectedTab",
"comparison": "isNotEqualTo",
"value": "RC_Cost"
},
{
"parameterName": "SelectedTab",
"comparison": "isNotEqualTo",
"value": "RC_Quota"
},
{
"parameterName": "SelectedTab",
"comparison": "isNotEqualTo",
"value": "RC_Compliance"
},
{
"parameterName": "SelectedTab",
"comparison": "isNotEqualTo",
"value": "RC_ServicesRetirement"
}
],
"name": "parameters - 0"
},
{
"type": 12,
"content": {
"version": "NotebookGroup/1.0",
"groupType": "editable",
"items": [
{
"type": 1,
"content": {
"json": "# Welcome the Azure governance workbook"
},
"name": "Welcome"
},
{
"type": 1,
"content": {
"json": "### Reference: [Governance in the Microsoft Cloud Adoption Framework for Azure](https://learn.microsoft.com/azure/cloud-adoption-framework/govern/)",
"style": "upsell"
},
"name": "Reference"
},
{
"type": 1,
"content": {
"json": "The objective of this workbook is to provide a comprehensive overview of the governance posture of your Azure environment. It offers the standard metrics aligned with the Cloud Adoption Framework for all the disciplines and has the capability to identify and apply recommendations to identify non compliance. This workbook is part of the [FinOps toolkit](https://aka.ms/finops/toolkit).\r\n\r\n## Overview of the Cloud Adoption Framework\r\n\r\n* With any cloud platform, there are common governance disciplines that help inform policies and align toolchains. These disciplines guide decisions about the proper level of automation and enforcement of corporate policy across cloud platforms.\r\n\r\n|Discipline|Description|\r\n|---|---|\r\n| [Cost Management](https://learn.microsoft.com/azure/cloud-adoption-framework/govern/cost-management/) | Cost is a primary concern for cloud users. Develop policies for cost control for all cloud platforms.\r\n| [Security Baseline](https://learn.microsoft.com/azure/cloud-adoption-framework/govern/security-baseline/) | Security is a complex subject, unique to each company. Once security requirements are established, cloud governance policies and enforcement apply those requirements across network, data, and asset configurations.\r\n| [Identity Baseline](https://learn.microsoft.com/azure/cloud-adoption-framework/govern/identity-baseline/) | Inconsistencies in the application of identity requirements can increase the risk of breach. The Identity Baseline discipline focuses on ensuring that identity is consistently applied across cloud adoption efforts.\r\n| [Resource Consistency](https://learn.microsoft.com/azure/cloud-adoption-framework/govern/resource-consistency/) | Cloud operations depend on consistent resource configuration. Through governance tooling, resources can be configured consistently to manage risks related to onboarding, drift, discoverability, and recovery.\r\n| [Deployment Acceleration](https://learn.microsoft.com/azure/cloud-adoption-framework/govern/deployment-acceleration/) | Centralization, standardization, and consistency in approaches to deployment and configuration improve governance practices. When provided through cloud-based governance tooling, they create a cloud factor that can accelerate deployment activities.\r\n\r\n* To assess your transformation journey, try the [governance benchmark tool](https://learn.microsoft.com/en-us/assessments/b1891add-7646-4d60-a875-32a4ab26327e).\r\n\r\n\r\n\r\n\r\n"
},
"name": "text - Overview"
},
{
"type": 1,
"content": {
"json": "## Prerequisites\r\n\r\nThis workbook will present various cost-related details in the form of governance, networking, storage, VMs, web apps, SQL, and cost information to educate the business about cost related to various resources.\r\n\r\nThis workbook requires the following least-privileged (minimum) roles:\r\n\r\n * **Reader** : allows you to import the workbook without saving it and view all of the workbook tabs except the *Cost management* tab.\r\n * **Cost Management Reader**: allows you to view the costs in the *Cost management* tab \r\n * **Workbook Contributor** : allows you to import and save the workbook\r\n\r\n\r\n"
},
"name": "text - 7"
},
{
"type": 12,
"content": {
"version": "NotebookGroup/1.0",
"groupType": "editable",
"items": [
{
"type": 3,
"content": {
"version": "KqlItem/1.0",
"query": "Resources\n| summarize count()",
"size": 3,
"title": "Count of all resources",
"queryType": 1,
"resourceType": "microsoft.resourcegraph/resources",
"crossComponentResources": [ "{Subscription}" ],
"visualization": "tiles",
"tileSettings": {
"titleContent": {
"columnMatch": "count_",
"formatter": 12,
"formatOptions": {
"palette": "auto"
}
},
"showBorder": false,
"size": "auto"
}
},
"name": "Count of all resources"
},
{
"type": 3,
"content": {
"version": "KqlItem/1.0",
"query": "resources\r\n| summarize Count=count(id) by subscriptionId\r\n| order by Count desc",
"size": 3,
"title": "Resource count per subscription (Top 10)",
"showExportToExcel": true,
"queryType": 1,
"resourceType": "microsoft.resourcegraph/resources",
"crossComponentResources": [ "{Subscription}" ],
"visualization": "tiles",
"gridSettings": {
"formatters": [
{
"columnMatch": "subscriptionId",
"formatter": 15,
"formatOptions": {
"linkTarget": null,
"showIcon": true
}
},
{
"columnMatch": "type",
"formatter": 1
}
],
"rowLimit": 10,
"hierarchySettings": {
"treeType": 1,
"groupBy": [ "subscriptionId" ],
"expandTopLevel": true
},
"labelSettings": [
{
"columnId": "subscriptionId",
"label": "Subscription name"
}
]
},
"sortBy": [],
"tileSettings": {
"titleContent": {
"columnMatch": "subscriptionId",
"formatter": 15,
"formatOptions": {
"linkTarget": "Resource",
"showIcon": true
}
},
"leftContent": {
"columnMatch": "Count",
"formatter": 12,
"formatOptions": {
"palette": "auto"
},
"numberFormat": {
"unit": 17,
"options": {
"style": "decimal",
"maximumFractionDigits": 2,
"maximumSignificantDigits": 3
}
}
},
"showBorder": false,
"rowLimit": 10,
"sortCriteriaField": "count_type",
"sortOrderField": 2
},
"graphSettings": {
"type": 0,
"topContent": {
"columnMatch": "subscriptionId",
"formatter": 1
},
"centerContent": {
"columnMatch": "Count",
"formatter": 1,
"numberFormat": {
"unit": 17,
"options": {
"maximumSignificantDigits": 3,
"maximumFractionDigits": 2
}
}
}
},
"chartSettings": {
"xAxis": "subscriptionId",
"yAxis": [ "Count" ],
"showLegend": true,
"seriesLabelSettings": [
{
"seriesName": "subscriptionId",
"color": "greenDark"
}
]
},
"mapSettings": {
"locInfo": "LatLong",
"sizeSettings": "Count",
"sizeAggregation": "Sum",
"legendMetric": "Count",
"legendAggregation": "Sum",
"itemColorSettings": {
"type": "heatmap",
"colorAggregation": "Sum",
"nodeColorField": "Count",
"heatmapPalette": "greenRed"
}
}
},
"name": "Resource count per subscription (Top 10)"
},
{
"type": 3,
"content": {
"version": "KqlItem/1.0",
"query": "Resources \r\n| extend type = case(\r\ntype contains 'microsoft.netapp/netappaccounts', 'NetApp Accounts',\r\ntype contains \"microsoft.compute\", \"Azure Compute\",\r\ntype contains \"microsoft.logic\", \"LogicApps\",\r\ntype contains 'microsoft.keyvault/vaults', \"Key Vaults\",\r\ntype contains 'microsoft.storage/storageaccounts', \"Storage Accounts\",\r\ntype contains 'microsoft.compute/availabilitysets', 'Availability Sets',\r\ntype contains 'microsoft.operationalinsights/workspaces', 'Azure Monitor Resources',\r\ntype contains 'microsoft.operationsmanagement', 'Operations Management Resources',\r\ntype contains 'microsoft.insights', 'Azure Monitor Resources',\r\ntype contains 'microsoft.desktopvirtualization/applicationgroups', 'WVD Application Groups',\r\ntype contains 'microsoft.desktopvirtualization/workspaces', 'WVD Workspaces',\r\ntype contains 'microsoft.desktopvirtualization/hostpools', 'WVD Hostpools',\r\ntype contains 'microsoft.recoveryservices/vaults', 'Backup Vaults',\r\ntype contains 'microsoft.web', 'App Services',\r\ntype contains 'microsoft.managedidentity/userassignedidentities','Managed Identities',\r\ntype contains 'microsoft.storagesync/storagesyncservices', 'Azure File Sync',\r\ntype contains 'microsoft.hybridcompute/machines', 'ARC Machines',\r\ntype contains 'Microsoft.EventHub', 'Event Hub',\r\ntype contains 'Microsoft.EventGrid', 'Event Grid',\r\ntype contains 'Microsoft.Sql', 'SQL Resources',\r\ntype contains 'Microsoft.HDInsight/clusters', 'HDInsight Clusters',\r\ntype contains 'microsoft.devtestlab', 'DevTest Labs Resources',\r\ntype contains 'microsoft.containerinstance', 'Container Instances Resources',\r\ntype contains 'microsoft.portal/dashboards', 'Azure Dashboards',\r\ntype contains 'microsoft.containerregistry/registries', 'Container Registry',\r\ntype contains 'microsoft.automation', 'Automation Resources',\r\ntype contains 'sendgrid.email/accounts', 'SendGrid Accounts',\r\ntype contains 'microsoft.datafactory/factories', 'Data Factory',\r\ntype contains 'microsoft.databricks/workspaces', 'Databricks Workspaces',\r\ntype contains 'microsoft.machinelearningservices/workspaces', 'Machine Learnings Workspaces',\r\ntype contains 'microsoft.alertsmanagement/smartdetectoralertrules', 'Azure Monitor Resources',\r\ntype contains 'microsoft.apimanagement/service', 'API Management Services',\r\ntype contains 'microsoft.dbforpostgresql', 'PostgreSQL Resources',\r\ntype contains 'microsoft.scheduler/jobcollections', 'Scheduler Job Collections',\r\ntype contains 'microsoft.visualstudio/account', 'Azure DevOps Organization',\r\ntype contains 'microsoft.network/', 'Network Resources',\r\ntype contains 'microsoft.migrate/' or type contains 'microsoft.offazure', 'Azure Migrate Resources',\r\ntype contains 'microsoft.servicebus/namespaces', 'Service Bus Namespaces',\r\ntype contains 'microsoft.classic', 'ASM Obsolete Resources',\r\ntype contains 'microsoft.resources/templatespecs', 'Template Spec Resources',\r\ntype contains 'microsoft.virtualmachineimages', 'VM Image Templates',\r\ntype contains 'microsoft.documentdb', 'CosmosDB DB Resources',\r\ntype contains 'microsoft.alertsmanagement/actionrules', 'Azure Monitor Resources',\r\ntype contains 'microsoft.kubernetes/connectedclusters', 'ARC Kubernetes Clusters',\r\ntype contains 'microsoft.purview', 'Purview Resources',\r\ntype contains 'microsoft.security', 'Security Resources',\r\ntype contains 'microsoft.cdn', 'CDN Resources',\r\ntype contains 'microsoft.devices','IoT Resources',\r\ntype contains 'microsoft.datamigration', 'Data Migraiton Services',\r\ntype contains 'microsoft.cognitiveservices', 'Congitive Services',\r\ntype contains 'microsoft.customproviders', 'Custom Providers',\r\ntype contains 'microsoft.appconfiguration', 'App Services',\r\ntype contains 'microsoft.search', 'Search Services',\r\ntype contains 'microsoft.maps', 'Maps',\r\ntype contains 'microsoft.containerservice/managedclusters', 'AKS',\r\ntype contains 'microsoft.signalrservice', 'SignalR',\r\ntype contains 'microsoft.resourcegraph/queries', 'Resource Graph Queries',\r\ntype contains 'microsoft.batch', 'MS Batch',\r\ntype contains 'microsoft.analysisservices', 'Analysis Services',\r\ntype contains 'microsoft.synapse/workspaces', 'Synapse Workspaces',\r\ntype contains 'microsoft.synapse/workspaces/sqlpools', 'Synapse SQL Pools',\r\ntype contains 'microsoft.kusto/clusters', 'ADX Clusters',\r\ntype contains 'microsoft.resources/deploymentscripts', 'Deployment Scripts',\r\ntype contains 'microsoft.aad/domainservices', 'AD Domain Services',\r\ntype contains 'microsoft.labservices/labaccounts', 'Lab Accounts',\r\ntype contains 'microsoft.automanage/accounts', 'Automanage Accounts',\r\ntype contains 'microsoft.relay/namespaces', 'Azure Relay',\r\ntype contains 'microsoft.notificationhubs/namespaces', 'Notification Hubs',\r\ntype contains 'microsoft.digitaltwins/digitaltwinsinstances', 'Digital Twins',\r\nstrcat(\"Not Translated: \", type))\r\n| summarize count() by type\r\n| order by count_ desc",
"size": 3,
"title": "Resource number by type (Top 10)",
"showExportToExcel": true,
"queryType": 1,
"resourceType": "microsoft.resourcegraph/resources",
"crossComponentResources": [ "{Subscription}" ],
"visualization": "tiles",
"tileSettings": {
"showBorder": false,
"titleContent": {
"columnMatch": "type",
"formatter": 1
},
"leftContent": {
"columnMatch": "count_",
"formatter": 12,
"formatOptions": {
"palette": "auto"
},
"numberFormat": {
"unit": 17,
"options": {
"maximumSignificantDigits": 3,
"maximumFractionDigits": 2
}
}
},
"rowLimit": 10
}
},
"name": "Resource number by type"
},
{
"type": 3,
"content": {
"version": "KqlItem/1.0",
"query": "resources\r\n| summarize count() by location",
"size": 3,
"title": "Resource number by location",
"queryType": 1,
"resourceType": "microsoft.resourcegraph/resources",
"crossComponentResources": [ "{Subscription}" ],
"visualization": "map",
"mapSettings": {
"locInfo": "AzureLoc",
"sizeSettings": "count_",
"sizeAggregation": "Sum",
"legendMetric": "count_",
"legendAggregation": "Sum",
"itemColorSettings": {
"type": "heatmap",
"colorAggregation": "Sum",
"nodeColorField": "count_",
"heatmapPalette": "greenRed"
},
"labelSettings": "location",
"locInfoColumn": "location"
}
},
"name": "Resource number by location"
}
]
},
"conditionalVisibility": {
"parameterName": "Subscription",
"comparison": "isNotEqualTo"
},
"name": "group - Overview metrics"
}
]
},
"conditionalVisibility": {
"parameterName": "SelectedTab",
"comparison": "isEqualTo",
"value": "RC_Overview"
},
"name": "RC_Overview"
},
{
"type": 12,
"content": {
"version": "NotebookGroup/1.0",
"groupType": "editable",
"items": [
{
"type": 1,
"content": {
"json": "## Things to know before creating a virtual machine\r\nThere's always a multitude of design considerations when you build out an application infrastructure in Azure. These aspects of a virtual machine are important to think about to manage virtual machine properly:\r\n- The names of your application resources\r\n- The location where the resources are stored\r\n- The size of the virtual machine\r\n- The maximum number of virtual machines that can be created\r\n- The operating system that the virtual machine runs\r\n- The configuration of the virtual machine after it starts\r\n- The related resources that the virtual machine needs\r\n"
},
"name": "text - 13"
},
{
"type": 12,
"content": {
"version": "NotebookGroup/1.0",
"groupType": "editable",
"items": [
{
"type": 3,
"content": {
"version": "KqlItem/1.0",
"query": "Resources | where type =~ 'Microsoft.Compute/virtualMachines'\n| summarize count() by tostring(properties.storageProfile.osDisk.osType)",
"size": 3,
"title": "Virtual machine count per OS type",
"showRefreshButton": true,
"queryType": 1,
"resourceType": "microsoft.resourcegraph/resources",
"crossComponentResources": [ "{Subscription}" ],
"visualization": "tiles",
"tileSettings": {
"showBorder": false,
"titleContent": {
"columnMatch": "properties_storageProfile_osDisk_osType",
"formatter": 1
},
"leftContent": {
"columnMatch": "count_",
"formatter": 12,
"formatOptions": {
"palette": "auto"
},
"numberFormat": {
"unit": 17,
"options": {
"maximumSignificantDigits": 3,
"maximumFractionDigits": 2
}
}
}
}
},
"name": "Virtual machine count per OS type"
},
{
"type": 3,
"content": {
"version": "KqlItem/1.0",
"query": "Resources\r\n| where type =~ 'Microsoft.Compute/virtualMachines'\r\n| project SKU = tostring(properties.hardwareProfile.vmSize)\r\n| summarize count() by SKU\r\n| order by count_ desc",
"size": 1,
"title": "VM by VM type/size",
"showRefreshButton": true,
"showExportToExcel": true,
"queryType": 1,
"resourceType": "microsoft.resourcegraph/resources",
"crossComponentResources": [ "{Subscription}" ],
"visualization": "barchart",
"tileSettings": {
"showBorder": false,
"titleContent": {
"columnMatch": "SKU",
"formatter": 1
},
"leftContent": {
"columnMatch": "count_",
"formatter": 12,
"formatOptions": {
"palette": "auto"
},
"numberFormat": {
"unit": 17,
"options": {
"maximumSignificantDigits": 3,
"maximumFractionDigits": 2
}
}
},
"rowLimit": 10
},
"graphSettings": {
"type": 0,
"topContent": {
"columnMatch": "SKU",
"formatter": 1
},
"centerContent": {
"columnMatch": "count_",
"formatter": 1,
"numberFormat": {
"unit": 17,
"options": {
"maximumSignificantDigits": 3,
"maximumFractionDigits": 2
}
}
}
}
},
"name": "VM by VM type/size"
},
{
"type": 3,
"content": {
"version": "KqlItem/1.0",
"query": "resources\r\n| where type=~ 'microsoft.compute/virtualmachinescalesets'\r\n| project subscriptionId, name, location, resourceGroup, Capacity = toint(sku.capacity), Tier = sku.name\r\n| order by Capacity desc",
"size": 0,
"title": "Virtual machine scale set capacity and size",
"noDataMessageStyle": 3,
"showRefreshButton": true,
"showExportToExcel": true,
"queryType": 1,
"resourceType": "microsoft.resourcegraph/resources",
"crossComponentResources": [ "{Subscription}" ]
},
"name": "query - virtual machine scale set capacity and size"
},
{
"type": 3,
"content": {
"version": "KqlItem/1.0",
"query": "Resources | where type == \"microsoft.compute/virtualmachines\"\r\n| extend osDiskId= tostring(properties.storageProfile.osDisk.managedDisk.id)\r\n | join kind=leftouter(resources\r\n | where type =~ 'microsoft.compute/disks'\r\n | where properties !has 'Unattached'\r\n | where properties has 'osType'\r\n | project OS = tostring(properties.osType), osSku = tostring(sku.name), osDiskSizeGB = toint(properties.diskSizeGB), osDiskId=tostring(id)) on osDiskId\r\n | join kind=leftouter(Resources\r\n | where type =~ 'microsoft.compute/disks'\r\n | where properties !has \"osType\"\r\n | where properties !has 'Unattached'\r\n | project sku = tostring(sku.name), diskSizeGB = toint(properties.diskSizeGB), id = managedBy\r\n | summarize sum(diskSizeGB), count(sku) by id, sku) on id\r\n| project vmId=id, subscriptionId, resourceGroup, OS, location, osDiskId, osSku, osDiskSizeGB, DataDisksGB=sum_diskSizeGB, diskSkuCount=count_sku\r\n| sort by diskSkuCount desc",
"size": 0,
"title": "Compute disks",
"showRefreshButton": true,
"showExportToExcel": true,
"queryType": 1,
"resourceType": "microsoft.resourcegraph/resources",
"crossComponentResources": [ "{Subscription}" ],
"visualization": "table",
"gridSettings": {
"formatters": [
{
"columnMatch": "subscriptionId",
"formatter": 15,
"formatOptions": {
"linkTarget": null,
"showIcon": true
}
},
{
"columnMatch": "location",
"formatter": 17
}
],
"filter": true,
"labelSettings": [
{
"columnId": "vmId",
"label": "Resource Name"
},
{
"columnId": "subscriptionId",
"label": "Subscription"
},
{
"columnId": "resourceGroup",
"label": "Resource Group"
},
{
"columnId": "location",
"label": "Region"
},
{
"columnId": "osDiskId",
"label": "OS Disk"
},
{
"columnId": "osSku",
"label": "OS Disk SKU"
},
{
"columnId": "osDiskSizeGB",
"label": "OS Disk Size"
}
]
}
},
"name": "Compute disks"
},
{
"type": 3,
"content": {
"version": "KqlItem/1.0",
"query": "Resources\r\n| where type =~ 'microsoft.compute/virtualmachines'\r\n| extend nics=array_length(properties.networkProfile.networkInterfaces)\r\n| mv-expand nic=properties.networkProfile.networkInterfaces\r\n| where nics == 1 or nic.properties.primary =~ 'true' or isempty(nic)\r\n| project vmId = id, vmName = name, vmSize=tostring(properties.hardwareProfile.vmSize), nicId = tostring(nic.id)\r\n\t| join kind=leftouter (\r\n \t\tResources\r\n \t\t| where type =~ 'microsoft.network/networkinterfaces'\r\n \t\t| extend ipConfigsCount=array_length(properties.ipConfigurations)\r\n \t\t| mv-expand ipconfig=properties.ipConfigurations\r\n \t\t| where ipConfigsCount == 1 or ipconfig.properties.primary =~ 'true'\r\n \t\t| project nicId = id, privateIP= tostring(ipconfig.properties.privateIPAddress), publicIpId = tostring(ipconfig.properties.publicIPAddress.id), subscriptionId) on nicId\r\n| project-away nicId1\r\n| summarize by vmId, subscriptionId, vmSize, nicId, privateIP, publicIpId\r\n\t| join kind=leftouter (\r\n \t\tResources\r\n \t\t| where type =~ 'microsoft.network/publicipaddresses'\r\n \t\t| project publicIpId = id, publicIpAddress = tostring(properties.ipAddress)) on publicIpId\r\n| project-away publicIpId1\r\n| sort by publicIpAddress desc",
"size": 0,
"title": "Compute networking",
"showRefreshButton": true,
"showExportToExcel": true,
"queryType": 1,
"resourceType": "microsoft.resourcegraph/resources",
"crossComponentResources": [ "{Subscription}" ],
"visualization": "table",
"gridSettings": {
"formatters": [
{
"columnMatch": "subscriptionId",
"formatter": 15,
"formatOptions": {
"linkTarget": null,
"showIcon": true
}
}
],
"filter": true,
"labelSettings": [
{
"columnId": "vmId",
"label": "Resource name"
},
{
"columnId": "subscriptionId",
"label": "Subscription"
},
{
"columnId": "vmSize",
"label": "VM size"
},
{
"columnId": "nicId",
"label": "Network interface"
},
{
"columnId": "privateIP",
"label": "Private IP"
},
{
"columnId": "publicIpId",
"label": "Public IP"
},
{
"columnId": "publicIpAddress",
"label": "Public IP address"
}
]
}
},
"name": "Compute networking"
},
{
"type": 1,
"content": {
"json": "# Managed disk utilization"
},
"name": "text - 16"
},
{
"type": 9,
"content": {
"version": "KqlParameterItem/1.0",
"crossComponentResources": [ "{Subscription}" ],
"parameters": [
{
"id": "ec135d58-9c6b-4998-bd1e-75871c540d7f",
"version": "KqlParameterItem/1.0",
"name": "laworkspace",
"label": "Log Analytics workspace",
"type": 5,
"description": "LA workspaces configured in virtual machines insight settings",
"isRequired": true,
"multiSelect": true,
"quote": "'",
"delimiter": ",",
"query": "where type =~ 'microsoft.operationalinsights/workspaces' | project id",
"crossComponentResources": [ "{Subscription}" ],
"typeSettings": {
"additionalResourceOptions": [ "value::all" ],
"showDefault": false
},
"timeContext": {
"durationMs": 86400000
},
"queryType": 1,
"resourceType": "microsoft.resourcegraph/resources",
"value": []
}
],
"style": "above",
"queryType": 1,
"resourceType": "microsoft.resourcegraph/resources"
},
"name": "Log Analytics workspace selector"
},
{
"type": 3,
"content": {
"version": "KqlItem/1.0",
"query": "InsightsMetrics\n| where Origin == \"vm.azm.ms\"\n| where Namespace == \"LogicalDisk\"\n| where Name == \"FreeSpacePercentage\"\n| extend t=parse_json(Tags)\n| summarize arg_max(TimeGenerated, *) by tostring(t[\"vm.azm.ms/mountId\"]), Computer // arg_max over TimeGenerated returns the latest record\n| project Computer, TimeGenerated, t[\"vm.azm.ms/mountId\"], Val\n",
"size": 4,
"title": "Managed disks free space",
"timeContext": {
"durationMs": 604800000
},
"queryType": 0,
"resourceType": "microsoft.operationalinsights/workspaces",
"crossComponentResources": [ "{laworkspace}" ],
"visualization": "table",
"gridSettings": {
"formatters": [
{
"columnMatch": "Val",
"formatter": 18,
"formatOptions": {
"thresholdsOptions": "icons",
"thresholdsGrid": [
{
"operator": ">=",
"thresholdValue": "90",
"representation": "4",
"text": "{0}{1}"
},
{
"operator": ">=",
"thresholdValue": "50",
"representation": "2",
"text": "{0}{1}"
},
{
"operator": "Default",
"thresholdValue": null,
"representation": "success",
"text": "{0}{1}"
}
]
},
"numberFormat": {
"unit": 1,
"options": {
"style": "decimal",
"useGrouping": false,
"maximumFractionDigits": 0
}
}
}
],
"labelSettings": [
{
"columnId": "Computer",
"label": "Computer"
},
{
"columnId": "TimeGenerated",
"label": "TimeGenerated"
},
{
"columnId": "t_vm.azm.ms/mountId",
"label": "Drive"
},
{
"columnId": "Val",
"label": "Free space percentage"
}
]
}
},
"conditionalVisibility": {
"parameterName": "laworkspace",
"comparison": "isNotEqualTo"
},
"name": "Managed disks free space"
},
{
"type": 1,
"content": {
"json": "# Compute optimization"
},
"name": "text - 9"
},
{
"type": 3,
"content": {
"version": "KqlItem/1.0",
"query": "advisorresources\r\n| where type == \"microsoft.advisor/recommendations\"\r\n| where tostring (properties.category) has \"Cost\"\r\n| where properties.shortDescription.problem has \"underutilized\"\r\n| where properties.impactedField has \"Compute\" or properties.impactedField has \"Container\" or properties.impactedField has \"Web\"\r\n| project AffectedResource=tostring(properties.resourceMetadata.resourceId),Impact=properties.impact,resourceGroup,AdditionaInfo=properties.extendedProperties,subscriptionId,Recommendation=tostring(properties.shortDescription.problem)\r\n",
"size": 0,
"title": "Underused assets",
"noDataMessage": "No underused asset",
"noDataMessageStyle": 3,
"showRefreshButton": true,
"showExportToExcel": true,
"queryType": 1,
"resourceType": "microsoft.resourcegraph/resources",
"crossComponentResources": [ "{Subscription}" ]
},
"customWidth": "100",
"name": "Underused assets"
},
{
"type": 9,
"content": {
"version": "KqlParameterItem/1.0",
"parameters": [
{
"id": "37cdc20d-07c3-466c-84bb-4d8050932641",
"version": "KqlParameterItem/1.0",
"name": "OrphanDisks",
"label": "Orphaned",
"type": 10,
"isRequired": true,
"typeSettings": {
"additionalResourceOptions": [],
"showDefault": false
},
"jsonData": "[\r\n { \"value\":\"!=\", \"label\":\"No\" },\r\n { \"value\":\"==\", \"label\":\"Yes\" }\r\n]",
"timeContext": {
"durationMs": 86400000
},
"value": "!="
}
],
"style": "above",
"queryType": 0,
"resourceType": "microsoft.operationalinsights/workspaces"
},
"name": "Disks"
},
{
"type": 3,
"content": {
"version": "KqlItem/1.0",
"query": "Resources \r\n| where type contains \"microsoft.compute/disks\" \r\n| extend diskState = tostring(properties.diskState)\r\n| where managedBy {OrphanDisks} \"\" or diskState {OrphanDisks} 'Unattached'\r\n| project id, subscriptionId, resourceGroup, diskState, location",
"size": 0,
"title": "Managed disks",
"noDataMessageStyle": 3,
"showRefreshButton": true,
"showExportToExcel": true,
"queryType": 1,
"resourceType": "microsoft.resourcegraph/resources",
"crossComponentResources": [ "{Subscription}" ],
"gridSettings": {
"formatters": [
{
"columnMatch": "subscriptionId",
"formatter": 15,
"formatOptions": {
"linkTarget": null,
"showIcon": true
}
},
{
"columnMatch": "location",
"formatter": 17
}
],
"labelSettings": [
{
"columnId": "id",
"label": "Resource Name"
},
{
"columnId": "subscriptionId",
"label": "Subscription"
},
{
"columnId": "resourceGroup",
"label": "Resource group"
},
{
"columnId": "diskState",
"label": "Disk state"
},
{
"columnId": "location",
"label": "Region"
}
]
}
},
"name": "Managed disks"
},
{
"type": 9,
"content": {
"version": "KqlParameterItem/1.0",
"parameters": [
{
"id": "2d9b8893-0af4-480a-9ac7-639efb771ecb",
"version": "KqlParameterItem/1.0",
"name": "OrphanNIC",
"label": "Orphaned",
"type": 10,
"isRequired": true,
"typeSettings": {
"additionalResourceOptions": [],
"showDefault": false
},
"jsonData": "[\r\n { \"value\":\"has 'virtualmachine' or isnotnull(privateEndPoint)\", \"label\":\"No\" },\r\n { \"value\":\"!has 'virtualmachine' and isnull(privateEndPoint)\", \"label\":\"Yes\" }\r\n]",
"timeContext": {
"durationMs": 86400000
},
"value": "has 'virtualmachine' or isnotnull(privateEndPoint)"
}
],
"style": "above",
"queryType": 0,
"resourceType": "microsoft.operationalinsights/workspaces"
},
"name": "NICs - Copy"
},
{
"type": 3,
"content": {
"version": "KqlItem/1.0",
"query": "Resources\r\n| where type has \"microsoft.network/networkinterfaces\"\r\n| extend VM = properties.virtualMachine.id\r\n| extend privateEndPoint = properties['privateEndpoint']['id']\r\n| where properties {OrphanNIC}\r\n| where properties['linkedResourceType'] != \"Microsoft.Netapp/volumes\"\r\n| project id, subscriptionId, resourceGroup, location, VM, privateEndPoint, properties\r\n",
"size": 0,
"title": "NICs",
"noDataMessageStyle": 3,
"showRefreshButton": true,
"showExportToExcel": true,
"queryType": 1,
"resourceType": "microsoft.resourcegraph/resources",
"crossComponentResources": [ "{Subscription}" ],
"gridSettings": {
"formatters": [