Class AzureMSICredentialProvider

java.lang.Object
com.databricks.jdbc.auth.AzureMSICredentialProvider
All Implemented Interfaces:
com.databricks.sdk.core.CredentialsProvider

public class AzureMSICredentialProvider extends Object implements com.databricks.sdk.core.CredentialsProvider
Implementation of CredentialsProvider that uses Azure Managed Service Identity (MSI) for authentication with Databricks services.

This provider obtains access tokens from Azure MSI and includes them in the request headers for Databricks API calls. It supports both resource ID-based authentication and direct token authentication.

When Azure Workspace Resource ID is provided, the provider will include both the resource ID and a management endpoint token in the request headers.

  • Constructor Details

    • AzureMSICredentialProvider

      public AzureMSICredentialProvider(IDatabricksConnectionContext connectionContext)
      Constructs a new AzureMSICredentialProvider.
      Parameters:
      connectionContext - The Databricks connection context containing authentication parameters such as client ID and Azure workspace resource ID.
  • Method Details

    • authType

      public String authType()
      Returns the authentication type identifier for this provider.
      Specified by:
      authType in interface com.databricks.sdk.core.CredentialsProvider
      Returns:
      The string constant representing Azure MSI authentication type.
    • configure

      public com.databricks.sdk.core.HeaderFactory configure(com.databricks.sdk.core.DatabricksConfig databricksConfig)
      Configures and returns a HeaderFactory that produces authentication headers for Databricks API requests.

      The returned HeaderFactory will provide:

      • An Authorization header with the Azure MSI access token
      • If resourceId is available, an X-Databricks-Azure-Workspace-Resource-Id header
      • If resourceId is not available, an X-Databricks-Azure-SP-Management-Token header with a management endpoint token
      Specified by:
      configure in interface com.databricks.sdk.core.CredentialsProvider
      Parameters:
      databricksConfig - The Databricks configuration object.
      Returns:
      A HeaderFactory that produces the required authentication headers.