Skip to content

Commit 3e75778

Browse files
Adding new Tiles to the Dashboard
1 parent 2ffee93 commit 3e75778

File tree

1 file changed

+130
-24
lines changed

1 file changed

+130
-24
lines changed

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

Lines changed: 130 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"x": 0,
1010
"y": 0,
1111
"colSpan": 3,
12-
"rowSpan": 4
12+
"rowSpan": 5
1313
},
1414
"metadata": {
1515
"inputs": [
@@ -44,7 +44,7 @@
4444
},
4545
{
4646
"name": "query",
47-
"value": "// Count of all resources\nresources\n| where type == \"microsoft.azurearcdata/sqlserverinstances\"\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\"\n| summarize Servers=count()\n",
4848
"isOptional": true
4949
}
5050
],
@@ -60,8 +60,61 @@
6060
"position": {
6161
"x": 3,
6262
"y": 0,
63+
"colSpan": 7,
64+
"rowSpan": 5
65+
},
66+
"metadata": {
67+
"inputs": [
68+
{
69+
"name": "isShared",
70+
"isOptional": true
71+
},
72+
{
73+
"name": "queryId",
74+
"isOptional": true
75+
},
76+
{
77+
"name": "formatResults",
78+
"isOptional": true
79+
},
80+
{
81+
"name": "partTitle",
82+
"value": "Query 1",
83+
"isOptional": true
84+
},
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+
},
90+
{
91+
"name": "chartType",
92+
"value": 2,
93+
"isOptional": true
94+
},
95+
{
96+
"name": "queryScope",
97+
"value": {
98+
"scope": 0,
99+
"values": []
100+
},
101+
"isOptional": true
102+
}
103+
],
104+
"type": "Extension/HubsExtension/PartType/ArgQueryChartTile",
105+
"settings": {},
106+
"partHeader": {
107+
"title": "Sql Server Type Distributions",
108+
"subtitle": ""
109+
}
110+
}
111+
},
112+
"2": {
113+
"position": {
114+
"x": 10,
115+
"y": 0,
63116
"colSpan": 3,
64-
"rowSpan": 4
117+
"rowSpan": 5
65118
},
66119
"metadata": {
67120
"inputs": [
@@ -86,9 +139,57 @@
86139
"value": "Query 1",
87140
"isOptional": true
88141
},
142+
{
143+
"name": "queryScope",
144+
"value": {
145+
"scope": 0,
146+
"values": []
147+
},
148+
"isOptional": true
149+
},
89150
{
90151
"name": "query",
91-
"value": "// Count of all resources\nresources\n| where type == \"microsoft.azurearcdata/sqlserverinstances/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\"\n| count ",
153+
"isOptional": true
154+
}
155+
],
156+
"type": "Extension/HubsExtension/PartType/ArgQuerySingleValueTile",
157+
"settings": {},
158+
"partHeader": {
159+
"title": "Number of Databases",
160+
"subtitle": ""
161+
}
162+
}
163+
},
164+
"3": {
165+
"position": {
166+
"x": 13,
167+
"y": 0,
168+
"colSpan": 7,
169+
"rowSpan": 5
170+
},
171+
"metadata": {
172+
"inputs": [
173+
{
174+
"name": "isShared",
175+
"isOptional": true
176+
},
177+
{
178+
"name": "queryId",
179+
"isOptional": true
180+
},
181+
{
182+
"name": "formatResults",
183+
"isOptional": true
184+
},
185+
{
186+
"name": "partTitle",
187+
"value": "Query 1",
188+
"isOptional": true
189+
},
190+
{
191+
"name": "chartType",
192+
"value": 2,
92193
"isOptional": true
93194
},
94195
{
@@ -98,21 +199,26 @@
98199
"values": []
99200
},
100201
"isOptional": true
202+
},
203+
{
204+
"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\")))",
206+
"isOptional": true
101207
}
102208
],
103-
"type": "Extension/HubsExtension/PartType/ArgQuerySingleValueTile",
209+
"type": "Extension/HubsExtension/PartType/ArgQueryChartTile",
104210
"settings": {},
105211
"partHeader": {
106-
"title": "Number of Databases",
212+
"title": "Databases per Type",
107213
"subtitle": ""
108214
}
109215
}
110216
},
111-
"2": {
217+
"4": {
112218
"position": {
113-
"x": 6,
114-
"y": 0,
115-
"colSpan": 14,
219+
"x": 0,
220+
"y": 5,
221+
"colSpan": 20,
116222
"rowSpan": 4
117223
},
118224
"metadata": {
@@ -148,7 +254,7 @@
148254
},
149255
{
150256
"name": "query",
151-
"value": "resources\r\n| where type == \"microsoft.azurearcdata/sqlserverinstances/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))) by Instances = tostring(split(tostring(id),\"/\")[8])\r\n| order by Offline",
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",
152258
"isOptional": true
153259
}
154260
],
@@ -160,10 +266,10 @@
160266
}
161267
}
162268
},
163-
"3": {
269+
"5": {
164270
"position": {
165271
"x": 0,
166-
"y": 4,
272+
"y": 9,
167273
"colSpan": 6,
168274
"rowSpan": 6
169275
},
@@ -201,7 +307,7 @@
201307
},
202308
{
203309
"name": "query",
204-
"value": "// If distinct count is small (e.g. < 1000)\n// run next query to get count of each value\nresources\n| where ['type'] == \"microsoft.azurearcdata/sqlserverinstances\"\n| summarize Count=count() by tostring(properties['edition'])\n| order by Count desc",
310+
"value": "// If distinct count is small (e.g. < 1000)\n// run next query to get count of each value\nresources\n| where type == \"microsoft.sql/managedinstances\" or \n type == \"microsoft.azurearcdata/sqlserverinstances\" or \n type == \"microsoft.sqlvirtualmachine/sqlvirtualmachines\"\n| summarize Count=count() by iif(type==\"microsoft.azurearcdata/sqlserverinstances\"\n,tostring(properties['edition'])\n, iif(type==\"microsoft.sql/managedinstances\", tostring(sku['tier'])\n,tostring(properties['sqlImageSku'])))\n| order by Count desc",
205311
"isOptional": true
206312
}
207313
],
@@ -213,10 +319,10 @@
213319
}
214320
}
215321
},
216-
"4": {
322+
"6": {
217323
"position": {
218324
"x": 6,
219-
"y": 4,
325+
"y": 9,
220326
"colSpan": 8,
221327
"rowSpan": 6
222328
},
@@ -266,10 +372,10 @@
266372
}
267373
}
268374
},
269-
"5": {
375+
"7": {
270376
"position": {
271377
"x": 14,
272-
"y": 4,
378+
"y": 9,
273379
"colSpan": 6,
274380
"rowSpan": 6
275381
},
@@ -319,10 +425,10 @@
319425
}
320426
}
321427
},
322-
"6": {
428+
"8": {
323429
"position": {
324430
"x": 0,
325-
"y": 10,
431+
"y": 15,
326432
"colSpan": 6,
327433
"rowSpan": 6
328434
},
@@ -372,10 +478,10 @@
372478
}
373479
}
374480
},
375-
"7": {
481+
"9": {
376482
"position": {
377483
"x": 6,
378-
"y": 10,
484+
"y": 15,
379485
"colSpan": 6,
380486
"rowSpan": 6
381487
},
@@ -425,10 +531,10 @@
425531
}
426532
}
427533
},
428-
"8": {
534+
"10": {
429535
"position": {
430536
"x": 12,
431-
"y": 10,
537+
"y": 15,
432538
"colSpan": 8,
433539
"rowSpan": 6
434540
},

0 commit comments

Comments
 (0)