cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results for 
Search instead for 
Did you mean: 

The authentication value "ActiveDirectoryManagedIdentity" is not valid.

akuma643
New Contributor II

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

akuma643
New Contributor II

Can anyone help me out on this please

Join Us as a Local Community Builder!

Passionate about hosting events and connecting people? Help us grow a vibrant local community—sign up today to get started!

Sign Up Now