cancel
Showing results for 
Search instead for 
Did you mean: 
Machine Learning
Dive into the world of machine learning on the Databricks platform. Explore discussions on algorithms, model training, deployment, and more. Connect with ML enthusiasts and experts.
cancel
Showing results for 
Search instead for 
Did you mean: 

Databricks online store - Login to Azure SQL Database with Service Principal

romanzdk
New Contributor II

I want to use Databricks Online Store with Azure SQL Database, however I am unable to autenthicate through Databricks Feature Store API. I need to use Service Principal credentials.

I tried using Application ID as username and Secret as password, but no luck - `com.microsoft.sqlserver.jdbc.SQLServerException: Login failed for user '[REDACTED]'. ClientConnectionId:some-id-x-x-`.

I also tried to generate AAD access Token and use it as a password, however I am getting 

`password exceeds maximum length of 128characters`..

.

When I use the same credentials to test it via JayDeBeApi everything works...

Code I am using:

from databricks.feature_store.online_store_spec import AzureSqlServerSpec
from databricks.feature_store import FeatureStoreClient
 
username = "application-id"
password = "application-secret"
tenantId = "tenant-id"
server_name = "server-name.database.windows.net"
port = "1433"
db_name = "database-name"
 
fs = FeatureStoreClient()
 
online_store = AzureSqlServerSpec(
    hostname=server_name,
    port=1433,
    database_name=db_name,
    user=username,
    password=password,
    table_name="TableName",
)
 
fs.publish_table(
  name='feature_store.TableName',
  online_store=online_store,
  mode='merge'
)

1 REPLY 1

romanzdk
New Contributor II

no one?

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you won’t want to miss the chance to attend and share knowledge.

If there isn’t a group near you, start one and help create a community that brings people together.

Request a New Group