Class AzureMSICredentials

java.lang.Object
com.databricks.jdbc.auth.AzureMSICredentials
All Implemented Interfaces:
com.databricks.sdk.core.oauth.TokenSource

public class AzureMSICredentials extends Object implements com.databricks.sdk.core.oauth.TokenSource
Provides authentication functionality using Azure Managed Service Identity (MSI).

This class implements TokenSource to handle token retrieval and refreshing for Databricks services running on Azure. It leverages the Azure Instance Metadata Service to obtain OAuth tokens that can be used to authenticate with Databricks and Azure Management endpoints.

The class supports both user-assigned and system-assigned managed identities. For user-assigned managed identities, a client ID should be provided.

  • Method Details

    • getToken

      public com.databricks.sdk.core.oauth.Token getToken()
      Refreshes the Databricks access token.

      This method is called automatically when the token expires or when a token is requested for the first time.

      Specified by:
      getToken in interface com.databricks.sdk.core.oauth.TokenSource
      Returns:
      A new Token object containing the refreshed access token
    • getManagementEndpointToken

      public com.databricks.sdk.core.oauth.Token getManagementEndpointToken()
      Retrieves a token for accessing the Azure Management endpoint.

      This token is used for operations that require access to Azure Resource Manager, such as managing workspace resources.

      Returns:
      A Token object containing the access token for the Azure Management endpoint