Skip to content

Commit ca5a059

Browse files
Add ESU information and fix Azure SQL VM and Azure SQL DB
Add information to show ESU for SQL server. Fix the error on showing Azure SQL Vm instead of Azure SQL DB and added the capability to see Azure SQL VM,
1 parent 29aa2bb commit ca5a059

File tree

1 file changed

+77
-25
lines changed

1 file changed

+77
-25
lines changed

samples/features/azure-arc/dashboard/SQL Server Instances.json

Lines changed: 77 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
},
4545
{
4646
"name": "query",
47-
"value": "// Count of all resources\nresources\n| where type == \"microsoft.sql/managedinstances\" or \n type == \"microsoft.azurearcdata/sqlserverinstances\" or \n type == \"microsoft.sql/servers\"\n| summarize Servers=count()\n",
47+
"value": "// Count of all resources\nresources\n| where type == \"microsoft.sql/managedinstances\" or \n type == \"microsoft.azurearcdata/sqlserverinstances\" or \n type == \"microsoft.sql/servers\" or \n type==\"microsoft.sqlvirtualmachine/sqlvirtualmachines\"\n| summarize Servers=count()\n",
4848
"isOptional": true
4949
}
5050
],
@@ -82,11 +82,6 @@
8282
"value": "Query 1",
8383
"isOptional": true
8484
},
85-
{
86-
"name": "query",
87-
"value": "resources\n| where type == \"microsoft.sql/managedinstances\" or \n type == \"microsoft.azurearcdata/sqlserverinstances\" or \n type == \"microsoft.sql/servers\"\n| summarize ResourceCount=count() by iff( type==\"microsoft.sql/managedinstances\",\"Azure SQL Manage Instance\"\n,iif(type==\"microsoft.azurearcdata/sqlserverinstances\",\"Arc Enable SQL Server\",iif(type==\"microsoft.sql/servers\",\"Azure SQL Server On VM\",\"Azure SQL DB\")))\n",
88-
"isOptional": true
89-
},
9085
{
9186
"name": "chartType",
9287
"value": 2,
@@ -99,6 +94,11 @@
9994
"values": []
10095
},
10196
"isOptional": true
97+
},
98+
{
99+
"name": "query",
100+
"value": "resources\n| where type == \"microsoft.sql/managedinstances\" or \n type == \"microsoft.azurearcdata/sqlserverinstances\" or \n type == \"microsoft.sql/servers\" or \n type == \"microsoft.sqlvirtualmachine/sqlvirtualmachines\"\n| summarize ResourceCount=count() by iff( \n type==\"microsoft.sql/managedinstances\",\"Azure SQL Manage Instance\"\n ,iif(\n type==\"microsoft.azurearcdata/sqlserverinstances\",\"Arc Enable SQL Server\"\n ,iif(\n type==\"microsoft.sql/servers\",\"Azure SQL DB\"\n ,iif(\n type==\"microsoft.sqlvirtualmachine/sqlvirtualmachines\",\"Azure SQL Server On VM\",\"Not Found\"\n )\n )\n )\n )\n",
101+
"isOptional": true
102102
}
103103
],
104104
"type": "Extension/HubsExtension/PartType/ArgQueryChartTile",
@@ -149,7 +149,7 @@
149149
},
150150
{
151151
"name": "query",
152-
"value": "// Count of all resources\nresources\n| where type == \"microsoft.sql/managedinstances/databases\" or \n type == \"microsoft.azurearcdata/sqlserverinstances/databases\" or \n type == \"microsoft.sql/servers/databases\"\n| count ",
152+
"value": "// Count of all resources\nresources\n| where (type == \"microsoft.sql/managedinstances/databases\" or \n type == \"microsoft.azurearcdata/sqlserverinstances/databases\" or \n type == \"microsoft.sql/servers/databases\" ) and \n (name !in (\"master\",\"model\",\"msdb\") and \n name !contains \"tempdb\")\n| count \n\n\n",
153153
"isOptional": true
154154
}
155155
],
@@ -202,7 +202,7 @@
202202
},
203203
{
204204
"name": "query",
205-
"value": "// top ten resource types by number of resources\n// Count of all resources\nresources\n| where type == \"microsoft.sql/managedinstances/databases\" or \n type == \"microsoft.azurearcdata/sqlserverinstances/databases\" or \n type == \"microsoft.sql/servers/databases\"\n| summarize ResourceCount=count() by iff( type==\"microsoft.sql/managedinstances/databases\",\"Azure SQL Manage Instance/databases\"\n,iif(type==\"microsoft.azurearcdata/sqlserverinstances/databases\",\"Arc Enable SQL Server\",iif(type==\"microsoft.sql/servers\",\"Azure SQL Server On VM\",\"Azure SQL DB\")))",
205+
"value": "// top ten resource types by number of resources\n// Count of all resources\nresources\n| where (type == \"microsoft.sql/managedinstances/databases\" or \n type == \"microsoft.azurearcdata/sqlserverinstances/databases\" or \n type == \"microsoft.sql/servers/databases\" or \n type==\"microsoft.sqlvirtualmachine/sqlvirtualmachines/databases\") and \n (name !in (\"master\",\"model\",\"msdb\") and \n name !contains \"tempdb\")\n| summarize ResourceCount=count() by iff( \n type==\"microsoft.sql/managedinstances/databases\",\"Azure SQL Manage Instance\"\n ,iif(\n type==\"microsoft.azurearcdata/sqlserverinstances/databases\",\"Arc Enable SQL Server\"\n ,iif(\n type==\"microsoft.sql/servers/databases\",\"Azure SQL DB\"\n ,iif(\n type==\"microsoft.sqlvirtualmachine/sqlvirtualmachines/databases\",\"Azure SQL Server On VM\",\"Not Found\"\n )\n )\n )\n )",
206206
"isOptional": true
207207
}
208208
],
@@ -254,14 +254,14 @@
254254
},
255255
{
256256
"name": "query",
257-
"value": "resources\r\n| where type == \"microsoft.sql/managedinstances/databases\" or \r\n type == \"microsoft.azurearcdata/sqlserverinstances/databases\" or \r\n type == \"microsoft.sql/servers/databases\"\r\n| summarize Dbs=count(),Offline=sum(toint(iif(tostring(properties[\"state\"])!=\"Online\",1,0)))\r\n,SizeMB=sum(toint(iif(tostring(properties[\"sizeMB\"])!=\"\",properties[\"sizeMB\"],0)))\r\n,Type=max(iff( type==\"microsoft.sql/managedinstances/databases\",\"Azure SQL Manage Instance\"\r\n,iif(type==\"microsoft.azurearcdata/sqlserverinstances/databases\",\"Arc Enable SQL Server\",iif(type==\"microsoft.sql/servers/databases\",\"Azure SQL Server On VM\",\"Azure SQL DB\")))) by Instances = tostring(split(tostring(id),\"/\")[8])\r\n| order by Offline",
257+
"value": "resources\r\n| where type == \"microsoft.hybridcompute/machines\"\r\n| where properties.detectedProperties.mssqldiscovered == \"true\"\r\n| extend machineIdHasSQLServerDiscovered = id\r\n| project name, machineIdHasSQLServerDiscovered, resourceGroup, subscriptionId\r\n| join kind= leftouter (\r\n resources\r\n | where type == \"microsoft.hybridcompute/machines/extensions\"\r\n | where properties.type in (\"WindowsAgent.SqlServer\",\"LinuxAgent.SqlServer\")\r\n | extend machineIdHasSQLServerExtensionInstalled = iff(id contains \"/extensions/WindowsAgent.SqlServer\" or id contains \"/extensions/LinuxAgent.SqlServer\", substring(id, 0, indexof(id, \"/extensions/\")), \"\")\r\n | project Provisioning_State = properties.provisioningState,\r\n License_Type = properties.settings.LicenseType,\r\n ESU = iff(notnull(properties.settings.enableExtendedSecurityUpdates), \"enabled\", \"\"),\r\n Extension_Version = properties.instanceView.typeHandlerVersion,\r\n Exlcuded_instaces = properties.ExcludedSqlInstances,\r\n Purview = iff(notnull(properties.settings.ExternalPolicyBasedAuthorization),\"enabled\",\"\"),\r\n Entra = iff(notnull(properties.settings.AzureAD),\"enabled\",\"\"),\r\n BPA = iff(notnull(properties.settings.AssessmentSettings),\"enabled\",\"\"),\r\n machineIdHasSQLServerExtensionInstalled)\r\non $left.machineIdHasSQLServerDiscovered == $right.machineIdHasSQLServerExtensionInstalled\r\n| where isnotempty(machineIdHasSQLServerExtensionInstalled)\r\n| project-away machineIdHasSQLServerDiscovered, machineIdHasSQLServerExtensionInstalled",
258258
"isOptional": true
259259
}
260260
],
261261
"type": "Extension/HubsExtension/PartType/ArgQueryGridTile",
262262
"settings": {},
263263
"partHeader": {
264-
"title": "Dbs per Servers",
264+
"title": "Arc SQL details",
265265
"subtitle": ""
266266
}
267267
}
@@ -270,6 +270,58 @@
270270
"position": {
271271
"x": 0,
272272
"y": 9,
273+
"colSpan": 19,
274+
"rowSpan": 4
275+
},
276+
"metadata": {
277+
"inputs": [
278+
{
279+
"name": "chartType",
280+
"isOptional": true
281+
},
282+
{
283+
"name": "isShared",
284+
"isOptional": true
285+
},
286+
{
287+
"name": "queryId",
288+
"isOptional": true
289+
},
290+
{
291+
"name": "formatResults",
292+
"isOptional": true
293+
},
294+
{
295+
"name": "partTitle",
296+
"value": "Query 1",
297+
"isOptional": true
298+
},
299+
{
300+
"name": "queryScope",
301+
"value": {
302+
"scope": 0,
303+
"values": []
304+
},
305+
"isOptional": true
306+
},
307+
{
308+
"name": "query",
309+
"value": "resources\r\n| where (type == \"microsoft.sql/managedinstances/databases\" or \r\n type == \"microsoft.azurearcdata/sqlserverinstances/databases\" or \r\n type == \"microsoft.sql/servers/databases\" ) and \r\n (name !in (\"master\",\"model\",\"msdb\") and \r\n name !contains \"tempdb\")\r\n| summarize Dbs=count(),Offline=sum(toint(iif(tostring(properties[\"state\"])!=\"Online\" and tostring(properties[\"status\"])!=\"Online\" and tostring(properties[\"status\"])!=\"Paused\" ,1,0)))\r\n,SizeMB=sum(toint(iif(tostring(properties[\"sizeMB\"])!=\"\",properties[\"sizeMB\"],0)))\r\n,Type=max(\r\n iff( type==\"microsoft.sql/managedinstances/databases\",\"Azure SQL Manage Instance\"\r\n ,iif(type==\"microsoft.azurearcdata/sqlserverinstances/databases\",\"Arc Enable SQL Server\"\r\n ,iif(type==\"microsoft.sql/servers/databases\",\"Azure SQL DB\"\r\n ,iif(type==\"microsoft.sqlvirtualmachine/sqlvirtualmachines/databases\",\"Azure SQL Server On VM\",\"Not Found\")\r\n )\r\n )\r\n )\r\n ) by Instances = tostring(split(tostring(id),\"/\")[8])\r\n| order by Offline",
310+
"isOptional": true
311+
}
312+
],
313+
"type": "Extension/HubsExtension/PartType/ArgQueryGridTile",
314+
"settings": {},
315+
"partHeader": {
316+
"title": "Dbs per Servers",
317+
"subtitle": ""
318+
}
319+
}
320+
},
321+
"6": {
322+
"position": {
323+
"x": 0,
324+
"y": 13,
273325
"colSpan": 6,
274326
"rowSpan": 6
275327
},
@@ -319,10 +371,10 @@
319371
}
320372
}
321373
},
322-
"6": {
374+
"7": {
323375
"position": {
324376
"x": 6,
325-
"y": 9,
377+
"y": 13,
326378
"colSpan": 7,
327379
"rowSpan": 6
328380
},
@@ -372,10 +424,10 @@
372424
}
373425
}
374426
},
375-
"7": {
427+
"8": {
376428
"position": {
377429
"x": 13,
378-
"y": 9,
430+
"y": 13,
379431
"colSpan": 6,
380432
"rowSpan": 6
381433
},
@@ -425,10 +477,10 @@
425477
}
426478
}
427479
},
428-
"8": {
480+
"9": {
429481
"position": {
430482
"x": 0,
431-
"y": 15,
483+
"y": 19,
432484
"colSpan": 6,
433485
"rowSpan": 6
434486
},
@@ -478,10 +530,10 @@
478530
}
479531
}
480532
},
481-
"9": {
533+
"10": {
482534
"position": {
483535
"x": 6,
484-
"y": 15,
536+
"y": 19,
485537
"colSpan": 6,
486538
"rowSpan": 6
487539
},
@@ -531,10 +583,10 @@
531583
}
532584
}
533585
},
534-
"10": {
586+
"11": {
535587
"position": {
536588
"x": 12,
537-
"y": 15,
589+
"y": 19,
538590
"colSpan": 7,
539591
"rowSpan": 6
540592
},
@@ -584,10 +636,10 @@
584636
}
585637
}
586638
},
587-
"11": {
639+
"12": {
588640
"position": {
589641
"x": 0,
590-
"y": 21,
642+
"y": 25,
591643
"colSpan": 6,
592644
"rowSpan": 5
593645
},
@@ -637,10 +689,10 @@
637689
}
638690
}
639691
},
640-
"12": {
692+
"13": {
641693
"position": {
642694
"x": 6,
643-
"y": 21,
695+
"y": 25,
644696
"colSpan": 6,
645697
"rowSpan": 5
646698
},
@@ -714,4 +766,4 @@
714766
"hidden-title": "SQL Server Instances"
715767
},
716768
"apiVersion": "2015-08-01-preview"
717-
}
769+
}

0 commit comments

Comments
 (0)