Skip to content

Commit 76ecdcb

Browse files
authored
Merge pull request #178556 from dimitri-furman/dimitri-furman-1
Added known issues
2 parents 9c533e8 + 80d250c commit 76ecdcb

File tree

2 files changed

+58
-40
lines changed

2 files changed

+58
-40
lines changed

articles/azure-monitor/insights/sql-insights-enable.md

Lines changed: 22 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: Enable SQL insights in Azure Monitor
44
ms.topic: conceptual
55
author: bwren
66
ms.author: bwren
7-
ms.date: 03/15/2021
7+
ms.date: 11/5/2021
88
---
99

1010
# Enable SQL insights (preview)
@@ -17,13 +17,12 @@ To learn how to enable SQL Insights, you can also refer to this Data Exposed epi
1717
> [!VIDEO https://channel9.msdn.com/Shows/Data-Exposed/How-to-Set-up-Azure-Monitor-for-SQL-Insights/player?format=ny]
1818
1919
## Create Log Analytics workspace
20-
SQL insights stores its data in one or more [Log Analytics workspaces](../logs/data-platform-logs.md#log-analytics-and-workspaces). Before you can enable SQL Insights, you need to either [create a workspace](../logs/quick-create-workspace.md) or select an existing one. A single workspace can be used with multiple monitoring profiles, but the workspace and profiles must be located in the same Azure region. To enable and access the features in SQL insights, you must have the [Log Analytics contributor role](../logs/manage-access.md) in the workspace.
20+
SQL insights stores its data in one or more [Log Analytics workspaces](../logs/data-platform-logs.md#log-analytics-and-workspaces). Before you can enable SQL Insights, you need to either [create a workspace](../logs/quick-create-workspace.md) or select an existing one. A single workspace can be used with multiple monitoring profiles, but the workspace and profiles must be located in the same Azure region. To enable and access the features in SQL insights, you must have the [Log Analytics contributor role](../logs/manage-access.md) in the workspace.
2121

2222
## Create monitoring user
23-
You need a user on the SQL deployments that you want to monitor. Follow the procedures below for different types of SQL deployments.
24-
25-
The instructions below cover the process per type of SQL that you can monitor. To accomplish this with a script on several SQL resouces at once, please refer to the following [README file](https://github.com/microsoft/Application-Insights-Workbooks/blob/master/Workbooks/Workloads/SQL/SQL%20Insights%20Onboarding%20Scripts/Permissions_LoginUser_Account_Creation-README.txt) and [example script](https://github.com/microsoft/Application-Insights-Workbooks/blob/master/Workbooks/Workloads/SQL/SQL%20Insights%20Onboarding%20Scripts/Permissions_LoginUser_Account_Creation.ps1).
23+
You need a user (login) on the SQL deployments that you want to monitor. Follow the procedures below for different types of SQL deployments.
2624

25+
The instructions below cover the process per type of SQL that you can monitor. To accomplish this with a script on several SQL resources at once, please refer to the following [README file](https://github.com/microsoft/Application-Insights-Workbooks/blob/master/Workbooks/Workloads/SQL/SQL%20Insights%20Onboarding%20Scripts/Permissions_LoginUser_Account_Creation-README.txt) and [example script](https://github.com/microsoft/Application-Insights-Workbooks/blob/master/Workbooks/Workloads/SQL/SQL%20Insights%20Onboarding%20Scripts/Permissions_LoginUser_Account_Creation.ps1).
2726

2827
### Azure SQL Database
2928

@@ -33,11 +32,11 @@ The instructions below cover the process per type of SQL that you can monitor.
3332
> - **Low service tiers**: Metrics cannot be gathered for databases on Basic, S0, S1, and S2 [service tiers](../../azure-sql/database/resource-limits-dtu-single-databases.md)
3433
>
3534
> SQL insights has limited support for the following Azure SQL Database scenarios:
36-
> - **Serverless tier**: Metrics can be gathered for databases using the [serverless compute tier](../../azure-sql/database/serverless-tier-overview.md). However, the process of gathering metrics will reset the auto-pause delay timer, preventing the database from entering an auto-paused state
35+
> - **Serverless tier**: Metrics can be gathered for databases using the [serverless compute tier](../../azure-sql/database/serverless-tier-overview.md). However, the process of gathering metrics will reset the auto-pause delay timer, preventing the database from entering an auto-paused state.
3736
38-
Open Azure SQL Database with [SQL Server Management Studio](../../azure-sql/database/connect-query-ssms.md) or [Query Editor (preview)](../../azure-sql/database/connect-query-portal.md) in the Azure portal.
37+
Connect to an Azure SQL database with [SQL Server Management Studio](../../azure-sql/database/connect-query-ssms.md), [Query Editor (preview)](../../azure-sql/database/connect-query-portal.md) in the Azure portal, or any other SQL client tool.
3938

40-
Run the following script to create a user with the required permissions. Replace *user* with a username and *mystrongpassword* with a password.
39+
Run the following script to create a user with the required permissions. Replace *user* with a username and *mystrongpassword* with a strong password.
4140

4241
```sql
4342
CREATE USER [user] WITH PASSWORD = N'mystrongpassword';
@@ -65,7 +64,7 @@ order by username
6564
```
6665

6766
### Azure SQL Managed Instance
68-
Log into your Azure SQL Managed Instance and use [SQL Server Management Studio](../../azure-sql/database/connect-query-ssms.md) or similar tool to run the following script to create the monitoring user with the permissions needed. Replace *user* with a username and *mystrongpassword* with a password.
67+
Connect to your Azure SQL Managed Instance using [SQL Server Management Studio](../../azure-sql/database/connect-query-ssms.md) or a similar tool, and execute the following script to create the monitoring user with the permissions needed. Replace *user* with a username and *mystrongpassword* with a strong password.
6968

7069

7170
```sql
@@ -80,8 +79,7 @@ GO
8079
```
8180

8281
### SQL Server
83-
Log into your Azure virtual machine running SQL Server and use [SQL Server Management Studio](../../azure-sql/database/connect-query-ssms.md) or similar tool to run the following script to create the monitoring user with the permissions needed. Replace *user* with a username and *mystrongpassword* with a password.
84-
82+
Connect to SQL Server on your Azure virtual machine and use [SQL Server Management Studio](../../azure-sql/database/connect-query-ssms.md) or a similar tool to run the following script to create the monitoring user with the permissions needed. Replace *user* with a username and *mystrongpassword* with a strong password.
8583

8684
```sql
8785
USE master;
@@ -117,46 +115,46 @@ You will need to create one or more Azure virtual machines that will be used to
117115
The Azure virtual machines has the following requirements.
118116

119117
- Operating system: Ubuntu 18.04
120-
- Recommended Azure virtual machine sizes: Standard_B2s (2 cpus, 4 GiB memory)
118+
- Recommended minimum Azure virtual machine sizes: Standard_B2s (2 cpus, 4 GiB memory)
121119
- Supported regions: Any [region supported by the Azure Monitor agent](../agents/azure-monitor-agent-overview.md#supported-regions)
122120

123121
> [!NOTE]
124122
> The Standard_B2s (2 cpus, 4 GiB memory) virtual machine size will support up to 100 connection strings. You shouldn't allocate more than 100 connections to a single virtual machine.
125123
126-
Depending upon the network settings of your SQL resources, the virtual machines may need to be placed in the same virtual network as your SQL resources so they can make network connections to collect monitoring data.
124+
Depending upon the network settings of your SQL resources, the virtual machines may need to be placed in the same virtual network as your SQL resources so they can make network connections to collect monitoring data.
127125

128126
## Configure network settings
129-
Each type of SQL offers methods for your monitoring virtual machine to securely access SQL. The sections below cover the options based upon the type of SQL.
127+
Each type of SQL offers methods for your monitoring virtual machine to securely access SQL. The sections below cover the options based upon the SQL deployment type.
130128

131129
### Azure SQL Database
132130

133-
SQL insights supports accessing your Azure SQL Database via it's public endpoint as well as from it's virtual network.
131+
SQL Insights supports accessing your Azure SQL Database via its public endpoint as well as from its virtual network.
134132

135-
For access via the public endpoint, you would add a rule under the **Firewall settings** page and the [IP firewall settings](../../azure-sql/database/network-access-controls-overview.md#ip-firewall-rules) section. For specifying access from a virtual network, you can set [virtual network firewall rules](../../azure-sql/database/network-access-controls-overview.md#virtual-network-firewall-rules) and set the [service tags required by the Azure Monitor agent](../agents/azure-monitor-agent-overview.md#networking). [This article](../../azure-sql/database/network-access-controls-overview.md#ip-vs-virtual-network-firewall-rules) describes the differences between these two types of firewall rules.
133+
For access via the public endpoint, you would add a rule under the **Firewall settings** page and the [IP firewall settings](../../azure-sql/database/network-access-controls-overview.md#ip-firewall-rules) section. For specifying access from a virtual network, you can set [virtual network firewall rules](../../azure-sql/database/network-access-controls-overview.md#virtual-network-firewall-rules) and set the [service tags required by the Azure Monitor agent](../agents/azure-monitor-agent-overview.md#networking). [This article](../../azure-sql/database/network-access-controls-overview.md#ip-vs-virtual-network-firewall-rules) describes the differences between these two types of firewall rules.
136134

137135
:::image type="content" source="media/sql-insights-enable/set-server-firewall.png" alt-text="Set server firewall" lightbox="media/sql-insights-enable/set-server-firewall.png":::
138136

139137
:::image type="content" source="media/sql-insights-enable/firewall-settings.png" alt-text="Firewall settings." lightbox="media/sql-insights-enable/firewall-settings.png":::
140138

141-
142139
### Azure SQL Managed Instance
143140

144141
If your monitoring virtual machine will be in the same VNet as your SQL MI resources, then see [Connect inside the same VNet](../../azure-sql/managed-instance/connect-application-instance.md#connect-inside-the-same-vnet). If your monitoring virtual machine will be in the different VNet than your SQL MI resources, then see [Connect inside a different VNet](../../azure-sql/managed-instance/connect-application-instance.md#connect-inside-a-different-vnet).
145142

146-
147143
### SQL Server
148144
If your monitoring virtual machine is in the same VNet as your SQL virtual machine resources, then see [Connect to SQL Server within a virtual network](../../azure-sql/virtual-machines/windows/ways-to-connect-to-sql.md#connect-to-sql-server-within-a-virtual-network). If your monitoring virtual machine will be in the different VNet than your SQL virtual machine resources, then see [Connect to SQL Server over the internet](../../azure-sql/virtual-machines/windows/ways-to-connect-to-sql.md#connect-to-sql-server-over-the-internet).
149145

150146
## Store monitoring password in Key Vault
151-
You should store your SQL user connection passwords in a Key Vault rather than entering them directly into your monitoring profile connection strings.
147+
As a security best practice, we strongly recommend that you store your SQL user (login) passwords in a Key Vault, rather than entering them directly into your monitoring profile connection strings.
152148

153149
When settings up your profile for SQL monitoring, you will need one of the following permissions on the Key Vault resource you intend to use:
154150

155151
- Microsoft.Authorization/roleAssignments/write
156-
- Microsoft.Authorization/roleAssignments/delete permissions such as User Access Administrator or Owner
152+
- Microsoft.Authorization/roleAssignments/delete
157153

158-
A new access policy will be automatically created as part of creating your SQL Monitoring profile that uses the Key Vault you specified. Use *Allow access from All networks* for Key Vault Networking settings.
154+
If you have these permissions, a new Key Vault access policy will be automatically created as part of creating your SQL Monitoring profile that uses the Key Vault you specified.
159155

156+
> [!IMPORTANT]
157+
> You need to ensure that network and security configuration allows the monitoring VM to access Key Vault. For more information, see [Access Azure Key Vault behind a firewall](/key-vault/general/access-behind-firewall.md) and [Configure Azure Key Vault networking settings](/key-vault/general/how-to-azure-key-vault-network-security.md).
160158
161159
## Create SQL monitoring profile
162160
Open SQL insights by selecting **SQL (preview)** from the **Insights** section of the **Azure Monitor** menu in the Azure portal. Click **Create new profile**.
@@ -181,22 +179,19 @@ The profile is stored as a [data collection rule](../agents/data-collection-rule
181179
> [!NOTE]
182180
> The location of the profile should be in the same location as the Log Analytics workspace you plan to send the monitoring data to.
183181
184-
185182
:::image type="content" source="media/sql-insights-enable/profile-details.png" alt-text="Profile details." lightbox="media/sql-insights-enable/profile-details.png":::
186183

187184
Click **Create monitoring profile** once you've entered the details for your monitoring profile. It can take up to a minute for the profile to be deployed. If you don't see the new profile listed in **Monitoring profile** combo box, click the refresh button and it should appear once the deployment is completed. Once you've selected the new profile, select the **Manage profile** tab to add a monitoring machine that will be associated with the profile.
188185

189186
### Add monitoring machine
190187
Select **Add monitoring machine** to open a context panel to choose the virtual machine to setup to monitor your SQL instances and provide the connection strings.
191188

192-
Select the subscription and name of your monitoring virtual machine. If you're using Key Vault to store your password for the monitoring user, select the Key Vault resources with these secrets and enter the URL and secret name to be used in the connection strings. See the next section for details on identifying the connection string for different SQL deployments.
193-
189+
Select the subscription and name of your monitoring virtual machine. If you're using Key Vault to store your password for the monitoring user, select the Key Vault resources with these secrets and enter the URI and secret name for the password to be used in the connection strings. See the next section for details on identifying the connection string for different SQL deployments.
194190

195191
:::image type="content" source="media/sql-insights-enable/add-monitoring-machine.png" alt-text="Add monitoring machine." lightbox="media/sql-insights-enable/add-monitoring-machine.png":::
196192

197-
198193
### Add connection strings
199-
The connection string specifies the username that SQL insights should use when logging into SQL to run the Dynamic Management Views. If you're using a Key Vault to store the password for your monitoring user, provide the URL and name of the secret to use.
194+
The connection string specifies the login name that SQL insights should use when logging into SQL to collect monitoring data. If you're using a Key Vault to store the password for your monitoring user, provide the Key Vault URI and name of the secret that contains the password.
200195

201196
The connections string will vary for each type of SQL resource:
202197

@@ -228,7 +223,7 @@ Get the details from the **Connection strings** menu item for the managed instan
228223

229224
:::image type="content" source="media/sql-insights-enable/connection-string-sql-managed-instance.png" alt-text="SQL Managed Instance connection string" lightbox="media/sql-insights-enable/connection-string-sql-managed-instance.png":::
230225

231-
To monitor a readable secondary, include the key-value `ApplicationIntent=ReadOnly` in the connection string. SQL Insights supports monitoring of a single secondary and the collected data will be tagged to reflect Primary or Secondary.
226+
To monitor a readable secondary, include the key-value `ApplicationIntent=ReadOnly` in the connection string. SQL Insights supports monitoring of a single secondary. Collected data will be tagged to reflect Primary or Secondary.
232227

233228
#### SQL Server
234229
Enter the connection string in the form:

0 commit comments

Comments
 (0)