Questions on Databricks Service Principal Login and ADF Pipeline Notebook Execution Identity

Saikumar Karri 0 Reputation points
2025-09-11T20:15:18.4433333+00:00

Hi Team,

I have questions regarding Azure Data Factory (ADF) integration to databricks through SP

Running Databricks Notebooks from ADF pipeline

When I trigger a pipeline in ADF that runs a Databricks notebook, the notebook seems to execute under a specific user identity.

  • How is this user identity determined?
  • Can we configure/change which user identity the notebook runs as? If yes, how can it be done (for example, by using Service Principal or Managed Identity)?

Thanks in advance for the clarification!

Azure Data Factory
Azure Data Factory

An Azure service for ingesting, preparing, and transforming data at scale.


2 answers

Sort by: Most helpful
  1. PRADEEPCHEEKATLA 91,866 Reputation points
    2025-09-18T13:32:29.1266667+00:00

    Saikumar Karri - Thanks for the question and using MS Q&A platform.

    Here are the few important notes which needs to understand while setting up service principle with Azure Databricks:

    • Service Principals cannot log into the Databricks UI; they are meant for automation and API access only.
    • If you don’t see “Service Principal” as an option in ADF, use the Access Token method with a token generated via SP credentials.
    • Managed Identity is preferred for production due to its simplicity and security.

    Questions on Databricks Service Principal Login and ADF Pipeline Notebook Execution Identity?

    Azure Data Factory (ADF) does not currently support Service Principal (SP) authentication for Azure Databricks (ADB) linked services.

    What does it means:
    Service Principal cannot be used directly in ADF to authenticate with Databricks.

    • If you want to use a non-user identity, Managed Identity is the best option:
      • Assign a System-Assigned or User-Assigned Managed Identity to ADF.
      • Grant that identity appropriate roles in the Databricks workspace.
      • Configure the ADF linked service to use Managed Identity.

    Hope this helps. Let me know if you have any further questions or need additional assistance. Also, if these answers your query, do click the "Upvote" and click "Accept the answer" of which might be beneficial to other community members reading this thread.


    𝘛𝘰 𝘴𝘵𝘢𝘺 𝘪𝘯𝘧𝘰𝘳𝘮𝘦𝘥 𝘢𝘣𝘰𝘶𝘵 𝘵𝘩𝘦 𝘭𝘢𝘵𝘦𝘴𝘵 𝘶𝘱𝘥𝘢𝘵𝘦𝘴 𝘢𝘯𝘥 𝘪𝘯𝘴𝘪𝘨𝘩𝘵𝘴 𝘰𝘯 𝘈𝘻𝘶𝘳𝘦 𝘋𝘢𝘵𝘢𝘣𝘳𝘪𝘤𝘬𝘴, 𝘥𝘢𝘵𝘢 𝘦𝘯𝘨𝘪𝘯𝘦𝘦𝘳𝘪𝘯𝘨, 𝘢𝘯𝘥 Data & AI 𝘪𝘯𝘯𝘰𝘷𝘢𝘵𝘪𝘰𝘯𝘴, 𝘧𝘰𝘭𝘭𝘰𝘸 𝘮𝘦 𝘰𝘯 𝘓𝘪𝘯𝘬𝘦𝘥𝘐𝘯.

    Was this answer helpful?

    0 comments No comments

  2. Anonymous
    2025-09-16T09:03:50.1966667+00:00

    Hi @Saikumar karri
     
    Thank you for reviewing the previously provided steps. Below are a few additional actions that may assist in addressing your concern -

    Azure Databricks using a service principal for authentication, but the notebook execution still reflects your personal user identity. This typically happens when:

    The token used for authentication is not being applied correctly. The Databricks workspace or notebook execution context is still tied to your user session. The service principal is not being used to initiate the actual API calls or cluster jobs.

    Confirm the below steps -

    Ensure the token you're using is generated for the service principal, not your user account. You can use OAuth 2.0 to authorize service principal access to Databricks resources via CLI or REST API.

    Follow this guide: Authorize service principal access to Azure Databricks with OAuth

    Avoid Manual UI Execution -

    If you open and run the notebook manually in the Databricks UI, it will always show your email. To run as the service principal:

    Use Databricks REST API or Databricks CLI with the service principal token.

    Assign Proper Permissions Ensure the service principal has: Workspace access Cluster creation permissions Job execution permissions Reference: https://learn.microsoft.com/en-us/azure/databricks/administration-guide/users-groups/service-principals

     

    Use Azure Data Factory (ADF) ADF does not explicitly list "Service Principal" as an authentication method. Instead: Use the Access Token option. Ensure the token is generated using service principal credentials.

    When a notebook runs in Databricks, the identity it uses depends on who actually triggers the job—not who created the token. So, if you want the job to reflect the service principal's identity, it needs to be launched by the service principal itself using the API, CLI, or an automated tool—not manually through the user interface.

    Thanks,
    Vrishabh

    Was this answer helpful?


Your answer

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