Κοινή χρήση μέσω


Azure Databricks configuration profiles

An Azure Databricks configuration profile (sometimes referred to as a configuration profile, a config profile, or simply a profile) contains settings and other information that Azure Databricks needs to authenticate. Azure Databricks configuration profiles are stored in Azure Databricks configuration profiles files (.databrickscfg) for your tools, SDKs, scripts, and apps to use. To learn whether Azure Databricks configuration profiles are supported by your tools, SDKs, scripts, and apps, see your provider’s documentation. All participating tools and SDKs that implement Databricks client unified authentication support Azure Databricks configuration profiles.

Create an Azure Databricks configuration profiles file

  1. Use your favorite text editor to create a file named .databrickscfg in your ~ (your user home) folder on Unix, Linux, or macOS, or your %USERPROFILE% (your user home) folder on Windows, if you do not already have one. Do not forget the dot (.) at the beginning of the file name. Add the following contents to this file:

    [<some-unique-name-for-this-configuration-profile>]
    <field-name> = <field-value>
    
  2. In the preceding contents, replace the following values, and then save the file:

    • <some-unique-name-for-this-configuration-profile> with a unique name for the configuration profile, such as DEFAULT, DEVELOPMENT, PRODUCTION, or similar. You can have multiple configuration profiles in the same .databrickscfg file, but each configuration profile must have a unique name within this file.
    • <field-name> and <field-value> with the name and a value for one of the required fields for the target Databricks authentication type. For the specific information to provide, see the section earlier in this article for that authentication type.
    • Add a <field-name> and <field-value> pair for each of the additional required fields for the target Databricks authentication type.

For example, for Azure Databricks personal access token authentication, the .databrickscfg file might look like this:

[DEFAULT]
host  = https://adb-1234567890123456.7.azuredatabricks.net
token = dapi123...

To create additional configuration profiles, specify different profile names within the same .databrickscfg file. For example, to specify separate Azure Databricks workspaces, each with their own Azure Databricks personal access token:

[DEFAULT]
host  = https://adb-1234567890123456.7.azuredatabricks.net
token = dapi123...

[DEVELOPMENT]
host  = https://adb-2345678901234567.8.azuredatabricks.net
token = dapi234...

You can also specify different profile names within the .databrickscfg file for Azure Databricks accounts and different Databricks authentication types, for example:

[DEFAULT]
host  = https://adb-1234567890123456.7.azuredatabricks.net
token = dapi123...

[DEVELOPMENT]
azure_workspace_resource_id = /subscriptions/bc0cd1.../resourceGroups/my-resource-group/providers/Microsoft.Databricks/workspaces/my-workspace
azure_tenant_id             = bc0cd1...
azure_client_id             = fa0cd1...
azure_client_secret         = aBC1D~...