我正在尝试使用python将我的Databricks集群连接到现有的SQL Server数据库。我想利用集成身份验证方法。获取错误com.microsoft.sqlserver.jdbc.SQLServerException: This driver is not configured for integrated authentication.
jdbcHostname = "sampledb-dev.database.windows.net"
jdbcPort= 1433
jdbcDatabase = "sampledb-dev"
jdbcUrl = "jdbc:sqlserver://{0}:{1}; database={2}".format(jdbcHostname, jdbcPort, jdbcDatabase)
connectionProperties={
"integratedSecurity" : "true",
"driver" : "com.microsoft.sqlserver.jdbc.SQLServerDriver"
}
print(jdbcUrl)
query ="(SELECT * FROM TABLE1.Domain)"
domains = spark.read.jdbc(url = jdbcUrl, table = query, properties = connectionProperties)
display(domains)
您不能将
integratedSecurity=true
与Azure PaaS数据库一起使用IntegratedSecurity
是一个内部构造您需要使用
authentication=ActiveDirectoryIntegrated
或authentication=ActiveDirectoryPassword
,请参见此处的JDBC文档: https://docs.microsoft.com/en-us/sql/connect/jdbc/connecting-using-azure-active-directory-authentication?view=sql-server-ver15您还需要您的帐户是对同步到Azure AD的数据库具有适当权限的用户。如果您使用多因素身份验证,则JDBC不支持这种身份验证,并且您的管理员需要为您提供一个未启用MFA的帐户。您将知道是否是这种情况,因为在尝试连接时会出现
WSTrust
错误相关问题 更多 >
编程相关推荐