Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-27-2023 10:40 AM
I am trying to read data into a dataframe from Azure SQL DB, using jdbc. Here is the code I am using.
driver = "com.microsoft.sqlserver.jdbc.SQLServerDriver"
database_host = "server.database.windows.net"
database_port = "1433"
database_name = "database"
table = "table1"
user = "user@abc.com"
password = "Passwrod123"
url = f"jdbc:sqlserver://{database_host}:{database_port};database={database_name};"
df = (spark.read
.format("jdbc")
.option("driver", driver)
.option("url", url)
.option("dbtable", table)
.option("user", user)
.option("password", password)
.load()
)Here is the error I am receiving:
com.microsoft.sqlserver.jdbc.SQLServerException: Cannot open server "abc.com" requested by the login. The login failed.
The user does have permission to the server and database and can log in just fine using SSMS or Azure Data Studio. Is there some other configuration that I need to do so Databricks can talk to Azure SQL DB? What am I missing?
Thanks for the help.
Labels:
- Labels:
-
Azure SQL DB