Adding new Tiles to the Dashboard

This commit is contained in:
Rodrigo Monteiro
2023-05-11 19:33:15 -04:00
parent 2ffee93575
commit 3e757784ba
@@ -9,7 +9,7 @@
"x": 0,
"y": 0,
"colSpan": 3,
"rowSpan": 4
"rowSpan": 5
},
"metadata": {
"inputs": [
@@ -44,7 +44,7 @@
},
{
"name": "query",
"value": "// Count of all resources\nresources\n| where type == \"microsoft.azurearcdata/sqlserverinstances\"\n| summarize Servers=count()\n",
"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",
"isOptional": true
}
],
@@ -60,8 +60,61 @@
"position": {
"x": 3,
"y": 0,
"colSpan": 7,
"rowSpan": 5
},
"metadata": {
"inputs": [
{
"name": "isShared",
"isOptional": true
},
{
"name": "queryId",
"isOptional": true
},
{
"name": "formatResults",
"isOptional": true
},
{
"name": "partTitle",
"value": "Query 1",
"isOptional": true
},
{
"name": "query",
"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",
"isOptional": true
},
{
"name": "chartType",
"value": 2,
"isOptional": true
},
{
"name": "queryScope",
"value": {
"scope": 0,
"values": []
},
"isOptional": true
}
],
"type": "Extension/HubsExtension/PartType/ArgQueryChartTile",
"settings": {},
"partHeader": {
"title": "Sql Server Type Distributions",
"subtitle": ""
}
}
},
"2": {
"position": {
"x": 10,
"y": 0,
"colSpan": 3,
"rowSpan": 4
"rowSpan": 5
},
"metadata": {
"inputs": [
@@ -86,11 +139,6 @@
"value": "Query 1",
"isOptional": true
},
{
"name": "query",
"value": "// Count of all resources\nresources\n| where type == \"microsoft.azurearcdata/sqlserverinstances/databases\"\n| count ",
"isOptional": true
},
{
"name": "queryScope",
"value": {
@@ -98,6 +146,11 @@
"values": []
},
"isOptional": true
},
{
"name": "query",
"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 ",
"isOptional": true
}
],
"type": "Extension/HubsExtension/PartType/ArgQuerySingleValueTile",
@@ -108,11 +161,64 @@
}
}
},
"2": {
"3": {
"position": {
"x": 6,
"x": 13,
"y": 0,
"colSpan": 14,
"colSpan": 7,
"rowSpan": 5
},
"metadata": {
"inputs": [
{
"name": "isShared",
"isOptional": true
},
{
"name": "queryId",
"isOptional": true
},
{
"name": "formatResults",
"isOptional": true
},
{
"name": "partTitle",
"value": "Query 1",
"isOptional": true
},
{
"name": "chartType",
"value": 2,
"isOptional": true
},
{
"name": "queryScope",
"value": {
"scope": 0,
"values": []
},
"isOptional": true
},
{
"name": "query",
"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\")))",
"isOptional": true
}
],
"type": "Extension/HubsExtension/PartType/ArgQueryChartTile",
"settings": {},
"partHeader": {
"title": "Databases per Type",
"subtitle": ""
}
}
},
"4": {
"position": {
"x": 0,
"y": 5,
"colSpan": 20,
"rowSpan": 4
},
"metadata": {
@@ -148,7 +254,7 @@
},
{
"name": "query",
"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",
"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",
"isOptional": true
}
],
@@ -160,10 +266,10 @@
}
}
},
"3": {
"5": {
"position": {
"x": 0,
"y": 4,
"y": 9,
"colSpan": 6,
"rowSpan": 6
},
@@ -201,7 +307,7 @@
},
{
"name": "query",
"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",
"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",
"isOptional": true
}
],
@@ -213,10 +319,10 @@
}
}
},
"4": {
"6": {
"position": {
"x": 6,
"y": 4,
"y": 9,
"colSpan": 8,
"rowSpan": 6
},
@@ -266,10 +372,10 @@
}
}
},
"5": {
"7": {
"position": {
"x": 14,
"y": 4,
"y": 9,
"colSpan": 6,
"rowSpan": 6
},
@@ -319,10 +425,10 @@
}
}
},
"6": {
"8": {
"position": {
"x": 0,
"y": 10,
"y": 15,
"colSpan": 6,
"rowSpan": 6
},
@@ -372,10 +478,10 @@
}
}
},
"7": {
"9": {
"position": {
"x": 6,
"y": 10,
"y": 15,
"colSpan": 6,
"rowSpan": 6
},
@@ -425,10 +531,10 @@
}
}
},
"8": {
"10": {
"position": {
"x": 12,
"y": 10,
"y": 15,
"colSpan": 8,
"rowSpan": 6
},