Share via

How to connect from Azure Databricks to Azure SQL DB without sql authentication

Paul Hernandez 686 Reputation points Microsoft Employee
Sep 12, 2022, 3:09 PM

Hi everyone,

we were using SQL Authentication while developing a solutions using Azure Databricks Notebooks, which write into an Azure SQL Database.

We need to move forward to the next environment, where SQL Authentication is removed and only AAD authentication is enable.

What would be the best way to use the JDBC driver to interact with the database.

I am thinking in a Managed Identity with the appropriate permissions.

The notebook will be called from an ADF pipeline. Is it possible to use the ADF managed identity for authentication?

Best regards,
Paul

Azure Databricks
Azure Databricks
An Apache Spark-based analytics platform optimized for Azure.
2,393 questions
{count} votes

Accepted answer
  1. Nandan Hegde 34,696 Reputation points MVP
    Sep 12, 2022, 5:14 PM

    Hey
    I am not sure whether we can leverage Managed Identity to access Azure SQL database from Databricks notebook because one would need environment variables that do not exist in the Databricks instance, like IDENTITY_ENDPOINT and IDENTITY_HEADER in reference to below doc:

    You can leverage service principal auth :
    https://www.thedataswamp.com/blog/databricks-connect-to-azure-sql-with-service-principal

    1 person found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. Alberto Morillo 34,646 Reputation points MVP
    Sep 12, 2022, 3:56 PM

    You can definitely use a managed identity in Azure Data Factory to connect to an Azure SQL Database. See this documentation.

    When you create the Linked Service to Azure SQL you can specify you can connect to Azure SQL using managed identity.

    240201-linkedservice.png

    1 person found this answer helpful.

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.