Skip to content

Commit a2eacb7

Browse files
Merge pull request #27642 from ingebeumer/patch-2
KQL syntax error, KQL recommended practices, etc.
2 parents 6fcb5c7 + 38f75c0 commit a2eacb7

1 file changed

Lines changed: 28 additions & 28 deletions

File tree

docs/sql-server/azure-arc/view-databases.md

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -24,60 +24,60 @@ Before you begin, verify that the SQL Server instance that hosts the databases:
2424

2525
## Inventory databases
2626

27-
1. Locate the Azure Arc-enabled SQL Server instance in Azure portal
27+
1. Locate the Azure Arc-enabled SQL Server instance in the Azure portal.
2828
1. **Select** the SQL Server resource.
2929
1. Under **Data management**, select **Databases**.
3030

3131
:::image type="content" source="media/view-databases/databases.png" alt-text="Screenshot of Azure portal, SQL Server databases - Azure Arc.":::
3232

33-
Azure portal shows **SQL Server databases - Azure Arc**. Use this area to view the databases that belong to the instance.
33+
The Azure portal shows **SQL Server databases - Azure Arc**. Use this area to view the databases that belong to the instance.
3434

3535
## View database properties
3636

3737
To view database properties for a specific database, select the database on the portal.
3838

39-
After you create, modify, or delete a database, changes are visible in Azure portal within an hour.
39+
After you create, modify, or delete a database, changes are visible in the Azure portal within an hour.
4040

4141
:::image type="content" source="media/view-databases/database-properties.png" alt-text="Screenshot of Azure portal, SQL Server database properties.":::
4242

4343
## How to use Azure Resource Graph to query data
4444

45-
Here are some example scenarios showing how you use [Azure Resource Graph](/azure/governance/resource-graph/overview) to query data that is available with the release of viewing databases for Azure Arc-enabled SQL Server.
45+
Here are some example scenarios showing how you use [Azure Resource Graph](/azure/governance/resource-graph/overview) to query data that is available when viewing Azure Arc-enabled SQL Server databases.
4646

4747
### Scenario 1: Get 10 databases
4848

4949
Get 10 databases and return what properties are available to query:
5050

5151
```kusto
5252
resources
53-
| where type =~ 'Microsoft.AzureArcData/sqlServerInstances/databases'
53+
| where type == 'microsoft.azurearcdata/sqlserverinstances/databases'
5454
| limit 10
5555
```
5656

57-
Many of the most interesting properties to query on are in the `properties` property. To explore the available properties, run this query and then select **See details** on a row. This returns the properties in a json viewer on the right side.
57+
Many of the most interesting properties to query are in the `properties` property. To explore the available properties, run this query and then select **See details** on a row. This returns the properties in a json viewer on the right side.
5858

5959
```kusto
6060
resources
61-
| where type =~ 'Microsoft.AzureArcData/sqlServerInstances/databases'
61+
| where type == 'microsoft.azurearcdata/sqlserverinstances/databases'
6262
| project properties
6363
```
6464

6565
You can navigate the hierarchy of the properties json by using a period in between each level of the properties json.
6666

67-
### Scenario 2: Get all the databases that aren't encrypted
67+
### Scenario 2: Get all the databases that have database option AUTO_CLOSE set to ON
6868

6969
```kusto
70-
resources
71-
| where type =~ 'Microsoft.AzureArcData/sqlServerInstances/databases'
72-
| where properties.databaseOptions.isEncrypted == false
70+
| where (type == 'microsoft.azurearcdata/sqlserverinstances/databases' and properties.databaseOptions.isAutoCloseOn == true)
71+
| extend isAutoCloseOn = properties.databaseOptions.isAutoCloseOn
72+
| project name, isAutoCloseOn
7373
```
7474

7575
### Scenario 3: Obtain the count of databases that are encrypted vs not encrypted
7676

7777
```kusto
7878
resources
79-
| extend isEncrypted =properties.databaseOptions.isEncrypted
80-
| where type contains("microsoft.azurearcdata/sqlserverinstances/databases")
79+
| where type == 'microsoft.azurearcdata/sqlserverinstances/databases'
80+
| extend isEncrypted = properties.databaseOptions.isEncrypted
8181
| summarize count() by tostring(isEncrypted)
8282
| order by ['isEncrypted'] asc
8383
```
@@ -86,9 +86,9 @@ resources
8686

8787
```kusto
8888
resources
89-
| extend isEncrypted =properties.databaseOptions.isEncrypted
90-
| where type contains("microsoft.azurearcdata/sqlserverinstances/databases") and isEncrypted ==false
91-
| project name,isEncrypted
89+
| where (type == 'microsoft.azurearcdata/sqlserverinstances/databases' and properties.databaseOptions.isEncrypted == false)
90+
| extend isEncrypted = properties.databaseOptions.isEncrypted
91+
| project name, isEncrypted
9292
```
9393

9494
### Scenario 5: Get all the databases by region and compatibility level
@@ -97,29 +97,29 @@ This example returns all databases in `westus3` location with compatibility leve
9797

9898
```kusto
9999
resources
100-
| where type =~ 'Microsoft.AzureArcData/sqlServerInstances/databases'
101-
| where location == "westus3"
102-
| where properties.compatibilityLevel == "160"
100+
| where type == 'microsoft.azurearcdata/sqlserverinstances/databases'
101+
| where location == "westus3"
102+
| where properties.compatibilityLevel == "160"
103103
```
104104

105105
### Scenario 6: Show the SQL Server version distribution
106106

107107
```kusto
108108
resources
109-
| extend SQLversion =properties.version
110-
| where type contains("microsoft.azurearcdata/sqlserverinstances")
109+
| where type == 'microsoft.azurearcdata/sqlserverinstances'
110+
| extend SQLversion = properties.version
111111
| summarize count() by tostring(SQLversion)
112112
```
113113

114114
### Scenario 7: SQL Server by version, edition, and license type
115115

116116
```kusto
117117
resources
118-
| extend SQLversion =properties.version
119-
| extend SQLEdition =properties.edition
120-
| extend LicenseType =properties.licenseType
121-
| where type contains("microsoft.azurearcdata/sqlserverinstances")
122-
| project name,SQLversion,SQLEdition,LicenseType
118+
| where type == 'microsoft.azurearcdata/sqlserverinstances'
119+
| extend SQLversion = properties.version
120+
| extend SQLedition = properties.edition
121+
| extend licenseType = properties.licenseType
122+
| project name, SQLversion, SQLedition, licenseType
123123
```
124124

125125
### Scenario 8: Show a count of databases by compatibility
@@ -128,7 +128,7 @@ This example returns the number of databases, ordered by the compatibility level
128128

129129
```kusto
130130
resources
131-
| where type =~ 'Microsoft.AzureArcData/sqlServerInstances/databases'
131+
| where type == 'microsoft.azurearcdata/sqlserverinstances/databases'
132132
| summarize count() by tostring(properties.compatibilityLevel)
133133
| order by properties_compatibilityLevel asc
134134
```
@@ -140,4 +140,4 @@ You can also [create charts and pin them to dashboards](/azure/governance/resour
140140
## Next steps
141141

142142
- [Protect Azure Arc-enabled SQL Server with Microsoft Defender for Cloud](configure-advanced-data-security.md)
143-
- [Configure SQL Assessment | Azure Arc-enabled SQL Server](assess.md)
143+
- [Configure best practices assessment on an Azure Arc-enabled SQL Server instance](assess.md)

0 commit comments

Comments
 (0)