From 2951352142f63babf8a09d778072a649dbed7905 Mon Sep 17 00:00:00 2001 From: Travis Wright Date: Tue, 12 Nov 2024 01:40:25 -0800 Subject: [PATCH] Updating v2 format to v1 format for dashboards --- .../Arc SQL Server Feature Status.json | 805 +++++++++++------- .../Arc-enabled SQL Server Health.json | 83 ++ .../ArcEnabledSQLServerHealth.dx.json | 51 -- sql-server-samples | 1 + 4 files changed, 599 insertions(+), 341 deletions(-) create mode 100644 samples/features/azure-arc/dashboard/Arc-enabled SQL Server Health.json delete mode 100644 samples/features/azure-arc/dashboard/ArcEnabledSQLServerHealth.dx.json create mode 160000 sql-server-samples diff --git a/samples/features/azure-arc/dashboard/Arc SQL Server Feature Status.json b/samples/features/azure-arc/dashboard/Arc SQL Server Feature Status.json index 50c9a893..d3183d58 100644 --- a/samples/features/azure-arc/dashboard/Arc SQL Server Feature Status.json +++ b/samples/features/azure-arc/dashboard/Arc SQL Server Feature Status.json @@ -1,334 +1,559 @@ { "properties": { - "title": "Arc SQL Server Feature Status", - "pages": [ + "lenses": [ { - "title": "Feature Status", - "tiles": [ + "order": 0, + "parts": [ { - "data": { - "kind": "arg", - "query": "resources\r\n| where type == \"microsoft.azurearcdata/sqlserverinstances\"\r\n| project \r\nid, \r\nMigrationAssessment = iif(properties.migration.assessment.enabled == 'true', 'Enabled', 'Disabled'), \r\nMonitoring = iif(properties.monitoring.enabled == 'true', 'Enabled', 'Disabled'), \r\nBackupEnabled = iif(isempty(properties.backupPolicy.retentionPeriodDays),'Disabled', iif(properties.backupPolicy.retentionPeriodDays == 0,'Disabled','Enabled'))\r\n| order by id asc", - "usedParameters": [] - }, - "visualization": { - "type": "table", - "options": { - "hideTileTitle": false, - "table__enableFormatting": true, - "table__enableRenderLinks": true, - "table__renderLinksForColumns": [], - "colorRules": [], - "colorRulesDisabled": true, - "colorStyle": "light", - "crossFilter": [], - "crossFilterDisabled": false, - "drillthrough": [], - "drillthroughDisabled": false - } - }, - "title": "SQL Server instance features status", - "subtitle": "Shows enabled/disabled for each feature that is configured at the SQL Server instance level", - "type": "QueryTile", - "layout": { + "position": { "x": 0, "y": 0, - "width": 8, - "height": 4 + "colSpan": 11, + "rowSpan": 7 + }, + "metadata": { + "inputs": [ + { + "name": "chartType", + "isOptional": true + }, + { + "name": "isShared", + "isOptional": true + }, + { + "name": "queryId", + "isOptional": true + }, + { + "name": "formatResults", + "isOptional": true + }, + { + "name": "partTitle", + "value": "Query 1", + "isOptional": true + }, + { + "name": "queryScope", + "value": { + "scope": 0, + "values": [] + }, + "isOptional": true + }, + { + "name": "query", + "value": "resources\r\n| where type == \"microsoft.azurearcdata/sqlserverinstances\"\r\n| project \r\nid, \r\nMigrationAssessment = iif(properties.migration.assessment.enabled == 'true', 'ENABLED', 'disabled'), \r\nMonitoring = iif(properties.monitoring.enabled == 'true', 'ENABLED', 'disabled'), \r\nBackupEnabled = iif(isempty(properties.backupPolicy.retentionPeriodDays),'disabled', iif(properties.backupPolicy.retentionPeriodDays == 0,'disabled','ENABLED'))\r\n| order by id asc", + "isOptional": true + } + ], + "type": "Extension/HubsExtension/PartType/ArgQueryGridTile", + "settings": {}, + "partHeader": { + "title": "SQL Server instance features status", + "subtitle": "Shows enabled/disabled for each feature that is configured at the SQL Server instance level" + } } }, { - "data": { - "kind": "arg", - "query": "resources\r\n| where type == \"microsoft.hybridcompute/machines/extensions\"\r\n| where properties.type in (\"WindowsAgent.SqlServer\",\"LinuxAgent.SqlServer\")\r\n| project\r\nid,\r\nESU = iff(notnull(properties.settings.enableExtendedSecurityUpdates), iff(properties.settings.enableExtendedSecurityUpdates == true,\"Enabled\",\"Disabled\"), \"Disabled\"),\r\nPurview = iff(notnull(properties.settings.ExternalPolicyBasedAuthorization),\"Enabled\",\"Disabled\"),\r\nEntra = iff(notnull(properties.settings.AzureAD),\"Enabled\",\"Disabled\"),\r\nBPA = iff(notnull(properties.settings.AssessmentSettings),\"Enabled\",\"Disabled\"),\r\nAutomaticUpdate = iff(properties.settings.MicrosoftUpdateConfiguration.EnableMicrosoftUpdate == true, \"Enabled\", \"Disabled\")\r\n| order by id asc", - "usedParameters": [] + "position": { + "x": 11, + "y": 0, + "colSpan": 6, + "rowSpan": 7 }, - "visualization": { - "type": "table", - "options": { - "hideTileTitle": false, - "table__enableFormatting": true, - "table__enableRenderLinks": true, - "table__renderLinksForColumns": [], - "colorRules": [], - "colorRulesDisabled": true, - "colorStyle": "light", - "crossFilter": [], - "crossFilterDisabled": false, - "drillthrough": [], - "drillthroughDisabled": false + "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.azurearcdata/sqlserverinstances\"\n| project \nid, \nMigrationAssessment = iif(properties.migration.assessment.enabled == 'true', 'Enabled', 'Disabled')\n| summarize count(id) by MigrationAssessment", + "isOptional": true + }, + { + "name": "chartType", + "value": 2, + "isOptional": true + }, + { + "name": "queryScope", + "value": { + "scope": 0, + "values": [] + }, + "isOptional": true + } + ], + "type": "Extension/HubsExtension/PartType/ArgQueryChartTile", + "settings": {}, + "partHeader": { + "title": "Migration assessment", + "subtitle": "" } + } + }, + { + "position": { + "x": 17, + "y": 0, + "colSpan": 6, + "rowSpan": 7 }, - "title": "SQL Server extension feature status", - "subtitle": "Shows the enabled and disabled state of each feature configured at the SQL Server extension level", - "type": "QueryTile", - "layout": { + "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.azurearcdata/sqlserverinstances\"\n| project \nid, \nMonitoring = iif(properties.monitoring.enabled == 'true', 'Enabled', 'Disabled')\n| summarize count(id) by Monitoring", + "isOptional": true + }, + { + "name": "chartType", + "value": 2, + "isOptional": true + }, + { + "name": "queryScope", + "value": { + "scope": 0, + "values": [] + }, + "isOptional": true + } + ], + "type": "Extension/HubsExtension/PartType/ArgQueryChartTile", + "settings": {}, + "partHeader": { + "title": "Monitoring dashboards", + "subtitle": "" + } + } + }, + { + "position": { + "x": 23, + "y": 0, + "colSpan": 6, + "rowSpan": 7 + }, + "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.azurearcdata/sqlserverinstances\"\n| project \nid, \nBackupEnabled = iif(isempty(properties.backupPolicy.retentionPeriodDays),'Disabled', iif(properties.backupPolicy.retentionPeriodDays == 0,'Disabled','Enabled'))\n| summarize count(id) by BackupEnabled", + "isOptional": true + }, + { + "name": "chartType", + "value": 2, + "isOptional": true + }, + { + "name": "queryScope", + "value": { + "scope": 0, + "values": [] + }, + "isOptional": true + } + ], + "type": "Extension/HubsExtension/PartType/ArgQueryChartTile", + "settings": {}, + "partHeader": { + "title": "Backups", + "subtitle": "" + } + } + }, + { + "position": { "x": 0, - "y": 4, - "width": 8, - "height": 4 + "y": 7, + "colSpan": 11, + "rowSpan": 14 + }, + "metadata": { + "inputs": [ + { + "name": "chartType", + "isOptional": true + }, + { + "name": "isShared", + "isOptional": true + }, + { + "name": "queryId", + "isOptional": true + }, + { + "name": "formatResults", + "isOptional": true + }, + { + "name": "partTitle", + "value": "Query 1", + "isOptional": true + }, + { + "name": "queryScope", + "value": { + "scope": 0, + "values": [] + }, + "isOptional": true + }, + { + "name": "query", + "value": "resources\r\n| where type == \"microsoft.hybridcompute/machines/extensions\"\r\n| where properties.type in (\"WindowsAgent.SqlServer\",\"LinuxAgent.SqlServer\")\r\n| project\r\nid,\r\nESU = iff(notnull(properties.settings.enableExtendedSecurityUpdates), iff(properties.settings.enableExtendedSecurityUpdates == true,\"ENABLED\",\"disabled\"), \"disabled\"),\r\nPurview = iff(notnull(properties.settings.ExternalPolicyBasedAuthorization),\"ENABLED\",\"disabled\"),\r\nEntra = iff(notnull(properties.settings.AzureAD),\"ENABLED\",\"disabled\"),\r\nBPA = iff(notnull(properties.settings.AssessmentSettings),\"ENABLED\",\"disabled\"),\r\nAutomaticUpdate = iff(properties.settings.MicrosoftUpdateConfiguration.EnableMicrosoftUpdate == true, \"ENABLED\", \"disabled\")\r\n| order by id asc", + "isOptional": true + } + ], + "type": "Extension/HubsExtension/PartType/ArgQueryGridTile", + "settings": {}, + "partHeader": { + "title": "SQL Server extension feature status", + "subtitle": "Shows the enabled and disabled status of each feature at the SQL Server extension level" + } } }, { - "data": { - "kind": "arg", - "query": "resources\r\n| where type == \"microsoft.hybridcompute/machines/extensions\"\r\n| where properties.type in (\"WindowsAgent.SqlServer\",\"LinuxAgent.SqlServer\")\r\n| project id, ESU = iff(notnull(properties.settings.enableExtendedSecurityUpdates), iff(properties.settings.enableExtendedSecurityUpdates == true,\"Enabled\",\"Disabled\"), \"Disabled\")\r\n| summarize count(id) by ESU", - "usedParameters": [] + "position": { + "x": 11, + "y": 7, + "colSpan": 6, + "rowSpan": 7 }, - "visualization": { - "type": "pie", - "options": { - "hideTileTitle": false, - "table__enableFormatting": true, - "table__enableRenderLinks": true, - "table__renderLinksForColumns": [], - "colorRules": [], - "colorRulesDisabled": true, - "colorStyle": "light", - "crossFilter": [], - "crossFilterDisabled": false, - "drillthrough": [], - "drillthroughDisabled": false + "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.hybridcompute/machines/extensions\"\n| where properties.type in (\"WindowsAgent.SqlServer\",\"LinuxAgent.SqlServer\")\n| project id, ESU = iff(notnull(properties.settings.enableExtendedSecurityUpdates), iff(properties.settings.enableExtendedSecurityUpdates == true,\"Enabled\",\"Disabled\"), \"Disabled\")\n| summarize count(id) by ESU\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": "Extended Security Updates", + "subtitle": "" } - }, - "title": "Extended Security Updates", - "subtitle": "", - "type": "QueryTile", - "layout": { - "x": 8, - "y": 4, - "width": 6, - "height": 4 } }, { - "data": { - "kind": "arg", - "query": "resources\r\n| where type == \"microsoft.hybridcompute/machines/extensions\"\r\n| where properties.type in (\"WindowsAgent.SqlServer\",\"LinuxAgent.SqlServer\")\r\n| project id, Purview = iff(notnull(properties.settings.ExternalPolicyBasedAuthorization), iff(properties.settings.enableExtendedSecurityUpdates == true,\"Enabled\",\"Disabled\"), \"Disabled\")\r\n| summarize count(id) by Purview", - "usedParameters": [] + "position": { + "x": 17, + "y": 7, + "colSpan": 6, + "rowSpan": 7 }, - "visualization": { - "type": "pie", - "options": { - "hideTileTitle": false, - "table__enableFormatting": true, - "table__enableRenderLinks": true, - "table__renderLinksForColumns": [], - "colorRules": [], - "colorRulesDisabled": true, - "colorStyle": "light", - "crossFilter": [], - "crossFilterDisabled": false, - "drillthrough": [], - "drillthroughDisabled": false + "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.hybridcompute/machines/extensions\"\n| where properties.type in (\"WindowsAgent.SqlServer\",\"LinuxAgent.SqlServer\")\n| project id, AutomaticUpdates = iff(properties.settings.MicrosoftUpdateConfiguration.EnableMicrosoftUpdate == true, \"Enabled\", \"Disabled\")\n| summarize count(id) by AutomaticUpdates", + "isOptional": true + }, + { + "name": "chartType", + "value": 2, + "isOptional": true + }, + { + "name": "queryScope", + "value": { + "scope": 0, + "values": [] + }, + "isOptional": true + } + ], + "type": "Extension/HubsExtension/PartType/ArgQueryChartTile", + "settings": {}, + "partHeader": { + "title": "Automatic Updates", + "subtitle": "" } - }, - "title": "Purview", - "subtitle": "", - "type": "QueryTile", - "layout": { - "x": 14, - "y": 4, - "width": 6, - "height": 4 } }, { - "data": { - "kind": "arg", - "query": "resources\r\n| where type == \"microsoft.hybridcompute/machines/extensions\"\r\n| where properties.type in (\"WindowsAgent.SqlServer\",\"LinuxAgent.SqlServer\")\r\n| project id, Entra = iff(notnull(properties.settings.AzureAD), iff(properties.settings.enableExtendedSecurityUpdates == true,\"Enabled\",\"Disabled\"), \"Disabled\")\r\n| summarize count(id) by Entra", - "usedParameters": [] + "position": { + "x": 23, + "y": 7, + "colSpan": 6, + "rowSpan": 7 }, - "visualization": { - "type": "pie", - "options": { - "hideTileTitle": false, - "table__enableFormatting": true, - "table__enableRenderLinks": true, - "table__renderLinksForColumns": [], - "colorRules": [], - "colorRulesDisabled": true, - "colorStyle": "light", - "crossFilter": [], - "crossFilterDisabled": false, - "drillthrough": [], - "drillthroughDisabled": false + "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.hybridcompute/machines/extensions\"\n| where properties.type in (\"WindowsAgent.SqlServer\",\"LinuxAgent.SqlServer\")\n| project id, Purview = iff(notnull(properties.settings.ExternalPolicyBasedAuthorization), iff(properties.settings.enableExtendedSecurityUpdates == true,\"Enabled\",\"Disabled\"), \"Disabled\")\n| summarize count(id) by Purview", + "isOptional": true + }, + { + "name": "chartType", + "value": 2, + "isOptional": true + }, + { + "name": "queryScope", + "value": { + "scope": 0, + "values": [] + }, + "isOptional": true + } + ], + "type": "Extension/HubsExtension/PartType/ArgQueryChartTile", + "settings": {}, + "partHeader": { + "title": "Purview", + "subtitle": "" } - }, - "title": "Entra ID authentication", - "subtitle": "", - "type": "QueryTile", - "layout": { - "x": 8, - "y": 8, - "width": 6, - "height": 4 } }, { - "data": { - "kind": "arg", - "query": "resources\r\n| where type == \"microsoft.hybridcompute/machines/extensions\"\r\n| where properties.type in (\"WindowsAgent.SqlServer\",\"LinuxAgent.SqlServer\")\r\n| project id, BPA = iff(notnull(properties.settings.AssessmentSettings), iff(properties.settings.enableExtendedSecurityUpdates == true,\"Enabled\",\"Disabled\"), \"Disabled\")\r\n| summarize count(id) by BPA", - "usedParameters": [] + "position": { + "x": 11, + "y": 14, + "colSpan": 6, + "rowSpan": 7 }, - "visualization": { - "type": "pie", - "options": { - "hideTileTitle": false, - "table__enableFormatting": true, - "table__enableRenderLinks": true, - "table__renderLinksForColumns": [], - "colorRules": [], - "colorRulesDisabled": true, - "colorStyle": "light", - "crossFilter": [], - "crossFilterDisabled": false, - "drillthrough": [], - "drillthroughDisabled": false + "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.hybridcompute/machines/extensions\"\n| where properties.type in (\"WindowsAgent.SqlServer\",\"LinuxAgent.SqlServer\")\n| project id, Entra = iff(notnull(properties.settings.AzureAD), iff(properties.settings.enableExtendedSecurityUpdates == true,\"Enabled\",\"Disabled\"), \"Disabled\")\n| summarize count(id) by Entra", + "isOptional": true + }, + { + "name": "chartType", + "value": 2, + "isOptional": true + }, + { + "name": "queryScope", + "value": { + "scope": 0, + "values": [] + }, + "isOptional": true + } + ], + "type": "Extension/HubsExtension/PartType/ArgQueryChartTile", + "settings": {}, + "partHeader": { + "title": "Entra ID authentication", + "subtitle": "" } - }, - "title": "Best practices assessment", - "subtitle": "", - "type": "QueryTile", - "layout": { - "x": 14, - "y": 8, - "width": 6, - "height": 4 } }, { - "data": { - "kind": "arg", - "query": "resources\r\n| where type == \"microsoft.hybridcompute/machines/extensions\"\r\n| where properties.type in (\"WindowsAgent.SqlServer\",\"LinuxAgent.SqlServer\")\r\n| project id, AutomaticUpdates = iff(properties.settings.MicrosoftUpdateConfiguration.EnableMicrosoftUpdate == true, \"Enabled\", \"Disabled\")\r\n| summarize count(id) by AutomaticUpdates", - "usedParameters": [] + "position": { + "x": 17, + "y": 14, + "colSpan": 6, + "rowSpan": 7 }, - "visualization": { - "type": "pie", - "options": { - "hideTileTitle": false, - "table__enableFormatting": true, - "table__enableRenderLinks": true, - "table__renderLinksForColumns": [], - "colorRules": [], - "colorRulesDisabled": true, - "colorStyle": "light", - "crossFilter": [], - "crossFilterDisabled": false, - "drillthrough": [], - "drillthroughDisabled": false + "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.hybridcompute/machines/extensions\"\n| where properties.type in (\"WindowsAgent.SqlServer\",\"LinuxAgent.SqlServer\")\n| project id, BPA = iff(notnull(properties.settings.AssessmentSettings), iff(properties.settings.enableExtendedSecurityUpdates == true,\"Enabled\",\"Disabled\"), \"Disabled\")\n| summarize count(id) by BPA", + "isOptional": true + }, + { + "name": "chartType", + "value": 2, + "isOptional": true + }, + { + "name": "queryScope", + "value": { + "scope": 0, + "values": [] + }, + "isOptional": true + } + ], + "type": "Extension/HubsExtension/PartType/ArgQueryChartTile", + "settings": {}, + "partHeader": { + "title": "Best practices assessment", + "subtitle": "" } - }, - "title": "Automatic Updates", - "subtitle": "", - "type": "QueryTile", - "layout": { - "x": 20, - "y": 4, - "width": 6, - "height": 4 - } - }, - { - "data": { - "kind": "arg", - "query": "resources\r\n| where type == \"microsoft.azurearcdata/sqlserverinstances\"\r\n| project \r\nid, \r\nMigrationAssessment = iif(properties.migration.assessment.enabled == 'true', 'Enabled', 'Disabled')\r\n| summarize count(id) by MigrationAssessment", - "usedParameters": [] - }, - "visualization": { - "type": "pie", - "options": { - "hideTileTitle": false, - "table__enableFormatting": true, - "table__enableRenderLinks": true, - "table__renderLinksForColumns": [], - "colorRules": [], - "colorRulesDisabled": true, - "colorStyle": "light", - "crossFilter": [], - "crossFilterDisabled": false, - "drillthrough": [], - "drillthroughDisabled": false - } - }, - "title": "Migration assessment", - "subtitle": "", - "type": "QueryTile", - "layout": { - "x": 8, - "y": 0, - "width": 6, - "height": 4 - } - }, - { - "data": { - "kind": "arg", - "query": "resources\r\n| where type == \"microsoft.azurearcdata/sqlserverinstances\"\r\n| project \r\nid, \r\nMonitoring = iif(properties.monitoring.enabled == 'true', 'Enabled', 'Disabled')\r\n| summarize count(id) by Monitoring", - "usedParameters": [] - }, - "visualization": { - "type": "pie", - "options": { - "hideTileTitle": false, - "table__enableFormatting": true, - "table__enableRenderLinks": true, - "table__renderLinksForColumns": [], - "colorRules": [], - "colorRulesDisabled": true, - "colorStyle": "light", - "crossFilter": [], - "crossFilterDisabled": false, - "drillthrough": [], - "drillthroughDisabled": false - } - }, - "title": "Monitoring", - "subtitle": "", - "type": "QueryTile", - "layout": { - "x": 14, - "y": 0, - "width": 6, - "height": 4 - } - }, - { - "data": { - "kind": "arg", - "query": "resources\r\n| where type == \"microsoft.azurearcdata/sqlserverinstances\"\r\n| project \r\nid, \r\nBackupEnabled = iif(isempty(properties.backupPolicy.retentionPeriodDays),'Disabled', iif(properties.backupPolicy.retentionPeriodDays == 0,'Disabled','Enabled'))\r\n| summarize count(id) by BackupEnabled", - "usedParameters": [] - }, - "visualization": { - "type": "pie", - "options": { - "hideTileTitle": false, - "table__enableFormatting": true, - "table__enableRenderLinks": true, - "table__renderLinksForColumns": [], - "colorRules": [], - "colorRulesDisabled": true, - "colorStyle": "light", - "crossFilter": [], - "crossFilterDisabled": false, - "drillthrough": [], - "drillthroughDisabled": false - } - }, - "title": "Backups", - "subtitle": "", - "type": "QueryTile", - "layout": { - "x": 20, - "y": 0, - "width": 6, - "height": 4 } } ] } ], - "parameters": [], - "provisioningState": "Succeeded" - } + "metadata": { + "model": { + "timeRange": { + "value": { + "relative": { + "duration": 24, + "timeUnit": 1 + } + }, + "type": "MsPortalFx.Composition.Configuration.ValueTypes.TimeRange" + } + } + } + }, + "name": "Arc-enabled SQL Server Features", + "type": "Microsoft.Portal/dashboards", + "location": "INSERT LOCATION", + "tags": { + "hidden-title": "Arc-enabled SQL Server Features" + }, + "apiVersion": "2022-12-01-preview" } \ No newline at end of file diff --git a/samples/features/azure-arc/dashboard/Arc-enabled SQL Server Health.json b/samples/features/azure-arc/dashboard/Arc-enabled SQL Server Health.json new file mode 100644 index 00000000..bbb053cc --- /dev/null +++ b/samples/features/azure-arc/dashboard/Arc-enabled SQL Server Health.json @@ -0,0 +1,83 @@ +{ + "properties": { + "lenses": [ + { + "order": 0, + "parts": [ + { + "position": { + "x": 0, + "y": 0, + "colSpan": 20, + "rowSpan": 11 + }, + "metadata": { + "inputs": [ + { + "name": "chartType", + "isOptional": true + }, + { + "name": "isShared", + "isOptional": true + }, + { + "name": "queryId", + "isOptional": true + }, + { + "name": "formatResults", + "isOptional": true + }, + { + "name": "partTitle", + "value": "Query 1", + "isOptional": true + }, + { + "name": "query", + "value": "resources\r\n| where type == \"microsoft.hybridcompute/machines/extensions\" \r\n| where properties.type in (\"WindowsAgent.SqlServer\", \"LinuxAgent.SqlServer\") \r\n| extend targetMachineName = tolower(tostring(split(id, '/')[8])) // Extract the machine name from the extension's id\r\n| join kind=leftouter (\r\n resources\r\n | where type == \"microsoft.hybridcompute/machines\"\r\n | project machineId = id, MachineName = name, subscriptionId, LowerMachineName = tolower(name), resourceGroup , MachineStatus= properties.status , MachineProvisioningStatus= properties.provisioningState, MachineErrors = properties.errorDetails //Project relvant machine health information.\r\n) on $left.targetMachineName == $right.LowerMachineName and $left.resourceGroup == $right.resourceGroup and $left.subscriptionId == $right.subscriptionId // Join Based on MachineName in the id and the machine's name, the resource group, and the subscription. This join allows us to present the data of the machine as well as the extension in the final output.\r\n| extend statusExpirationLengthRange = 3d // Change this value to change the acceptable range for the last time an extension should have reported its status.\r\n| extend startDate = startofday(now() - statusExpirationLengthRange), endDate = startofday(now()) // Get the start and end positon for the given range.\r\n| extend extractedDateString = extract(\"timestampUTC : (\\\\d{4}\\\\W\\\\d{2}\\\\W\\\\d{2})\", 1, tostring(properties.instanceView.status.message)) // Extracting the date string for the LastUploadTimestamp. Is empty if none is found.\r\n| extend extractedDateStringYear = split(extractedDateString, '/')[0], extractedDateStringMonth = split(extractedDateString, '/')[1], extractedDateStringDay = split(extractedDateString, '/')[2] // Identifying each of the parts of the date that was extracted from the message.\r\n| extend extractedDate = todatetime(strcat(extractedDateStringYear,\"-\",extractedDateStringMonth,\"-\",extractedDateStringDay,\"T00:00:00Z\")) // Converting to a datetime object and rewriting string into ISO format because todatetime() does not work using the previous format.\r\n| extend isNotInDateRange = not(extractedDate >= startDate and extractedDate <= endDate) // Created bool which is true if the date we extracted from the message is not within the specified range. This bool will also be true if the date was not found in the message.\r\n| where properties.instanceView.status.message !contains \"SQL Server Extension Agent: Healthy\" // Begin searching for unhealthy extensions using the following 1. Does extension report being healthy. 2. Is last upload within the given range. 3. Is the upload status in an OK state. 4. Is provisioning state not in a succeeded state.\r\n or isNotInDateRange\r\n or properties.instanceView.status.message !contains \"uploadStatus : OK\"\r\n or properties.provisioningState != \"Succeeded\"\r\n or MachineStatus != \"Connected\"\r\n| extend FailureReasons = strcat( // Makes a String to list all the reason that this resource got flagged for\r\n iif(MachineStatus != \"Connected\",strcat(\"- Machine's status is \", MachineStatus,\" -\"),\"\") ,\r\n iif(MachineErrors != \"[]\",\"- Machine reports errors -\", \"\"),\r\n iif(properties.instanceView.status.message !contains \"SQL Server Extension Agent: Healthy\",\"- Extension reported unhealthy -\",\"\"), \r\n iif(isNotInDateRange,\"- Last upload outside acceptable range -\",\"\"),\r\n iif(properties.instanceView.status.message !contains \"uploadStatus : OK\",\"- Upload status is not reported OK -\",\"\"), \r\n iif(properties.provisioningState != \"Succeeded\",strcat(\"- Extension provisiong state is \", properties.provisioningState,\" -\"),\"\") \r\n )\r\n| extend RecommendedAction = //Attempt to Identify RootCause based on information gathered, and point customer to what they should investigate first.\r\n iif(MachineStatus == \"Disconnected\", \"Machine is disconnected. Please reconnect the machine.\",\r\n iif(MachineStatus == \"Expired\", \"Machine cert is expired. Go to the machine on the Azure Portal for more information on how to resolve this issue.\",\r\n iif(MachineStatus != \"Connected\", strcat(\"Machine status is \", MachineStatus,\". Investigate and resolve this issue.\"),\r\n iif(MachineProvisioningStatus != \"Succeeded\", strcat(\"Machine provisioning status is \", MachineProvisioningStatus, \". Investigate and resolve machine provisioning status\"),\r\n iff(MachineErrors != \"[]\", \"Machine is reporting errors. Investigate and resolve machine errors\",\r\n iif(properties.provisioningState != \"Succeeded\", strcat(\"Extension provisioning status is \", properties.provisioningState,\". Investigate and resolve extension provisioning state.\"),\r\n iff(properties.instanceView.status.message !contains \"SQL Server Extension Agent:\" and properties.instanceView.status.message contains \"SQL Server Extension Agent Deployer\", \"SQL Server extension eeployer ran. However, SQL Server extension seems to not be running. Verify that the extension is currently running.\",\r\n iff(properties.instanceView.status.message !contains \"uploadStatus : OK\" or isNotInDateRange or properties.instanceView.status.message !contains \"SQL Server Extension Agent: Healthy\", \"Extension reported as unhealthy. View FailureReasons and LastExtensionStatusMessage for more information as to the cause of the failure.\",\r\n \"Unable to reccommend actions. Please view FailureReasons.\"\r\n )\r\n )\r\n )\r\n )\r\n )\r\n )\r\n )\r\n )\r\n| project ID = id, MachineName, ResourceGroup = resourceGroup, SubscriptionID = subscriptionId, Location = location, RecommendedAction, FailureReasons, LicenseType = properties.settings.LicenseType, \r\n LastReportedExtensionHealth = iif(properties.instanceView.status.message !contains \"SQL Server Extension Agent: Healthy\", \"Unhealthy\", \"Healthy\"),\r\n LastExtensionUploadTimestamp = iif(indexof(properties.instanceView.status.message, \"timestampUTC : \") > 0,\r\n substring(properties.instanceView.status.message, indexof(properties.instanceView.status.message, \"timestampUTC : \") + 15, 10),\r\n \"no timestamp\"),\r\n LastExtensionUploadStatus = iif(indexof(properties.instanceView.status.message, \"uploadStatus : OK\") > 0, \"OK\", \"Unhealthy\"),\r\n ExtensionProvisioningState = properties.provisioningState,\r\n MachineStatus, MachineErrors, MachineProvisioningStatus,MachineId = machineId,\r\n LastExtensionStatusMessage = properties.instanceView.status.message", + "isOptional": true + }, + { + "name": "queryScope", + "value": { + "scope": 0, + "values": [] + }, + "isOptional": true + } + ], + "type": "Extension/HubsExtension/PartType/ArgQueryGridTile", + "settings": {}, + "partHeader": { + "title": "Arc-enabled SQL Server Health", + "subtitle": "" + } + } + } + ] + } + ], + "metadata": { + "model": { + "timeRange": { + "value": { + "relative": { + "duration": 24, + "timeUnit": 1 + } + }, + "type": "MsPortalFx.Composition.Configuration.ValueTypes.TimeRange" + } + } + } + }, + "name": "Arc-enabled SQL Server Health", + "type": "Microsoft.Portal/dashboards", + "location": "INSERT LOCATION", + "tags": { + "hidden-title": "Arc-enabled SQL Server Health" + }, + "apiVersion": "2022-12-01-preview" +} \ No newline at end of file diff --git a/samples/features/azure-arc/dashboard/ArcEnabledSQLServerHealth.dx.json b/samples/features/azure-arc/dashboard/ArcEnabledSQLServerHealth.dx.json deleted file mode 100644 index bceaec69..00000000 --- a/samples/features/azure-arc/dashboard/ArcEnabledSQLServerHealth.dx.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "$schema": "<>", - "view": { - "kind": "Dashboard", - "export": true, - "properties": { - "title": "Arc Enabled SQL Server Health", - "pages": [ - { - "title": "New 1", - "tiles": [ - { - "data": { - "kind": "arg", - "query": "resources\r\n| where type == \"microsoft.hybridcompute/machines/extensions\" \r\n| where properties.type in (\"WindowsAgent.SqlServer\", \"LinuxAgent.SqlServer\") \r\n| extend targetMachineName = tolower(tostring(split(id, '/')[8])) // Extract the machine name from the extension's id\r\n| join kind=leftouter (\r\n resources\r\n | where type == \"microsoft.hybridcompute/machines\"\r\n | project machineId = id, MachineName = name, subscriptionId, LowerMachineName = tolower(name), resourceGroup , MachineStatus= properties.status , MachineProvisioningStatus= properties.provisioningState, MachineErrors = properties.errorDetails //Project relvant machine health information.\r\n) on $left.targetMachineName == $right.LowerMachineName and $left.resourceGroup == $right.resourceGroup and $left.subscriptionId == $right.subscriptionId // Join Based on MachineName in the id and the machine's name, the resource group, and the subscription. This join allows us to present the data of the machine as well as the extension in the final output.\r\n| extend statusExpirationLengthRange = 3d // Change this value to change the acceptable range for the last time an extension should have reported its status.\r\n| extend startDate = startofday(now() - statusExpirationLengthRange), endDate = startofday(now()) // Get the start and end positon for the given range.\r\n| extend extractedDateString = extract(\"timestampUTC : (\\\\d{4}\\\\W\\\\d{2}\\\\W\\\\d{2})\", 1, tostring(properties.instanceView.status.message)) // Extracting the date string for the LastUploadTimestamp. Is empty if none is found.\r\n| extend extractedDateStringYear = split(extractedDateString, '/')[0], extractedDateStringMonth = split(extractedDateString, '/')[1], extractedDateStringDay = split(extractedDateString, '/')[2] // Identifying each of the parts of the date that was extracted from the message.\r\n| extend extractedDate = todatetime(strcat(extractedDateStringYear,\"-\",extractedDateStringMonth,\"-\",extractedDateStringDay,\"T00:00:00Z\")) // Converting to a datetime object and rewriting string into ISO format because todatetime() does not work using the previous format.\r\n| extend isNotInDateRange = not(extractedDate >= startDate and extractedDate <= endDate) // Created bool which is true if the date we extracted from the message is not within the specified range. This bool will also be true if the date was not found in the message.\r\n| where properties.instanceView.status.message !contains \"SQL Server Extension Agent: Healthy\" // Begin searching for unhealthy extensions using the following 1. Does extension report being healthy. 2. Is last upload within the given range. 3. Is the upload status in an OK state. 4. Is provisioning state not in a succeeded state.\r\n or isNotInDateRange\r\n or properties.instanceView.status.message !contains \"uploadStatus : OK\"\r\n or properties.provisioningState != \"Succeeded\"\r\n or MachineStatus != \"Connected\"\r\n| extend FailureReasons = strcat( // Makes a String to list all the reason that this resource got flagged for\r\n iif(MachineStatus != \"Connected\",strcat(\"- Machine's status is \", MachineStatus,\" -\"),\"\") ,\r\n iif(MachineErrors != \"[]\",\"- Machine reports errors -\", \"\"),\r\n iif(properties.instanceView.status.message !contains \"SQL Server Extension Agent: Healthy\",\"- Extension reported unhealthy -\",\"\"), \r\n iif(isNotInDateRange,\"- Last upload outside acceptable range -\",\"\"),\r\n iif(properties.instanceView.status.message !contains \"uploadStatus : OK\",\"- Upload status is not reported OK -\",\"\"), \r\n iif(properties.provisioningState != \"Succeeded\",strcat(\"- Extension provisiong state is \", properties.provisioningState,\" -\"),\"\") \r\n )\r\n| extend RecommendedAction = //Attempt to Identify RootCause based on information gathered, and point customer to what they should investigate first.\r\n iif(MachineStatus == \"Disconnected\", \"Machine is disconnected. Please reconnect the machine.\",\r\n iif(MachineStatus == \"Expired\", \"Machine cert is expired. Go to the machine on the Azure Portal for more information on how to resolve this issue.\",\r\n iif(MachineStatus != \"Connected\", strcat(\"Machine status is \", MachineStatus,\". Investigate and resolve this issue.\"),\r\n iif(MachineProvisioningStatus != \"Succeeded\", strcat(\"Machine provisioning status is \", MachineProvisioningStatus, \". Investigate and resolve machine provisioning status\"),\r\n iff(MachineErrors != \"[]\", \"Machine is reporting errors. Investigate and resolve machine errors\",\r\n iif(properties.provisioningState != \"Succeeded\", strcat(\"Extension provisioning status is \", properties.provisioningState,\". Investigate and resolve extension provisioning state.\"),\r\n iff(properties.instanceView.status.message !contains \"SQL Server Extension Agent:\" and properties.instanceView.status.message contains \"SQL Server Extension Agent Deployer\", \"SQL Server extension eeployer ran. However, SQL Server extension seems to not be running. Verify that the extension is currently running.\",\r\n iff(properties.instanceView.status.message !contains \"uploadStatus : OK\" or isNotInDateRange or properties.instanceView.status.message !contains \"SQL Server Extension Agent: Healthy\", \"Extension reported as unhealthy. View FailureReasons and LastExtensionStatusMessage for more information as to the cause of the failure.\",\r\n \"Unable to reccommend actions. Please view FailureReasons.\"\r\n )\r\n )\r\n )\r\n )\r\n )\r\n )\r\n )\r\n )\r\n| project ID = id, MachineName, ResourceGroup = resourceGroup, SubscriptionID = subscriptionId, Location = location, RecommendedAction, FailureReasons, LicenseType = properties.settings.LicenseType, \r\n LastReportedExtensionHealth = iif(properties.instanceView.status.message !contains \"SQL Server Extension Agent: Healthy\", \"Unhealthy\", \"Healthy\"),\r\n LastExtensionUploadTimestamp = iif(indexof(properties.instanceView.status.message, \"timestampUTC : \") > 0,\r\n substring(properties.instanceView.status.message, indexof(properties.instanceView.status.message, \"timestampUTC : \") + 15, 10),\r\n \"no timestamp\"),\r\n LastExtensionUploadStatus = iif(indexof(properties.instanceView.status.message, \"uploadStatus : OK\") > 0, \"OK\", \"Unhealthy\"),\r\n ExtensionProvisioningState = properties.provisioningState,\r\n MachineStatus, MachineErrors, MachineProvisioningStatus,MachineId = machineId,\r\n LastExtensionStatusMessage = properties.instanceView.status.message", - "usedParameters": [] - }, - "visualization": { - "type": "table", - "options": { - "hideTileTitle": false, - "table__enableFormatting": true, - "table__enableRenderLinks": true, - "table__renderLinksForColumns": [], - "colorRules": [], - "colorRulesDisabled": true, - "colorStyle": "light", - "crossFilter": [], - "crossFilterDisabled": false, - "drillthrough": [], - "drillthroughDisabled": false - } - }, - "title": "Arc SQL Server Resource Health", - "subtitle": "Health of Arc SQL Server extension and Arc machine", - "type": "QueryTile", - "layout": { - "x": 0, - "y": 0, - "width": 19, - "height": 11 - } - } - ] - } - ], - "parameters": [], - "provisioningState": "Succeeded" - } - } -} \ No newline at end of file diff --git a/sql-server-samples b/sql-server-samples new file mode 160000 index 00000000..93714685 --- /dev/null +++ b/sql-server-samples @@ -0,0 +1 @@ +Subproject commit 937146858024dd222a3d6754ff321e71442a5c52