How To
Summary
How to connect to Azure SQL Server using Active Directory Managed Identity
Objective
Only valid for Data Collector 5.7 and later.
This article covers how to connect to Azure SQL Server using Active Directory Managed Identity (Microsoft Entra ID). We will use the JDBC stages (Query Consumer or Multitable Consumer) to do it since there is no specific Azure SQL Server stage at the moment.
Steps
Download and install the proper drivers and dependencies in SDC from Microsoft Documentation: https://learn.microsoft.com/en-us/sql/connect/jdbc/download-microsoft-jdbc-driver-for-sql-server?view=azuresqldb-current
Follow these steps from Microsoft documentation to create a user and grant access to the Azure SQL Server: https://learn.microsoft.com/en-us/entra/identity/managed-identities-azure-resources/tutorial-windows-vm-access-sql
Obtain the connection string from your Azure SQL Server. In the Azure SQL UI, Go to Setting → Connection Strings.
Copy the connection string called “JDBC (Microsoft Entra integrated authentication)”. It looks like this one:
jdbc:sqlserver://ranjithtest.database.windows.net:1433;database=ranjith;encrypt=true;trustServerCertificate=false;hostNameInCertificate=*.database.windows.net;loginTimeout=30;Authentication=ActiveDirectoryIntegrated
5. Change the last part of the string. From Authentication=ActiveDirectoryIntegrated
→ Authentication=ActiveDirectoryManagedIdentity
Use this connection string when configuring the JDBC stage. It will look like this:
jdbc:sqlserver://ranjithtest.database.windows.net:1433;database=ranjith;encrypt=true;trustServerCertificate=false;hostNameInCertificate=*.database.windows.net;loginTimeout=30;Authentication=ActiveDirectoryManagedIdentity
Be sure to deactivate the Java Security Manager when using a Java version earlier than Java 17. Otherwise, the connection will be blocked.
Results
After following the above steps, you will be able to connect to Azure SQL Server using Azure Active Directory Managed Identity.
Additional Information
Create a user and grant access in Azure SQL Server: https://learn.microsoft.com/en-us/entra/identity/managed-identities-azure-resources/tutorial-windows-vm-access-sql
Download JDBC drivers from Microsoft: https://learn.microsoft.com/en-us/sql/connect/jdbc/download-microsoft-jdbc-driver-for-sql-server?view=azuresqldb-current
Document Location
Worldwide
Was this topic helpful?
Document Information
More support for:
IBM StreamSets Data Collector
Software version:
All Version(s)
Document number:
7186360
Modified date:
16 March 2025
UID
ibm17186360