Skip to content

Commit 930f0a0

Browse files
xfz11scottaddie
andauthored
Apply suggestions from code review
Co-authored-by: Scott Addie <[email protected]>
1 parent e00035c commit 930f0a0

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

articles/service-connector/includes/code_sql_aad.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ import com.microsoft.sqlserver.jdbc.SQLServerDataSource;
2020

2121
public class Main {
2222
public static void main(String[] args) {
23-
// Azure_SQL_CONNECTIONSTRING should be
24-
// For system assigned identity: "jdbc:sqlserver://{SQLName}.database.windows.net:1433;databaseName={SQLDbName};authentication=ActiveDirectoryMSI;"
25-
// For user assigned identity: "jdbc:sqlserver://{SQLName}.database.windows.net:1433;databaseName={SQLDbName};msiClientId={UserAssignedMiClientId};authentication=ActiveDirectoryMSI;"
23+
// AZURE_SQL_CONNECTIONSTRING should be one of the following:
24+
// For system-assigned managed identity: "jdbc:sqlserver://{SQLName}.database.windows.net:1433;databaseName={SQLDbName};authentication=ActiveDirectoryMSI;"
25+
// For user-assigned managed identity: "jdbc:sqlserver://{SQLName}.database.windows.net:1433;databaseName={SQLDbName};msiClientId={UserAssignedMiClientId};authentication=ActiveDirectoryMSI;"
2626
// For service principal: "jdbc:sqlserver://{SQLName}.database.windows.net:1433;databaseName={SQLDbName};user={ServicePrincipalClientId};password={spSecret};authentication=ActiveDirectoryServicePrincipal;"
2727
String connectionString = System.getenv("AZURE_SQL_CONNECTIONSTRING");
2828
SQLServerDataSource ds = new SQLServerDataSource();
@@ -40,12 +40,12 @@ public class Main {
4040

4141
For a Spring application, if you create a connection with option `--client-type springboot`, Service Connector will set the properties `spring.datasource.url` with value format `jdbc:sqlserver://<sql-server>.database.windows.net:1433;databaseName=<sql-db>;authentication=ActiveDirectoryMSI;` to Azure Spring Apps.
4242

43-
Update your application following the tutorial [Migrate a Java application to use passwordless connections with Azure SQL Database](/azure/developer/java/spring-framework/migrate-sql-database-to-passwordless-connection?tabs=spring%2Capp-service%2Cassign-role-service-connector#2-migrate-the-app-code-to-use-passwordless-connections). Remember to remove the `spring.datasource.password` configuration property if it was set before and add the correct dependencies,
43+
Update your application following the tutorial [Migrate a Java application to use passwordless connections with Azure SQL Database](/azure/developer/java/spring-framework/migrate-sql-database-to-passwordless-connection?tabs=spring%2Capp-service%2Cassign-role-service-connector#2-migrate-the-app-code-to-use-passwordless-connections). Remember to remove the `spring.datasource.password` configuration property if it was set before and add the correct dependencies.
4444

4545

4646
### [.NET](#tab/dotnet)
4747

48-
For managed identity authentication, see [Using Active Directory Managed Identity authentication](/sql/connect/ado-net/sql/azure-active-directory-authentication#using-active-directory-service-principal-authentication).
48+
For managed identity authentication, see [Using Active Directory Managed Identity authentication](/sql/connect/ado-net/sql/azure-active-directory-authentication#using-active-directory-managed-identity-authentication).
4949

5050
```csharp
5151
using Microsoft.Data.SqlClient;

0 commit comments

Comments
 (0)