-
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.
-
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.
-
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