cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Administration & Architecture
cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Get Azure Databricks Account ID

RozaZaharieva
New Contributor

Hi everyone,

Is it possible with Terraform or Azure CLI or any other not manual method to get the value for Azure Databricks Account ID and not to use manual method as is described here - https://learn.microsoft.com/en-us/azure/databricks/administration-guide/account-settings/#--locate-y....

Thank you in advance.

2 REPLIES 2

Kaniz
Community Manager
Community Manager

Hi @RozaZaharievaTo retrieve the Azure Databricks Account ID without manual intervention, you can use the following methods:

 
  1. Azure CLI: You can use the Azure CLI to query the account details. Run the following command to get the account ID:

    az databricks workspace show --resource-group <resource-group-name> --name <databricks-workspace-name> --query 'id'
    

    Replace <resource-group-name> and <databricks-workspace-name> with your actual resource group and Databricks workspace names.

  2. Terraform: If youโ€™re managing your infrastructure with Terraform, you can use the azurerm_databricks_workspace resource to retrieve the account ID. Hereโ€™s an example snippet:

    data "azurerm_databricks_workspace" "example" {
      name                = "<databricks-workspace-name>"
      resource_group_name = "<resource-group-name>"
    }
    
    output "databricks_account_id" {
      value = data.azurerm_databricks_workspace.example.id
    }
    

    Again, replace <resource-group-name> and <databricks-workspace-name> with your actual values.

  3. Other Methods:

    • You can also use the Databricks CLI with appropriate authentication methods (OAuth, managed identities, etc.) to programmatically retrieve the account ID.
    • If youโ€™re using a custom script or automation, consider using the Databricks REST API to fetch the account details.

Remember to replace the placeholders with your actual resource group and workspace names. These methods allow you to obtain the Azure Databricks Account ID programmatically, avoiding manual steps. ๐Ÿš€

For more details, refer to the official documentation.1

 

jfvizoso
New Contributor II

Hi there,

I would prefer the REST API way, but I cannot find any method to fetch the account details. Do you know which one I should use?

Thank you.

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.