You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -24,7 +25,7 @@ Microsoft Defender for SQL is a Defender plan in Microsoft Defender for Cloud. M
24
25
Microsoft Defender for SQL provides a set of advanced SQL security capabilities, including SQL Vulnerability Assessment and Advanced Threat Protection.
25
26
26
27
-[Vulnerability Assessment](/azure/defender-for-cloud/sql-azure-vulnerability-assessment-overview) is an easy-to-configure service that can discover, track, and help you remediate potential database vulnerabilities. It provides visibility into your security state, and it includes actionable steps to resolve security issues and enhance your database fortifications.
27
-
-[Advanced Threat Protection](threat-detection-overview.md) detects anomalous activities indicating unusual and potentially harmful attempts to access or exploit your database. It continuously monitors your database for suspicious activities, and it provides immediate security alerts on potential vulnerabilities, Azure SQL injection attacks, and anomalous database access patterns. Advanced Threat Protection alerts provide details of the suspicious activity and recommend action on how to investigate and mitigate the threat.
28
+
-[SQL Advanced Threat Protection](threat-detection-overview.md) detects anomalous activities indicating unusual and potentially harmful attempts to access or exploit your database. It continuously monitors your database for suspicious activities, and it provides immediate security alerts on potential vulnerabilities, Azure SQL injection attacks, and anomalous database access patterns. Advanced Threat Protection alerts provide details of the suspicious activity and recommend action on how to investigate and mitigate the threat.
28
29
29
30
Enable Microsoft Defender for SQL once to enable all these included features. With one select, you can enable Microsoft Defender for all databases on your [server](logical-servers.md) in Azure or in your SQL Managed Instance. Enabling or managing Microsoft Defender for SQL settings requires belonging to the [SQL security manager](/azure/role-based-access-control/built-in-roles#sql-security-manager) role, or one of the database or server admin roles.
30
31
@@ -98,8 +99,8 @@ To view and manage Microsoft Defender for SQL settings:
98
99
99
100
1. Make the necessary changes and select **Save**.
100
101
101
-
## Next steps
102
+
## Related content
102
103
103
-
-Learn more about [Vulnerability Assessment](/azure/defender-for-cloud/sql-azure-vulnerability-assessment-overview)
104
-
-Learn more about [Advanced Threat Protection](threat-detection-configure.md)
105
-
-Learn more about [Microsoft Defender for Cloud](/azure/defender-for-cloud/defender-for-cloud-introduction)
Application requests to Azure SQL Database must be authenticated. Although there are multiple options for authenticating to Azure SQL Database, you should prioritize passwordless connections in your applications when possible. Traditional authentication methods that use passwords or secret keys create security risks and complications. Visit the [passwordless connections for Azure services](/azure/developer/intro/passwordless-overview) hub to learn more about the advantages of moving to passwordless connections.
@@ -48,7 +52,7 @@ Create a user in Azure SQL Database. The user should correspond to the Azure acc
48
52
AZURE_SQL_PORT=1433
49
53
```
50
54
51
-
2. Existing application code that connects to Azure SQL Database using the [Node.js SQL Driver - tedious](/sql/connect/node-js/node-js-driver-for-sql-server) continues to work with passwordless connections with minor changes. To use a **user-assigned** managed identity, pass the `authentication.type` and `options.clientId` properties.
55
+
1. Existing application code that connects to Azure SQL Database using the [Node.js SQL Driver - tedious](/sql/connect/node-js/node-js-driver-for-sql-server) continues to work with passwordless connections with minor changes. To use a **user-assigned** managed identity, pass the `authentication.type` and `options.clientId` properties.
52
56
53
57
```nodejs
54
58
import sql from 'mssql';
@@ -77,12 +81,12 @@ Create a user in Azure SQL Database. The user should correspond to the Azure acc
const result = await databaseClient.executeQuery(`select * from mytable where id = 10`);
121
125
```
@@ -124,7 +128,7 @@ Create a user in Azure SQL Database. The user should correspond to the Azure acc
124
128
125
129
### Test the app
126
130
127
-
Run your app locally and verify that the connections to Azure SQL Database are working as expected. Keep in mind that it may take several minutes for changes to Azure users and roles to propagate through your Azure environment. Your application is now configured to run locally without developers having to manage secrets in the application itself.
131
+
Run your app locally and verify that the connections to Azure SQL Database are working as expected. Keep in mind that it can take several minutes for changes to Azure users and roles to propagate through your Azure environment. Your application is now configured to run locally without developers having to manage secrets in the application itself.
128
132
129
133
## Configure the Azure hosting environment
130
134
@@ -146,25 +150,25 @@ Configure your web app to use the user-assigned managed identity you created.
146
150
147
151
Complete the following steps in the Azure portal to associate the user-assigned managed identity with your app. These same steps apply to the following Azure services:
148
152
149
-
* Azure Spring Apps
150
-
* Azure Container Apps
151
-
* Azure virtual machines
152
-
* Azure Kubernetes Service
153
-
* Navigate to the overview page of your web app.
153
+
- Azure Spring Apps
154
+
- Azure Container Apps
155
+
- Azure virtual machines
156
+
- Azure Kubernetes Service
157
+
- Navigate to the overview page of your web app.
154
158
155
-
1) Select **Identity** from the left navigation.
159
+
1. Select **Identity** from the left navigation.
156
160
157
-
1) On the **Identity** page, switch to the **User assigned** tab.
161
+
1. On the **Identity** page, switch to the **User assigned** tab.
158
162
159
-
1) Select **+ Add** to open the **Add user assigned managed identity** flyout.
163
+
1. Select **+ Add** to open the **Add user assigned managed identity** flyout.
160
164
161
-
1) Select the subscription you used previously to create the identity.
165
+
1. Select the subscription you used previously to create the identity.
162
166
163
-
1) Search for the **MigrationIdentity** by name and select it from the search results.
167
+
1. Search for the **MigrationIdentity** by name and select it from the search results.
164
168
165
169
1) Select **Add** to associate the identity with your app.
166
170
167
-
:::image type="content" source="media/passwordless-connections/assign-managed-identity-small.png" lightbox="media/passwordless-connections/assign-managed-identity.png" alt-text="A screenshot showing how to assign a managed identity.":::
171
+
:::image type="content" source="media/azure-sql-passwordless-migration-nodejs/assign-managed-identity-small.png" lightbox="media/azure-sql-passwordless-migration-nodejs/assign-managed-identity.png" alt-text="Screenshot showing how to assign a managed identity.":::
168
172
169
173
# [Azure CLI](#tab/azure-cli-assign)
170
174
@@ -183,7 +187,7 @@ To use the **user-assigned** managed identity, create an `AZURE_CLIENT_ID` envir
183
187
Save your changes and restart the application if it doesn't do so automatically.
184
188
185
189
If you need to use a **system-assigned** managed identity, omit the `options.clientId` property. You still need to pass the `authentication.type` property.
186
-
190
+
187
191
```nodejs
188
192
const config = {
189
193
server,
@@ -200,13 +204,9 @@ const config = {
200
204
201
205
### Test the application
202
206
203
-
Test your app to make sure everything is still working. It may take a few minutes for all of the changes to propagate through your Azure environment.
204
-
205
-
## Next steps
206
-
207
-
In this tutorial, you learned how to migrate an application to passwordless connections.
207
+
Test your app to make sure everything is still working. It can take a few minutes for all of the changes to propagate through your Azure environment.
208
208
209
-
You can read the following resources to explore the concepts discussed in this article in more depth:
Application requests to Azure SQL Database must be authenticated. Although there are multiple options for authenticating to Azure SQL Database, you should prioritize passwordless connections in your applications when possible. Traditional authentication methods that use passwords or secret keys create security risks and complications. Visit the [passwordless connections for Azure services](/azure/developer/intro/passwordless-overview) hub to learn more about the advantages of moving to passwordless connections. The following tutorial explains how to migrate an existing Python application to connect to Azure SQL Database to use passwordless connections instead of a username and password solution.
@@ -74,7 +78,7 @@ Driver={ODBC Driver 18 for SQL Server};Server=tcp:<database-server-name>.databas
74
78
75
79
### Test the app
76
80
77
-
Run your app locally and verify that the connections to Azure SQL Database are working as expected. Keep in mind that it may take several minutes for changes to Azure users and roles to propagate through your Azure environment. Your application is now configured to run locally without developers having to manage secrets in the application itself.
81
+
Run your app locally and verify that the connections to Azure SQL Database are working as expected. Keep in mind that it can take several minutes for changes to Azure users and roles to propagate through your Azure environment. Your application is now configured to run locally without developers having to manage secrets in the application itself.
78
82
79
83
## Configure the Azure hosting environment
80
84
@@ -95,25 +99,25 @@ Configure your web app to use the user-assigned managed identity you created.
95
99
96
100
Complete the following steps in the Azure portal to associate the user-assigned managed identity with your app. These same steps apply to the following Azure services:
97
101
98
-
* Azure Spring Apps
99
-
* Azure Container Apps
100
-
* Azure virtual machines
101
-
* Azure Kubernetes Service
102
-
* Navigate to the overview page of your web app.
102
+
- Azure Spring Apps
103
+
- Azure Container Apps
104
+
- Azure virtual machines
105
+
- Azure Kubernetes Service
106
+
- Navigate to the overview page of your web app.
103
107
104
-
1) Select **Identity** from the left navigation.
108
+
1. Select **Identity** from the left navigation.
105
109
106
-
1) On the **Identity** page, switch to the **User assigned** tab.
110
+
1. On the **Identity** page, switch to the **User assigned** tab.
107
111
108
-
1) Select **+ Add** to open the **Add user assigned managed identity** flyout.
112
+
1. Select **+ Add** to open the **Add user assigned managed identity** flyout.
109
113
110
-
1) Select the subscription you used previously to create the identity.
114
+
1. Select the subscription you used previously to create the identity.
111
115
112
-
1) Search for the **MigrationIdentity** by name and select it from the search results.
116
+
1. Search for the **MigrationIdentity** by name and select it from the search results.
113
117
114
-
1) Select **Add** to associate the identity with your app.
118
+
1. Select **Add** to associate the identity with your app.
115
119
116
-
:::image type="content" source="media/passwordless-connections/assign-managed-identity-small.png" lightbox="media/passwordless-connections/assign-managed-identity.png" alt-text="A screenshot showing how to assign a managed identity.":::
120
+
:::image type="content" source="media/azure-sql-passwordless-migration-python/assign-managed-identity-small.png" lightbox="media/azure-sql-passwordless-migration-python/assign-managed-identity.png" alt-text="Screenshot showing how to assign a managed identity.":::
117
121
118
122
# [Azure CLI](#tab/azure-cli-assign)
119
123
@@ -131,15 +135,15 @@ Update your Azure app configuration to use the passwordless connection string fo
131
135
132
136
Connection strings can be stored as environment variables in your app hosting environment. The following instructions focus on App Service, but other Azure hosting services provide similar configurations.
133
137
134
-
```
138
+
```connectionstring
135
139
Driver={ODBC Driver 18 for SQL Server};Server=tcp:<database-server-name>.database.windows.net,1433;Database=<database-name>;Encrypt=yes;TrustServerCertificate=no;Connection Timeout=30
136
140
```
137
141
138
142
`<database-server-name>` is the name of your Azure SQL Database server and `<database-name>` is the name of your Azure SQL Database.
139
143
140
144
### Create an app setting for the managed identity client ID
141
145
142
-
To use the user-assigned managed identity, create an AZURE_CLIENT_ID environment variable and set it equal to the client ID of the managed identity. You can set this variable in the **Configuration** section of your app in the Azure portal. You can find the client ID in the **Overview** section of the managed identity resource in the Azure portal.
146
+
To use the user-assigned managed identity, create an `AZURE_CLIENT_ID` environment variable and set it equal to the client ID of the managed identity. You can set this variable in the **Configuration** section of your app in the Azure portal. You can find the client ID in the **Overview** section of the managed identity resource in the Azure portal.
143
147
144
148
Save your changes and restart the application if it doesn't do so automatically.
145
149
@@ -150,13 +154,9 @@ Save your changes and restart the application if it doesn't do so automatically.
150
154
151
155
### Test the application
152
156
153
-
Test your app to make sure everything is still working. It may take a few minutes for all of the changes to propagate through your Azure environment.
154
-
155
-
## Next steps
156
-
157
-
In this tutorial, you learned how to migrate an application to passwordless connections.
157
+
Test your app to make sure everything is still working. It can take a few minutes for all of the changes to propagate through your Azure environment.
158
158
159
-
You can read the following resources to explore the concepts discussed in this article in more depth:
0 commit comments