From f2fdfa4cb76fffcfeae2d4910c86eec3d25f86c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20Carboneras?= Date: Wed, 26 Jul 2023 09:32:50 +0200 Subject: [PATCH] Removed expired Arc servers --- .../workbooks/Azure Arc Sql Servers.workbook | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/samples/features/azure-arc/workbooks/Azure Arc Sql Servers.workbook b/samples/features/azure-arc/workbooks/Azure Arc Sql Servers.workbook index 59a52f37..c42a3a95 100644 --- a/samples/features/azure-arc/workbooks/Azure Arc Sql Servers.workbook +++ b/samples/features/azure-arc/workbooks/Azure Arc Sql Servers.workbook @@ -92,7 +92,7 @@ "type": 3, "content": { "version": "KqlItem/1.0", - "query": "resources\r\n| where type =~ 'microsoft.hybridcompute/machines'\r\n| where properties.detectedProperties.mssqldiscovered == \"true\"\r\n| count\r\n| extend Tittle=\"Number of Azure Arc SQL Servers:\"", + "query": "resources\r\n| where type =~ 'microsoft.hybridcompute/machines'\r\n| where properties.detectedProperties.mssqldiscovered == \"true\" and properties.status != \"Expired\"\r\n| count\r\n| extend Tittle=\"Number of Azure Arc SQL Servers:\"", "size": 4, "queryType": 1, "resourceType": "microsoft.resourcegraph/resources", @@ -122,7 +122,7 @@ "type": 3, "content": { "version": "KqlItem/1.0", - "query": "resources\r\n| where type =~ \"Microsoft.AzureArcData/sqlServerInstances\"\r\n| extend SQLInstance = id, AzureArcServer = strcat(\"/\",tostring(properties.containerResourceId))\r\n| where SQLInstance like \"{SQLInstance}\"\r\n| where AzureArcServer like \"{ServerName}\"\r\n| extend version = tostring(properties.version)\r\n| summarize count() by tostring(version)\r\n| sort by version", + "query": "resources\r\n| where type =~ \"Microsoft.AzureArcData/sqlServerInstances\"\r\n| extend SQLInstance = id, AzureArcServer = tolower(tostring(properties.containerResourceId))\r\n| join kind=inner (resources\r\n| where type in ('microsoft.hybridcompute/machines')\r\n| where properties.status != \"Expired\"\r\n| extend id = tolower(id)) on $left.AzureArcServer == $right.id\r\n| where SQLInstance like \"{SQLInstance}\"\r\n| where AzureArcServer like \"{ServerName}\"\r\n| extend version = tostring(properties.version)\r\n| summarize count() by tostring(version)\r\n| sort by version", "size": 3, "title": "SQL Versions", "queryType": 1, @@ -139,7 +139,7 @@ "type": 3, "content": { "version": "KqlItem/1.0", - "query": "resources\r\n| where type =~ \"Microsoft.AzureArcData/sqlServerInstances\"\r\n| extend SQLInstance = id, AzureArcServer = strcat(\"/\",tostring(properties.containerResourceId))\r\n| where SQLInstance like \"{SQLInstance}\"\r\n| where AzureArcServer like \"{ServerName}\"\r\n| extend azureDefenderStatus = tostring(properties.azureDefenderStatus)\r\n| summarize count() by tostring(azureDefenderStatus)\r\n| sort by azureDefenderStatus", + "query": "resources\r\n| where type =~ \"Microsoft.AzureArcData/sqlServerInstances\"\r\n| extend SQLInstance = id, AzureArcServer = tolower(tostring(properties.containerResourceId))\r\n| join kind=inner (resources\r\n| where type in ('microsoft.hybridcompute/machines')\r\n| where properties.status != \"Expired\"\r\n| extend id = tolower(id)) on $left.AzureArcServer == $right.id\r\n| where SQLInstance like \"{SQLInstance}\"\r\n| where AzureArcServer like \"{ServerName}\"\r\n| extend azureDefenderStatus = tostring(properties.azureDefenderStatus)\r\n| summarize count() by tostring(azureDefenderStatus)\r\n| sort by azureDefenderStatus", "size": 3, "title": "Azure Defender Status", "queryType": 1, @@ -172,7 +172,7 @@ "type": 3, "content": { "version": "KqlItem/1.0", - "query": "resources\r\n| where type =~ \"Microsoft.AzureArcData/sqlServerInstances\"\r\n| extend SQLInstance = id, AzureArcServer = strcat(\"/\",tostring(properties.containerResourceId))\r\n| where SQLInstance like \"{SQLInstance}\"\r\n| where AzureArcServer like \"{ServerName}\"\r\n| extend edition = tostring(properties.edition)\r\n| summarize count() by tostring(edition)\r\n| sort by edition", + "query": "resources\r\n| where type =~ \"Microsoft.AzureArcData/sqlServerInstances\"\r\n| extend SQLInstance = id, AzureArcServer = tolower(tostring(properties.containerResourceId))\r\n| join kind=inner (resources\r\n| where type in ('microsoft.hybridcompute/machines')\r\n| where properties.status != \"Expired\"\r\n| extend id = tolower(id)) on $left.AzureArcServer == $right.id\r\n| where SQLInstance like \"{SQLInstance}\"\r\n| where AzureArcServer like \"{ServerName}\"\r\n| extend edition = tostring(properties.edition)\r\n| summarize count() by tostring(edition)\r\n| sort by edition", "size": 3, "title": "SQL Editions", "queryType": 1, @@ -205,7 +205,7 @@ "type": 3, "content": { "version": "KqlItem/1.0", - "query": "resources\r\n| where type =~ \"Microsoft.AzureArcData/sqlServerInstances\"\r\n| extend SQLInstance = id, AzureArcServer = strcat(\"/\",tostring(properties.containerResourceId))\r\n| where SQLInstance like \"{SQLInstance}\"\r\n| where AzureArcServer like \"{ServerName}\"\r\n| extend licenseType = tostring(properties.licenseType)\r\n| summarize count() by tostring(licenseType)\r\n| sort by licenseType", + "query": "resources\r\n| where type =~ \"Microsoft.AzureArcData/sqlServerInstances\"\r\n| extend SQLInstance = id, AzureArcServer = tolower(tostring(properties.containerResourceId))\r\n| join kind=inner (resources\r\n| where type in ('microsoft.hybridcompute/machines')\r\n| where properties.status != \"Expired\"\r\n| extend id = tolower(id)) on $left.AzureArcServer == $right.id\r\n| where SQLInstance like \"{SQLInstance}\"\r\n| where AzureArcServer like \"{ServerName}\"\r\n| extend licenseType = tostring(properties.licenseType)\r\n| summarize count() by tostring(licenseType)\r\n| sort by licenseType", "size": 3, "title": "LicenseType", "queryType": 1, @@ -222,7 +222,7 @@ "type": 3, "content": { "version": "KqlItem/1.0", - "query": "resources\r\n| where type =~ \"Microsoft.AzureArcData/sqlServerInstances\"\r\n| extend SQLInstance = id, AzureArcServer = tostring(properties.containerResourceId)\r\n| where SQLInstance like \"{SQLInstance}\"\r\n| where AzureArcServer like \"{ServerName}\"\r\n| extend createdAt = format_datetime(todatetime(systemData.createdAt), 'yyyy-MM-dd hh:mm:ss')\r\n| extend version = tostring(properties.version)\r\n| extend edition = tostring(properties.edition)\r\n| extend currentVersion = tostring(properties.currentVersion)\r\n| extend licenseType = tostring(properties.licenseType)\r\n| extend azureDefenderStatus = tostring(properties.azureDefenderStatus)\r\n| extend patchLevel = tostring(properties.patchLevel)\r\n| extend vcores = toint(properties.vCore)\r\n| project createdAt,AzureArcServer,SQLInstance,version,currentVersion,patchLevel,edition,vcores,subscriptionId,licenseType,azureDefenderStatus\r\n", + "query": "resources\r\n| where type =~ \"Microsoft.AzureArcData/sqlServerInstances\"\r\n| extend SQLInstance = id, AzureArcServer = tolower(tostring(properties.containerResourceId))\r\n| join kind=inner (resources\r\n| where type in ('microsoft.hybridcompute/machines')\r\n| where properties.status != \"Expired\"\r\n| extend id = tolower(id)) on $left.AzureArcServer == $right.id\r\n| where SQLInstance like \"{SQLInstance}\"\r\n| where AzureArcServer like \"{ServerName}\"\r\n| extend createdAt = format_datetime(todatetime(systemData.createdAt), 'yyyy-MM-dd hh:mm:ss')\r\n| extend version = tostring(properties.version)\r\n| extend edition = tostring(properties.edition)\r\n| extend currentVersion = tostring(properties.currentVersion)\r\n| extend licenseType = tostring(properties.licenseType)\r\n| extend azureDefenderStatus = tostring(properties.azureDefenderStatus)\r\n| extend patchLevel = tostring(properties.patchLevel)\r\n| extend vcores = toint(properties.vCore)\r\n| project createdAt,AzureArcServer,SQLInstance,version,currentVersion,patchLevel,edition,vcores,subscriptionId,licenseType,azureDefenderStatus\r\n", "size": 0, "showAnalytics": true, "queryType": 1,