-
Notifications
You must be signed in to change notification settings - Fork 24
/
workbook.json
5218 lines (5218 loc) · 274 KB
/
workbook.json
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": 1,
"content": {
"json": "# FinOps Insights - Workbook"
},
"name": "overview"
},
{
"type": 9,
"content": {
"version": "KqlParameterItem/1.0",
"crossComponentResources": [
"{Subscription}"
],
"parameters": [
{
"id": "51aa3a9b-14e0-4c22-a60d-abdbf8813f00",
"version": "KqlParameterItem/1.0",
"name": "Subscription",
"type": 6,
"isRequired": true,
"multiSelect": true,
"quote": "'",
"delimiter": ",",
"typeSettings": {
"additionalResourceOptions": [
"value::all"
],
"includeAll": true,
"showDefault": false
},
"timeContext": {
"durationMs": 86400000
},
"defaultValue": "value::all"
},
{
"id": "671d9428-695b-4ff3-bc5c-5a951cd14b06",
"version": "KqlParameterItem/1.0",
"name": "TimeRange",
"type": 4,
"typeSettings": {
"selectableValues": [
{
"durationMs": 3600000
},
{
"durationMs": 14400000
},
{
"durationMs": 43200000
},
{
"durationMs": 86400000
},
{
"durationMs": 172800000
},
{
"durationMs": 259200000
},
{
"durationMs": 604800000
},
{
"durationMs": 1209600000
},
{
"durationMs": 2419200000
},
{
"durationMs": 2592000000
},
{
"durationMs": 5184000000
},
{
"durationMs": 7776000000
}
]
},
"value": {
"durationMs": 172800000
}
},
{
"id": "adfb0a0a-b593-4dbd-8591-985d06b2c669",
"version": "KqlParameterItem/1.0",
"name": "StorageAccounts",
"type": 5,
"multiSelect": true,
"quote": "'",
"delimiter": ",",
"query": "where type =~ 'microsoft.storage/storageaccounts'\r\n| order by name asc\r\n| extend Rank = row_number()\r\n| project value = id, label = id, selected = Rank <= 5",
"crossComponentResources": [
"{Subscription}"
],
"isHiddenWhenLocked": true,
"typeSettings": {
"additionalResourceOptions": [
"value::all"
],
"showDefault": false
},
"queryType": 1,
"resourceType": "microsoft.resourcegraph/resources",
"value": [
"value::all"
]
},
{
"id": "acfb0b0b-5af5-4c24-94a9-352aa1360151",
"version": "KqlParameterItem/1.0",
"name": "LogAnalyticsWorkspace",
"type": 5,
"multiSelect": true,
"quote": "'",
"delimiter": ",",
"query": "resources\r\n| where type == \"microsoft.operationalinsights/workspaces\"\r\n| project id, name",
"crossComponentResources": [
"{Subscription}"
],
"isHiddenWhenLocked": true,
"typeSettings": {
"additionalResourceOptions": [
"value::all"
],
"showDefault": false
},
"queryType": 1,
"resourceType": "microsoft.resourcegraph/resources",
"value": [
"value::all"
]
},
{
"id": "e2cecc14-1c84-4871-8b40-0fe735a19175",
"version": "KqlParameterItem/1.0",
"name": "VPNGateways",
"type": 5,
"multiSelect": true,
"quote": "'",
"delimiter": ",",
"query": "Resources \r\n| where type =~ \"microsoft.network/virtualnetworkgateways\" and properties.gatewayType == \"Vpn\"\r\n| project id",
"crossComponentResources": [
"{Subscription}"
],
"isHiddenWhenLocked": true,
"typeSettings": {
"additionalResourceOptions": [
"value::all"
],
"showDefault": false
},
"queryType": 1,
"resourceType": "microsoft.resourcegraph/resources",
"value": [
"value::all"
]
},
{
"id": "8284245f-5752-4258-ab07-aa48747a43da",
"version": "KqlParameterItem/1.0",
"name": "Firewalls",
"type": 5,
"multiSelect": true,
"quote": "'",
"delimiter": ",",
"query": "resources\r\n| where type == \"microsoft.network/azurefirewalls\"\r\n| project id",
"crossComponentResources": [
"{Subscription}"
],
"isHiddenWhenLocked": true,
"typeSettings": {
"additionalResourceOptions": [
"value::all"
],
"showDefault": false
},
"queryType": 1,
"resourceType": "microsoft.resourcegraph/resources",
"value": [
"value::all"
]
}
],
"style": "pills",
"queryType": 1,
"resourceType": "microsoft.resourcegraph/resources"
},
"conditionalVisibility": {
"parameterName": "SelectedTab",
"comparison": "isNotEqualTo",
"value": "CostInformation"
},
"name": "parameters - 0"
},
{
"type": 11,
"content": {
"version": "LinkItem/1.0",
"style": "tabs",
"links": [
{
"id": "0d7b7a29-9226-4420-a05f-783c27342e8e",
"cellValue": "mainTab",
"linkTarget": "parameter",
"linkLabel": "Overview",
"subTarget": "overview",
"style": "link"
},
{
"id": "1f70f0f3-465a-4736-8d2f-a323fe764bdf",
"cellValue": "mainTab",
"linkTarget": "parameter",
"linkLabel": "Governance",
"subTarget": "governance",
"style": "link"
},
{
"id": "c69456aa-4261-4c08-a7ef-be1db076b9f5",
"cellValue": "mainTab",
"linkTarget": "parameter",
"linkLabel": "Visualization",
"subTarget": "visualization",
"style": "link"
},
{
"id": "e23aecd2-e6be-4e2e-9339-baad8e6f0440",
"cellValue": "mainTab",
"linkTarget": "parameter",
"linkLabel": "Cost Optimization",
"subTarget": "costOpt",
"style": "link"
},
{
"id": "cdefeb77-cd99-4ff3-8591-403e6b6e31c4",
"cellValue": "mainTab",
"linkTarget": "parameter",
"linkLabel": "Practical Examples",
"subTarget": "practicalExamples",
"style": "link"
}
]
},
"name": "links - 8"
},
{
"type": 12,
"content": {
"version": "NotebookGroup/1.0",
"groupType": "editable",
"items": [
{
"type": 1,
"content": {
"json": "# Visualization\r\n\r\nTo ensure that a FinOps initiative is successful, the costs need to be visualized, tracked and understood. It's also imperitive to monitor the effectiveness of any Governance and FinOps automation. \r\n\r\n### Tools\r\n\r\nAzure Costs can be visualized by different tools. Each tool has it's own pros and cons. The below table provides generalised guidance for each tool. \r\n\r\n| Tool | Overview | Pros | Cons |\r\n| -- | -- | -- | -- |\r\n| Cost Management & Billing Service | This is the built in Azure billing tool and is available out of the box for free, for all Azure accounts. <br> <br> [Cost Management Tutorial](https://learn.microsoft.com/en-us/azure/cost-management-billing/costs/quick-acm-cost-analysis) | - Free <br> - Pre-configured and ready to use <br> - Can deep dive into Azure Costs | - Requires Azure RBAC access <br> - Requires the user to use the Azure Portal (may not be ideal for management) <br> - No out-of the box emailed report |\r\n| PowerBI | Power BI is a collection of software services, apps, and connectors that work together to turn your unrelated sources of data into coherent, visually immersive, and interactive insights. Your data may be an Excel spreadsheet, or a collection of cloud-based and on-premises hybrid data warehouses. Power BI lets you easily connect to your data sources, visualize and discover what's important, and share that with anyone or everyone you want. <br> <br> [What Is PowerBI](https://learn.microsoft.com/en-us/power-bi/fundamentals/power-bi-overview) <br> [How to connect PowerBI to Azure Cost Management](https://learn.microsoft.com/en-us/power-bi/connect-data/desktop-connect-azure-cost-management) | - Curated views of data <br> - Scheduled Publishing of reports <br> - Shared organization view <br> - Can combine data from multi data sources <br> - Great for executives & non-technical people | - Requires additional licenses <br> - Requires setup to work <br> - Requires PowerBI skills to customise |\r\n| Azure Policy | Azure Policy is an Azure service that helps to enforce organizational standards and to assess compliance at-scale. <br> <br> [What is Azure Policy](https://learn.microsoft.com/en-us/azure/governance/policy/overview) | - Can audit and enforce FinOps standards <br> - Can automatically remediate Azure resources <br> | - Requires additional setup <br> - Requires hands on technical skills |\r\n\r\n<br>\r\n"
},
"name": "text - 0"
},
{
"type": 1,
"content": {
"json": "## Tips\r\n\r\nWhen starting the FinOps journey, it's recommended to understand the current Cloud costs. This can be done by using the Cost Management & Billing service in Azure. \r\n\r\n1. Ensure costs can be tied to a tracked to a business entity`(department | team | business unit | Project)`. \r\n - This is usually done by using `Tags` or `Boundaries (Subscriptions | resource groups)`. \r\n2. Look at the costs by Azure Services (review the top `5 most expensive services`).\r\n3. Assess the costs by Azure Resources (What are the `10 most expensive services`).\r\n4. Send out a monthly report to key stakeholders to ensure the costs are understood. \r\n - Offer time to run the teams through the report so they can understand their costs and any opportunities to optimize their spend. \r\n5. Visualize Reservations, Savings Plans, Budgets and costs. \r\n6. Track budget alert frequency and if the alerts are being actioned. \r\n7. Identify if a charge back model will be implemented. \r\n\r\n"
},
"name": "text - 1",
"styleSettings": {
"padding": "10px",
"showBorder": true
}
}
]
},
"conditionalVisibility": {
"parameterName": "mainTab",
"comparison": "isEqualTo",
"value": "visualization"
},
"name": "visualizationGroup"
},
{
"type": 12,
"content": {
"version": "NotebookGroup/1.0",
"groupType": "editable",
"items": [
{
"type": 11,
"content": {
"version": "LinkItem/1.0",
"style": "tabs",
"links": [
{
"id": "ba6b341a-b02c-4db6-9bd8-b8fd2fa40ccb",
"cellValue": "govTab",
"linkTarget": "parameter",
"linkLabel": "Tagging",
"subTarget": "tagging",
"style": "link"
},
{
"id": "16528230-6640-4cc0-a778-4f3552ca21c1",
"cellValue": "govTab",
"linkTarget": "parameter",
"linkLabel": "Azure Advisor",
"subTarget": "advisor",
"preText": "Azure Advisor",
"style": "link"
},
{
"id": "38c6d187-77fe-402b-b8dd-fcd38fe69136",
"cellValue": "govTab",
"linkTarget": "parameter",
"linkLabel": "Hybrid Licensing",
"subTarget": "hybrid",
"style": "link"
},
{
"id": "f5d1f60b-2277-4eeb-81ab-2f9665574cfb",
"cellValue": "govTab",
"linkTarget": "parameter",
"linkLabel": "Budgets",
"subTarget": "budgets",
"style": "link"
}
]
},
"name": "links - 3"
},
{
"type": 12,
"content": {
"version": "NotebookGroup/1.0",
"groupType": "editable",
"items": [
{
"type": 1,
"content": {
"json": "![budgets-icon](https://finopsworkbookcontent.blob.core.windows.net/finops-workbook/Cost-Budgets-small.png)\r\n\r\n# Budgets\r\n\r\nAzure Budgets provide the ability to proactively manage Cloud costs. Budgets can be used to `forecast` spend and to remediate any unexpected costs, before the bill comes through. \r\n\r\nBudgets can be created automatically through [Infrastructure As Code (IaC)](https://learn.microsoft.com/en-us/azure/templates/microsoft.costmanagement/budgets?pivots=deployment-language-bicep) or using an [Azure Runbook (example)](https://nbnm.medium.com/automate-creating-budgets-for-resource-groups-in-azure-81dd9d59cce7) to apply default Budgets based on resource tags. \r\n\r\nBudgets need to be assessed on a cadence and potentially modified as usage grows.\r\n\r\n\r\n> **[Budget Tutorial](https://learn.microsoft.com/en-us/azure/cost-management-billing/costs/tutorial-acm-create-budgets)**\r\n<br>\r\n\r\n> **This Workbook is unable to show Budgets, so navigate to the [Budget](https://ms.portal.azure.com/#view/Microsoft_Azure_CostManagement/Menu/~/budgets/open/budgets/openedBy/AzurePortal) view in Azure. **\r\n\r\n<br>\r\n## Budget Example\r\n\r\n"
},
"name": "text - 0"
},
{
"type": 1,
"content": {
"json": "![budgetExample](https://finopsworkbookcontent.blob.core.windows.net/finops-workbook/budget-set-alert-example-60.png)"
},
"name": "text - 1",
"styleSettings": {
"showBorder": true
}
}
]
},
"conditionalVisibility": {
"parameterName": "govTab",
"comparison": "isEqualTo",
"value": "budgets"
},
"name": "budgetGroup"
},
{
"type": 12,
"content": {
"version": "NotebookGroup/1.0",
"groupType": "editable",
"items": [
{
"type": 1,
"content": {
"json": "# Hybrid Licensing\r\n\r\nFor customers with Software Assurance, Azure Hybrid Benefit allows you to apply your on-premises licenses for resources running in on Azure. \r\n\r\nThis benefit is applicable for Microsoft SQL servers (VMs, Managed and Server) aswell as Windows and Rhel Virtual Machines. \r\n\r\n\r\n> **[Azure Hybrid Benefit for Windows Server licensing page](https://azure.microsoft.com/pricing/hybrid-use-benefit/)** <br>\r\n> **[Azure Hybrid Benefit for SQL](https://learn.microsoft.com/en-us/azure/azure-sql/azure-hybrid-benefit?view=azuresql&tabs=azure-portal)** <br>\r\n> **[Azure Hybrid Benefit Savings Calculation](https://azure.microsoft.com/en-gb/pricing/hybrid-benefit/#calculator)** <br> \r\n> **[Centrally Manage Hybrid Benefits in Azure](https://learn.microsoft.com/en-gb/azure/cost-management-billing/scope-level/)**<br> <br>\r\n> **Important: Always check and ensure you have available licenses before turning Hybrid Benefits on.**\r\n"
},
"name": "text - 5"
},
{
"type": 12,
"content": {
"version": "NotebookGroup/1.0",
"groupType": "editable",
"title": "Virtual Machines",
"expandable": true,
"items": [
{
"type": 3,
"content": {
"version": "KqlItem/1.0",
"query": "resources \r\n| where type =~ 'microsoft.compute/virtualmachines' and (properties.storageProfile.imageReference.publisher == 'suse' or properties.storageProfile.imageReference.publisher=='RedHat')\r\n| where tostring(properties.['licenseType']) != 'SLES_BYOS' and tostring(properties.['licenseType']) != 'RHEL_BYOS' \r\n| extend WindowsId=id, VMName=name, VMLocation=location, VMRG=resourceGroup, OSType=tostring(properties.storageProfile.imageReference.offer), OsVersion = tostring(properties.storageProfile.imageReference.sku), VMSize=tostring (properties.hardwareProfile.vmSize), LicenseType = tostring(properties.['licenseType']) \r\n | order by VMSize asc \r\n | project WindowsId,VMName,VMRG, VMLocation,OSType, OsVersion,LicenseType, VMSize",
"size": 1,
"title": "Linux VMs without Azure Hybrid Benefit enabled",
"noDataMessage": "All applicable Linux VMs have the Azure Hybrid Benefit enabled",
"noDataMessageStyle": 3,
"showExportToExcel": true,
"queryType": 1,
"resourceType": "microsoft.resourcegraph/resources",
"crossComponentResources": [
"{Subscription}"
]
},
"name": "query - 2"
},
{
"type": 3,
"content": {
"version": "KqlItem/1.0",
"query": "resources \r\n| where type =~ 'microsoft.compute/virtualmachines' or type =~ 'microsoft.compute/virtualMachineScaleSets'\r\n| where tostring(properties.storageProfile.osDisk.osType) == 'Windows' or tostring(properties.virtualMachineProfile.storageProfile.osDisk.osType) == 'Windows'\r\n| where tostring(properties.['licenseType']) !has 'Windows' and tostring(properties.virtualMachineProfile.['licenseType']) !has 'Windows'\r\n| extend WindowsId=id, VMName=name, VMLocation=location, VMRG=resourceGroup, OSType=tostring(properties.storageProfile.imageReference.offer), OsVersion = tostring(properties.storageProfile.imageReference.sku), VMSize=tostring (properties.hardwareProfile.vmSize), LicenseType = tostring(properties.['licenseType'])\r\n| order by type asc \r\n| project WindowsId,VMName,VMRG,VMSize, VMLocation,OSType, OsVersion,LicenseType",
"size": 1,
"title": "Windows VMs and VM scale sets without Azure Hybrid Benefit enabled",
"noDataMessage": "All Windows VMs and VM scale sets have the Azure Hybrid Benefit enabled",
"noDataMessageStyle": 3,
"showExportToExcel": true,
"queryType": 1,
"resourceType": "microsoft.resourcegraph/resources",
"crossComponentResources": [
"{Subscription}"
],
"gridSettings": {
"rowLimit": 1000
}
},
"name": "query - 1"
}
]
},
"name": "vm",
"styleSettings": {
"showBorder": true
}
},
{
"type": 12,
"content": {
"version": "NotebookGroup/1.0",
"groupType": "editable",
"title": "Microsoft SQL Servers",
"expandable": true,
"items": [
{
"type": 3,
"content": {
"version": "KqlItem/1.0",
"query": "ResourceContainers\r\n| where type =~ 'Microsoft.Resources/subscriptions' \r\n| extend SubscriptionName=name | join (resources | where type =~ 'Microsoft.Sql/servers/databases' and name != 'master' and tostring(properties.['licenseType']) == 'LicenseIncluded' \r\n| extend SQLDBID=id,SQLName = name, SQLRG = resourceGroup, SKUName=sku.name, SKUTier=sku.tier, SQLLocation = location, LicenseType = tostring(properties.['licenseType']), StorageAccountType=tostring(properties.['storageAccountType'])) on subscriptionId \r\n| project SQLDBID,SQLName,SQLRG, SKUName, SKUTier, SQLLocation, LicenseType, StorageAccountType, SubscriptionName",
"size": 1,
"title": "Azure SQL Databases not using Hybrid Benefit",
"noDataMessage": "The query returned no results. There 2 reasons for that 1) All of your SQL Databases are using Hybrid benefit or 2) There are no SQL Databases deployed in this scope.",
"noDataMessageStyle": 3,
"showExportToExcel": true,
"queryType": 1,
"resourceType": "microsoft.resourcegraph/resources",
"crossComponentResources": [
"{Subscription}"
]
},
"name": "query - 1"
},
{
"type": 3,
"content": {
"version": "KqlItem/1.0",
"query": "ResourceContainers\r\n | where type =~ 'Microsoft.Resources/subscriptions' \r\n | extend SubscriptionName=name \r\n | join (resources | where type =~ 'Microsoft.Sql/managedInstances' and tostring(properties.['licenseType']) == 'LicenseIncluded'\r\n | extend ManagedInstance=id, SQLRG=resourceGroup, SQLLocation=location, LicenseType = tostring(properties.['licenseType'])) on subscriptionId \r\n | project ManagedInstance,SQLRG, SQLLocation, LicenseType, SubscriptionName",
"size": 1,
"title": "Azure SQL Managed Instances not using Hybrid Benefit",
"noDataMessage": "The query returned no results. There 2 reasons for that 1) All of your SQL Managed Instances are using Hybrid benefit or 2) There are no SQL Managed Instances deployed in this scope.",
"noDataMessageStyle": 3,
"showExportToExcel": true,
"queryType": 1,
"resourceType": "microsoft.resourcegraph/resources",
"crossComponentResources": [
"{Subscription}"
]
},
"name": "query - 2"
},
{
"type": 3,
"content": {
"version": "KqlItem/1.0",
"query": "ResourceContainers | where type =~ 'Microsoft.Resources/subscriptions' | extend SubscriptionName=name | join ( resources | where type =~ 'Microsoft.SqlVirtualMachine/SqlVirtualMachines' and tostring(properties.['sqlServerLicenseType']) != 'AHUB' | extend SQLID=id, VMName = name, VMRG = resourceGroup, VMLocation = location, LicenseType = tostring(properties.['sqlServerLicenseType']), OSType=tostring(properties.storageProfile.imageReference.offer), SQLAgentType = tostring(properties.['sqlManagement']), SQLVersion = tostring(properties.['sqlImageOffer']), SQLSKU=tostring(properties.['sqlImageSku'])) on subscriptionId \r\n | order by id asc \r\n | project SQLID,VMName,VMRG, VMLocation, SQLVersion, SQLSKU, SQLAgentType, LicenseType, SubscriptionName\r\n | where SQLSKU != \"Developer\" and SQLSKU != \"Express\"",
"size": 1,
"title": "SQL Virtual Machines not using Hybrid Benefit",
"noDataMessage": "The query returned no results. There 2 reasons for that 1) All of your SQL Virtual Machines are using Hybrid benefit (For SQL) or 2) There are no SQL Virtual Machines deployed in this scope.",
"noDataMessageStyle": 3,
"showExportToExcel": true,
"queryType": 1,
"resourceType": "microsoft.resourcegraph/resources",
"crossComponentResources": [
"{Subscription}"
]
},
"name": "query - 3"
}
]
},
"name": "sql",
"styleSettings": {
"showBorder": true
}
}
]
},
"conditionalVisibility": {
"parameterName": "govTab",
"comparison": "isEqualTo",
"value": "hybrid"
},
"name": "costHybridGroup"
},
{
"type": 12,
"content": {
"version": "NotebookGroup/1.0",
"groupType": "editable",
"items": [
{
"type": 1,
"content": {
"json": "![tag-icon](https://finopsworkbookcontent.blob.core.windows.net/finops-workbook/Tags-small.png)\r\n# Tagging\r\n\r\nResources and Resource Containers (subscriptions, ResourceGroups and Management Groups) can be tagged. Tags are metadata that provide additional information about resources running in the Cloud. When tracking costs in the Cloud, resource tags are crucial as you can add a tag for `Contact/Department/CostCentercost`. \r\n\r\nTagging data will flow through to the billing information and can be visualized in PowerBI or the Cost Management service. This allows for a clear breakdown of cost of resources running in the Cloud. \r\n\r\n## Examples\r\n\r\nYour organization should have a defined tagging standard and an understanding of how each tag (and value) will be used / why it's relevant. Be aware that some services in Azure have a `15 tag limit`. \r\n\r\n- **CostCenter:** How can I find the cost center ID internally? \r\n- **Contacts:** Technical and Business contact for the owner of the workload. \r\n\r\n### Usage Examples\r\n\r\n- **Good Example**: Use the `vendorContact` tag if a vendor manages or supports a workload, consider adding a tag \r\n- **Bad Example**: A tag `applicationLayer` provides no real context or value to the solution. \r\n\r\n## Audit\r\n\r\n- This page reviews the tagging keys used and identifies any untagged (resources/resource groups / subscriptions). \r\n- Unique keys help to visualize any tagging governance used. It's also important to ensure that the values are consistent (e.g. `environment: dev` and `environment: Development`)\r\n\r\n> **[For help and guidance on tagging](https://learn.microsoft.com/en-us/azure/cloud-adoption-framework/ready/azure-best-practices/resource-naming)** \r\n<br>\r\n> **[Guidance to reconcile tagging](https://techcommunity.microsoft.com/t5/core-infrastructure-and-security/reconcile-tag-names-across-azure/ba-p/3453172)**\r\n<br>\r\n> **[Tag Resources with their Creators name](https://techcommunity.microsoft.com/t5/core-infrastructure-and-security/tagging-azure-resources-with-a-creator/ba-p/1479819)**"
},
"name": "text - 2"
},
{
"type": 12,
"content": {
"version": "NotebookGroup/1.0",
"groupType": "editable",
"title": "Tag Usage Overview",
"items": [
{
"type": 3,
"content": {
"version": "KqlItem/1.0",
"query": "ResourceContainers\r\n| where type =~ 'microsoft.resources/subscriptions/resourcegroups'\r\n| extend TagBool = iff(tags != '' and tags != '[]', \"Tagged\",\"Untagged\")\r\n| summarize count() by TagBool\r\n//| project resourceGroup, tags\r\n",
"size": 1,
"title": "Tagged Resource Groups",
"exportFieldName": "resourceGroupTag",
"exportParameterName": "resourceGroupTag",
"showExportToExcel": true,
"queryType": 1,
"resourceType": "microsoft.resourcegraph/resources",
"crossComponentResources": [
"{Subscription}"
],
"visualization": "piechart"
},
"customWidth": "50",
"name": "query - 3"
},
{
"type": 3,
"content": {
"version": "KqlItem/1.0",
"query": "Resources | extend TagBool = iff(tags != '' and tags != '[]', \"Tagged\",\"Untagged\") | summarize count() by TagBool\r\n\r\n",
"size": 1,
"title": "Untagged Resource Count",
"showExportToExcel": true,
"queryType": 1,
"resourceType": "microsoft.operationalinsights/workspaces",
"crossComponentResources": [
"{Subscription}"
],
"visualization": "piechart"
},
"customWidth": "50",
"name": "query - 7"
}
]
},
"name": "overview",
"styleSettings": {
"showBorder": true
}
},
{
"type": 12,
"content": {
"version": "NotebookGroup/1.0",
"groupType": "editable",
"title": "Resources",
"items": [
{
"type": 3,
"content": {
"version": "KqlItem/1.0",
"query": "resources \r\n| mvexpand tags\r\n| where tags == '' or isempty(tags)\r\n| project Name=id, subscriptionId\r\n| summarize count()\r\n\r\n",
"size": 4,
"title": "Untagged Resources",
"noDataMessage": "No Untagged Resources found",
"noDataMessageStyle": 3,
"queryType": 1,
"resourceType": "microsoft.resourcegraph/resources",
"crossComponentResources": [
"{Subscription}"
],
"visualization": "tiles",
"gridSettings": {
"rowLimit": 1000
},
"tileSettings": {
"titleContent": {},
"leftContent": {
"columnMatch": "count_",
"formatter": 12,
"formatOptions": {
"max": 200,
"palette": "red"
}
},
"showBorder": false
}
},
"customWidth": "20",
"name": "query - 10"
},
{
"type": 3,
"content": {
"version": "KqlItem/1.0",
"query": "resources \r\n| mvexpand tags\r\n| where tags != '' or isnotempty(tags)\r\n| extend tagKey = tostring(bag_keys(tags)[0])\r\n| extend tagValue = tostring(tags[tagKey])\r\n| project tagKey, tagValue\r\n| distinct tagKey\r\n| summarize count()\r\n\r\n",
"size": 4,
"title": "Unique Resource Tag Keys",
"noDataMessage": "No Untagged Resources found",
"noDataMessageStyle": 3,
"queryType": 1,
"resourceType": "microsoft.resourcegraph/resources",
"crossComponentResources": [
"{Subscription}"
],
"visualization": "tiles",
"gridSettings": {
"rowLimit": 5000
},
"tileSettings": {
"titleContent": {},
"leftContent": {
"columnMatch": "count_",
"formatter": 12,
"formatOptions": {
"max": 200,
"palette": "blue"
}
},
"showBorder": false
}
},
"customWidth": "20",
"name": "query - 10 - Copy"
},
{
"type": 3,
"content": {
"version": "KqlItem/1.0",
"query": "resources \r\n| mvexpand tags\r\n| where tags != '' or isnotempty(tags)\r\n| extend tagKey = tostring(bag_keys(tags)[0])\r\n| extend tagValue = tostring(tags[tagKey])\r\n| project tagKey, tagValue\r\n| distinct tagKey, tagValue\r\n\r\n",
"size": 0,
"showAnalytics": true,
"title": "Unique Resource Tags",
"noDataMessage": "No Untagged Resources found",
"noDataMessageStyle": 3,
"showExportToExcel": true,
"queryType": 1,
"resourceType": "microsoft.resourcegraph/resources",
"crossComponentResources": [
"{Subscription}"
],
"visualization": "table",
"gridSettings": {
"rowLimit": 5000
},
"tileSettings": {
"titleContent": {},
"leftContent": {
"columnMatch": "count_",
"formatter": 12,
"formatOptions": {
"max": 200,
"palette": "blue"
}
},
"showBorder": false
}
},
"customWidth": "50",
"name": "query - 10 - Copy - Copy"
},
{
"type": 12,
"content": {
"version": "NotebookGroup/1.0",
"groupType": "editable",
"title": "Untagged Resources List",
"expandable": true,
"items": [
{
"type": 3,
"content": {
"version": "KqlItem/1.0",
"query": "resources \r\n| mvexpand tags\r\n| where tags == '' or isempty(tags)\r\n| extend tagKey = tostring(bag_keys(tags)[0])\r\n| extend tagValue = tostring(tags[tagKey])\r\n| project name, type, resourceGroup\r\n\r\n",
"size": 0,
"showAnalytics": true,
"title": "Untagged Resources",
"noDataMessage": "No Untagged Resources found",
"noDataMessageStyle": 3,
"showExportToExcel": true,
"queryType": 1,
"resourceType": "microsoft.resourcegraph/resources",
"crossComponentResources": [
"{Subscription}"
],
"visualization": "table",
"gridSettings": {
"rowLimit": 5000,
"filter": true
},
"tileSettings": {
"titleContent": {},
"leftContent": {
"columnMatch": "count_",
"formatter": 12,
"formatOptions": {
"max": 200,
"palette": "blue"
}
},
"showBorder": false
}
},
"customWidth": "80",
"name": "query - 10 - Copy - Copy - Copy"
}
]
},
"name": "untaggedResources"
}
]
},
"name": "resources",
"styleSettings": {
"showBorder": true
}
},
{
"type": 12,
"content": {
"version": "NotebookGroup/1.0",
"groupType": "editable",
"title": "Resource Groups",
"items": [
{
"type": 3,
"content": {
"version": "KqlItem/1.0",
"query": "ResourceContainers\r\n| where type =~ 'Microsoft.Resources/subscriptions' \r\n| extend SubscriptionName=name \r\n| join ( ResourceContainers | where type =~ 'microsoft.resources/subscriptions/resourcegroups' | mvexpand tags | where tags == '' or isempty(tags) \r\n| extend resourceGroupName=id, RGLocation=location) on subscriptionId\r\n| project resourceGroupName, RGLocation, SubscriptionName\r\n| summarize count()\r\n",
"size": 4,
"title": "Untagged Resource Groups",
"noDataMessageStyle": 3,
"queryType": 1,
"resourceType": "microsoft.resourcegraph/resources",
"crossComponentResources": [
"{Subscription}"
],
"visualization": "tiles",
"tileSettings": {
"titleContent": {},
"leftContent": {
"columnMatch": "count_",
"formatter": 12,
"formatOptions": {
"max": 1,
"palette": "red"
}
},
"showBorder": false
}
},
"customWidth": "20",
"name": "query - 10 - Copy"
},
{
"type": 3,
"content": {
"version": "KqlItem/1.0",
"query": "ResourceContainers\r\n| where type == \"microsoft.resources/subscriptions/resourcegroups\"\r\n| mvexpand tags\r\n| where tags != '' or isnotempty(tags)\r\n| extend tagKey = tostring(bag_keys(tags)[0])\r\n| extend tagValue = tostring(tags[tagKey])\r\n| project tagKey, tagValue\r\n| distinct tagKey\r\n| summarize count()\r\n",
"size": 4,
"title": "Unique Resource Group Tags Keys",
"noDataMessageStyle": 3,
"queryType": 1,
"resourceType": "microsoft.resourcegraph/resources",
"crossComponentResources": [
"{Subscription}"
],
"visualization": "tiles",
"tileSettings": {
"titleContent": {},
"leftContent": {
"columnMatch": "count_",
"formatter": 12,
"formatOptions": {
"max": 50,
"palette": "blue"
}
},
"showBorder": false
}
},
"customWidth": "20",
"name": "query - 10 - Copy - Copy"
},
{
"type": 3,
"content": {
"version": "KqlItem/1.0",
"query": "ResourceContainers\r\n| where type == \"microsoft.resources/subscriptions/resourcegroups\"\r\n| mvexpand tags\r\n| where tags != '' or isnotempty(tags)\r\n| extend tagKey = tostring(bag_keys(tags)[0])\r\n| extend tagValue = tostring(tags[tagKey])\r\n| project tagKey, tagValue\r\n| distinct tagKey, tagValue\r\n",
"size": 0,
"showAnalytics": true,
"title": "Unique Resource Group Tags",
"noDataMessageStyle": 3,
"showExportToExcel": true,
"queryType": 1,
"resourceType": "microsoft.resourcegraph/resources",
"crossComponentResources": [
"{Subscription}"
],
"visualization": "table",
"tileSettings": {
"titleContent": {},
"leftContent": {
"columnMatch": "count_",
"formatter": 12,
"formatOptions": {
"max": 50,
"palette": "blue"
}
},
"showBorder": false
}
},
"customWidth": "50",
"name": "query - 10 - Copy - Copy - Copy"
},
{
"type": 12,
"content": {
"version": "NotebookGroup/1.0",
"groupType": "editable",
"title": "Untagged Resource Groups List",
"expandable": true,
"items": [
{
"type": 3,
"content": {
"version": "KqlItem/1.0",
"query": "ResourceContainers\r\n| where type == \"microsoft.resources/subscriptions/resourcegroups\"\r\n| mvexpand tags\r\n| where tags == '' or isempty(tags)\r\n| extend tagKey = tostring(bag_keys(tags)[0])\r\n| extend tagValue = tostring(tags[tagKey])\r\n| project name, subscriptionId\r\n",
"size": 0,
"showAnalytics": true,
"title": "Untagged Resource Groups",
"noDataMessage": "All Resource Groups are Tagged",
"noDataMessageStyle": 3,
"showExportToExcel": true,
"queryType": 1,
"resourceType": "microsoft.resourcegraph/resources",
"crossComponentResources": [
"{Subscription}"
],
"visualization": "table",
"gridSettings": {
"formatters": [
{
"columnMatch": "name",
"formatter": 14,
"formatOptions": {
"linkTarget": null,
"showIcon": true
}
},
{
"columnMatch": "subscriptionId",
"formatter": 15,
"formatOptions": {
"linkTarget": null,
"showIcon": true
}
}
],
"rowLimit": 2000,
"filter": true
},
"tileSettings": {
"titleContent": {},
"leftContent": {
"columnMatch": "count_",
"formatter": 12,
"formatOptions": {
"max": 50,
"palette": "blue"
}
},
"showBorder": false
}
},
"customWidth": "50",
"name": "query - 10 - Copy - Copy - Copy - Copy"
}
]
},
"name": "untaggedResourceGroups"
}
]
},
"name": "resourceGroups",
"styleSettings": {
"showBorder": true
}
},
{
"type": 12,
"content": {
"version": "NotebookGroup/1.0",
"groupType": "editable",
"title": "Subscriptions",
"items": [
{
"type": 3,
"content": {
"version": "KqlItem/1.0",
"query": "ResourceContainers\r\n| where type =~ 'Microsoft.Resources/subscriptions' \r\n| mvexpand tags\r\n| where tags == '' or isempty(tags)\r\n| summarize count()\r\n",
"size": 4,
"title": "Untagged Subscriptions",
"noDataMessageStyle": 3,
"queryType": 1,
"resourceType": "microsoft.resourcegraph/resources",
"crossComponentResources": [
"{Subscription}"
],
"visualization": "tiles",
"tileSettings": {
"titleContent": {},
"leftContent": {
"columnMatch": "count_",
"formatter": 12,
"formatOptions": {
"max": 1,
"palette": "red"
}
},
"showBorder": false
}
},
"customWidth": "20",
"name": "query - 10 - Copy - Copy"
},
{
"type": 3,
"content": {
"version": "KqlItem/1.0",
"query": "ResourceContainers\r\n| where type =~ 'Microsoft.Resources/subscriptions' \r\n| mvexpand tags\r\n| where tags != '' or isnotempty(tags)\r\n| extend tagKey = tostring(bag_keys(tags)[0])\r\n| extend tagValue = tostring(tags[tagKey])\r\n| project tagKey, tagValue\r\n| distinct tagKey\r\n| summarize count()\r\n",
"size": 4,
"title": "Unique Subscriptions Tags Keys",
"noDataMessageStyle": 3,
"queryType": 1,
"resourceType": "microsoft.resourcegraph/resources",
"crossComponentResources": [
"{Subscription}"
],
"visualization": "tiles",
"tileSettings": {
"titleContent": {},
"leftContent": {
"columnMatch": "count_",
"formatter": 12,
"formatOptions": {
"max": 50,
"palette": "blue"
}
},
"showBorder": false
}
},
"customWidth": "20",
"name": "query - 10 - Copy - Copy - Copy"
},
{
"type": 3,
"content": {
"version": "KqlItem/1.0",
"query": "ResourceContainers\r\n| where type =~ 'Microsoft.Resources/subscriptions' \r\n| mvexpand tags\r\n| where tags != '' or isnotempty(tags)\r\n| extend tagKey = tostring(bag_keys(tags)[0])\r\n| extend tagValue = tostring(tags[tagKey])\r\n| project tagKey, tagValue\r\n| distinct tagKey, tagValue\r\n",
"size": 0,
"showAnalytics": true,
"title": "Unique Subscriptions Tags",
"noDataMessageStyle": 3,
"showExportToExcel": true,
"queryType": 1,
"resourceType": "microsoft.resourcegraph/resources",
"crossComponentResources": [
"{Subscription}"
],
"visualization": "table",
"tileSettings": {
"titleContent": {},
"leftContent": {