cancel
Showing results for 
Search instead for 
Did you mean: 
Machine Learning
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?

Welcome to Databricks Community: Lets learn, network and celebrate together

Join our fast-growing data practitioner and expert community of 80K+ members, ready to discover, help and collaborate together while making meaningful connections. 

Click here to register and join today! 

Engage in exciting technical discussions, join a group with your peers and meet our Featured Members.