|
9 | 9 | "x": 0, |
10 | 10 | "y": 0, |
11 | 11 | "colSpan": 3, |
12 | | - "rowSpan": 4 |
| 12 | + "rowSpan": 5 |
13 | 13 | }, |
14 | 14 | "metadata": { |
15 | 15 | "inputs": [ |
|
44 | 44 | }, |
45 | 45 | { |
46 | 46 | "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", |
48 | 48 | "isOptional": true |
49 | 49 | } |
50 | 50 | ], |
|
60 | 60 | "position": { |
61 | 61 | "x": 3, |
62 | 62 | "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, |
63 | 116 | "colSpan": 3, |
64 | | - "rowSpan": 4 |
| 117 | + "rowSpan": 5 |
65 | 118 | }, |
66 | 119 | "metadata": { |
67 | 120 | "inputs": [ |
|
86 | 139 | "value": "Query 1", |
87 | 140 | "isOptional": true |
88 | 141 | }, |
| 142 | + { |
| 143 | + "name": "queryScope", |
| 144 | + "value": { |
| 145 | + "scope": 0, |
| 146 | + "values": [] |
| 147 | + }, |
| 148 | + "isOptional": true |
| 149 | + }, |
89 | 150 | { |
90 | 151 | "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, |
92 | 193 | "isOptional": true |
93 | 194 | }, |
94 | 195 | { |
|
98 | 199 | "values": [] |
99 | 200 | }, |
100 | 201 | "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 |
101 | 207 | } |
102 | 208 | ], |
103 | | - "type": "Extension/HubsExtension/PartType/ArgQuerySingleValueTile", |
| 209 | + "type": "Extension/HubsExtension/PartType/ArgQueryChartTile", |
104 | 210 | "settings": {}, |
105 | 211 | "partHeader": { |
106 | | - "title": "Number of Databases", |
| 212 | + "title": "Databases per Type", |
107 | 213 | "subtitle": "" |
108 | 214 | } |
109 | 215 | } |
110 | 216 | }, |
111 | | - "2": { |
| 217 | + "4": { |
112 | 218 | "position": { |
113 | | - "x": 6, |
114 | | - "y": 0, |
115 | | - "colSpan": 14, |
| 219 | + "x": 0, |
| 220 | + "y": 5, |
| 221 | + "colSpan": 20, |
116 | 222 | "rowSpan": 4 |
117 | 223 | }, |
118 | 224 | "metadata": { |
|
148 | 254 | }, |
149 | 255 | { |
150 | 256 | "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", |
152 | 258 | "isOptional": true |
153 | 259 | } |
154 | 260 | ], |
|
160 | 266 | } |
161 | 267 | } |
162 | 268 | }, |
163 | | - "3": { |
| 269 | + "5": { |
164 | 270 | "position": { |
165 | 271 | "x": 0, |
166 | | - "y": 4, |
| 272 | + "y": 9, |
167 | 273 | "colSpan": 6, |
168 | 274 | "rowSpan": 6 |
169 | 275 | }, |
|
201 | 307 | }, |
202 | 308 | { |
203 | 309 | "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", |
205 | 311 | "isOptional": true |
206 | 312 | } |
207 | 313 | ], |
|
213 | 319 | } |
214 | 320 | } |
215 | 321 | }, |
216 | | - "4": { |
| 322 | + "6": { |
217 | 323 | "position": { |
218 | 324 | "x": 6, |
219 | | - "y": 4, |
| 325 | + "y": 9, |
220 | 326 | "colSpan": 8, |
221 | 327 | "rowSpan": 6 |
222 | 328 | }, |
|
266 | 372 | } |
267 | 373 | } |
268 | 374 | }, |
269 | | - "5": { |
| 375 | + "7": { |
270 | 376 | "position": { |
271 | 377 | "x": 14, |
272 | | - "y": 4, |
| 378 | + "y": 9, |
273 | 379 | "colSpan": 6, |
274 | 380 | "rowSpan": 6 |
275 | 381 | }, |
|
319 | 425 | } |
320 | 426 | } |
321 | 427 | }, |
322 | | - "6": { |
| 428 | + "8": { |
323 | 429 | "position": { |
324 | 430 | "x": 0, |
325 | | - "y": 10, |
| 431 | + "y": 15, |
326 | 432 | "colSpan": 6, |
327 | 433 | "rowSpan": 6 |
328 | 434 | }, |
|
372 | 478 | } |
373 | 479 | } |
374 | 480 | }, |
375 | | - "7": { |
| 481 | + "9": { |
376 | 482 | "position": { |
377 | 483 | "x": 6, |
378 | | - "y": 10, |
| 484 | + "y": 15, |
379 | 485 | "colSpan": 6, |
380 | 486 | "rowSpan": 6 |
381 | 487 | }, |
|
425 | 531 | } |
426 | 532 | } |
427 | 533 | }, |
428 | | - "8": { |
| 534 | + "10": { |
429 | 535 | "position": { |
430 | 536 | "x": 12, |
431 | | - "y": 10, |
| 537 | + "y": 15, |
432 | 538 | "colSpan": 8, |
433 | 539 | "rowSpan": 6 |
434 | 540 | }, |
|
0 commit comments