File tree Expand file tree Collapse file tree 2 files changed +3
-5
lines changed
mi-sql-public-demo/src/main Expand file tree Collapse file tree 2 files changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -28,10 +28,9 @@ public static void main(String[] args) {
2828 }
2929
3030 String connString = properties .getProperty ("AZURE_SQLDB_CONNECTIONSTRING" );
31- String user = properties .getProperty ("AZURE_SQLDB_USER" );
32- String password = properties .getProperty ("AZURE_SQLDB_PASSWORD" );
31+ String clientId = properties .getProperty ("AZURE_CLIENT_ID" );
3332
34- connString = connString + ";user =" + user + ";password=" + password ;
33+ connString = connString + ";msiClientId =" + clientId + ";authentication=ActiveDirectoryMSI" ;
3534 System .out .print (connString );
3635
3736 SQLServerDataSource ds = new SQLServerDataSource ();
Original file line number Diff line number Diff line change 11AZURE_SQLDB_CONNECTIONSTRING =jdbc:sqlserver://${AZ_DATABASE_SERVER_NAME}.database.windows.net:1433; database=demo;encrypt=true;trustServerCertificate=false;hostNameInCertificate=*.database.windows.net;loginTimeout=30;
2- AZURE_SQLDB_USER =demo@$AZ_DATABASE_NAME
3- AZURE_SQLDB_PASSWORD =$AZ_SQL_SERVER_PASSWORD
2+ AZURE_CLIENT_ID =<your managed identity client id>
You can’t perform that action at this time.
0 commit comments