Azure Databricks Workspace

This page shows how to write Terraform and Azure Resource Manager for Databricks Workspace and write them securely.

azurerm_databricks_workspace (Terraform)

The Workspace in Databricks can be configured in Terraform with the resource name azurerm_databricks_workspace. The following sections describe 7 examples of how to use the resource and its parameters.

Example Usage from GitHub

databricks_workspace_test.tf#L11
resource "azurerm_databricks_workspace" "standard" {
  name                = "databricks-test"
  resource_group_name = azurerm_resource_group.example.name
  location            = azurerm_resource_group.example.location
  sku                 = "standard"
}
main.tf#L5
resource "azurerm_databricks_workspace" "ADB" {
  name                = var.data_brick_name
  resource_group_name = data.azurerm_resource_group.RG.name
  location            = var.location
  sku                 = var.sku
}
main.tf#L15
resource "azurerm_databricks_workspace" "corebricks" {
  for_each            = var.coreDatabricks
  name                = each.value["brickName"]
  resource_group_name = each.value["brickRgName"]
  location            = each.value["brickLocation"]
  sku                 = each.value["brickSku"]
main.tf#L20
resource "azurerm_databricks_workspace" "this" {
  location = var.location
  name = "dbx-mthone-tf"
  resource_group_name = azurerm_resource_group.rg.name
  sku = "premium"
  tags = var.tags
main.tf#L1
resource "azurerm_databricks_workspace" "adw" {
  name                = var.name
  location            = var.location
  resource_group_name = var.rg_name
  sku                 = var.sku
  tags                = var.tags
databricks-main.tf#L9
resource "azurerm_databricks_workspace" "main" {
  name                = var.databricks_name
  resource_group_name = var.resource_group_name
  location            = var.location
  sku                 = var.databricks_workspace_sku

azure.tf#L24
resource "azurerm_databricks_workspace" "bricks" {
  name = "kobricks"
  resource_group_name = azurerm_resource_group.rg.name
  location = azurerm_resource_group.rg.location
  sku = "standard"

Review your Terraform file for Azure best practices

Shisho Cloud, our free checker to make sure your Terraform configuration follows best practices, is available (beta).

Parameters

Explanation in Terraform Registry

NOTE: Some Databricks Workspace features are in Private Preview(e.g. Private Link Endpoint, Customer Managed Keys for Managed Services, etc.) and potentially subject to breaking change without notice. If you would like to use these features please contact your Microsoft support representative on how to opt-in to the Databricks Workspace Private Preview feature program. Manages a Databricks Workspace

Microsoft.Databricks/workspaces (Azure Resource Manager)

The workspaces in Microsoft.Databricks can be configured in Azure Resource Manager with the resource name Microsoft.Databricks/workspaces. The following sections describe how to use the resource and its parameters.

Example Usage from GitHub

WorkspacesListBySubscription.json#L14
            "type": "Microsoft.Databricks/workspaces",
            "location": "East US 2",
            "tags": null,
            "sku": {
              "name": "skuName"
            },
WorkspacesListByResourceGroup.json#L15
            "type": "Microsoft.Databricks/workspaces",
            "location": "East US 2",
            "tags": null,
            "sku": {
              "name": "skuName"
            },
WorkspacesListBySubscription.json#L14
            "type": "Microsoft.Databricks/workspaces",
            "location": "East US 2",
            "tags": null,
            "sku": {
              "name": "skuName"
            },
WorkspacesListByResourceGroup.json#L15
            "type": "Microsoft.Databricks/workspaces",
            "location": "East US 2",
            "tags": null,
            "sku": {
              "name": "skuName"
            },
WorkspacesListBySubscription.json#L14
            "type": "Microsoft.Databricks/workspaces",
            "location": "East US 2",
            "tags": null,
            "sku": {
              "name": "skuName"
            },
WorkspacesListByResourceGroup.json#L15
            "type": "Microsoft.Databricks/workspaces",
            "location": "East US 2",
            "tags": null,
            "sku": {
              "name": "skuName"
            },
WorkspacesListBySubscription.json#L14
            "type": "Microsoft.Databricks/workspaces",
            "location": "East US 2",
            "tags": null,
            "sku": {
              "name": "skuName"
            },
WorkspacesListByResourceGroup.json#L15
            "type": "Microsoft.Databricks/workspaces",
            "location": "East US 2",
            "tags": null,
            "sku": {
              "name": "skuName"
            },
azure.com_databricks_2018-04-01.json#L218
                      "type": "Microsoft.Databricks/workspaces"
                    },
                    {
                      "id": "/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Databricks/workspaces/myWorkspace2",
                      "location": "East US 2",
                      "name": "myWorkspace2",
WorkspacesListBySubscription.json#L14
            "type": "Microsoft.Databricks/workspaces",
            "location": "East US 2",
            "tags": null,
            "sku": {
              "name": "skuName"
            },

Parameters

  • apiVersion required - string
  • location required - string

    The geo-location where the resource lives

  • name required - string

    The name of the workspace.

  • properties required
      • authorizations optional array
          • principalId required - string

            The provider's principal identifier. This is the identity that the provider will use to call ARM to manage the workspace resources.

          • roleDefinitionId required - string

            The provider's role definition identifier. This role will define all the permissions that the provider must have on the workspace's container resource group. This role definition cannot have permission to delete the resource group.

      • createdBy optional
        • createdDateTime optional - string

          The date and time stamp when the workspace was created.

        • managedResourceGroupId required - string

          The managed resource group Id.

        • parameters optional
            • amlWorkspaceId optional
                • type optional - string

                  The type of variable that this is.

                • value required - string

                  The value which should be used for this field.

            • customPrivateSubnetName optional
                • type optional - string

                  The type of variable that this is.

                • value required - string

                  The value which should be used for this field.

            • customPublicSubnetName optional
                • type optional - string

                  The type of variable that this is.

                • value required - string

                  The value which should be used for this field.

            • customVirtualNetworkId optional
                • type optional - string

                  The type of variable that this is.

                • value required - string

                  The value which should be used for this field.

            • enableNoPublicIp optional
                • type optional - string

                  The type of variable that this is.

                • value required - boolean

                  The value which should be used for this field.

            • encryption optional
                • type optional - string

                  The type of variable that this is.

                • value optional
                    • KeyName optional - string

                      The name of KeyVault key.

                    • keySource optional - string

                      The encryption keySource (provider). Possible values (case-insensitive): Default, Microsoft.Keyvault.

                    • keyvaulturi optional - string

                      The Uri of KeyVault.

                    • keyversion optional - string

                      The version of KeyVault key.

            • loadBalancerBackendPoolName optional
                • type optional - string

                  The type of variable that this is.

                • value required - string

                  The value which should be used for this field.

            • loadBalancerId optional
                • type optional - string

                  The type of variable that this is.

                • value required - string

                  The value which should be used for this field.

            • natGatewayName optional
                • type optional - string

                  The type of variable that this is.

                • value required - string

                  The value which should be used for this field.

            • prepareEncryption optional
                • type optional - string

                  The type of variable that this is.

                • value required - boolean

                  The value which should be used for this field.

            • publicIpName optional
                • type optional - string

                  The type of variable that this is.

                • value required - string

                  The value which should be used for this field.

            • requireInfrastructureEncryption optional
                • type optional - string

                  The type of variable that this is.

                • value required - boolean

                  The value which should be used for this field.

            • storageAccountName optional
                • type optional - string

                  The type of variable that this is.

                • value required - string

                  The value which should be used for this field.

            • storageAccountSkuName optional
                • type optional - string

                  The type of variable that this is.

                • value required - string

                  The value which should be used for this field.

            • vnetAddressPrefix optional
                • type optional - string

                  The type of variable that this is.

                • value required - string

                  The value which should be used for this field.

        • storageAccountIdentity optional
          • uiDefinitionUri optional - string

            The blob URI where the UI definition file is located.

          • updatedBy optional
        • sku optional
            • name required - string

              The SKU name.

            • tier optional - string

              The SKU tier.

        • tags optional - string

          Resource tags.

        • type required - string

        Frequently asked questions

        What is Azure Databricks Workspace?

        Azure Databricks Workspace is a resource for Databricks of Microsoft Azure. Settings can be wrote in Terraform.

        Where can I find the example code for the Azure Databricks Workspace?

        For Terraform, the gilyas/infracost, jvaquero24/DataBricks and johhess40/Terraform source code examples are useful. See the Terraform Example section for further details.

        For Azure Resource Manager, the yuncmsft/swagger, yuncmsft/swagger and assing/alerts-extension source code examples are useful. See the Azure Resource Manager Example section for further details.