The authentication value "ActiveDirectoryManagedIdentity" is not valid.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-18-2025 06:48 AM
Hi Team,
i am trying to connect to SQL server hosted in azure vm using Entra id authentication from Databricks.("authentication", "ActiveDirectoryManagedIdentity")
Below is the notebook script i am using.
driver = "com.microsoft.sqlserver.jdbc.SQLServerDriver"
database_host = "xxxxx"
database_port = "1433" # update if you use a non-default port
database_name = "xxxx"
UserAssignedMiClientId="xxxxxx"
table = "CAS_DEF"
user = "<username>"
password = "<password>"
url = f"jdbc:sqlserver://{database_host}:{database_port};user={UserAssignedMiClientId};authentication=ActiveDirectoryManagedIdentity;encrypt=true;trustServerCertificate=true;database={database_name}"
remote_table = (spark.read
.format("sqlserver")
.option("host", "xxxx")
.option("port", "1433") # optional, can use default port 1433 if omitted
.option("user", {UserAssignedMiClientId})
.option("authentication", "ActiveDirectoryManagedIdentity")
.option("database", {database_name})
.option("dbtable", {table})
.load()
)
I am getting the exception as below,
com.microsoft.sqlserver.jdbc.SQLServerException: The authentication value "ActiveDirectoryManagedIdentity" is not valid. at com.microsoft.sqlserver.jdbc.SqlAuthentication.valueOfString(SQLServerDriver.java:96) at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectInternal(SQLServerConnection.java:2325) at com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(SQLServerConnection.java:1663) at com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(SQLServerDriver.java:1064) at org.apache.spark.sql.execution.datasources.jdbc.connection.BasicConnectionProvider.getConnection(BasicConnectionProvider.scala:50)
i think Databricks is using default Sqlserverdriver. Can i override that???
Please help us on resolving the above issue.
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-19-2025 01:35 AM
Can anyone help me out on this please

