Bylaw

Gallery › Azure Databricks › Azure built-in policies

Azure Databricks workspaces should be Premium SKU that supports features like private link, customer-managed key for encryption

Converted Policy Audit Deny Disabled Mode Indexed Version 1.0.1

Only allow Databricks workspace with Premium Sku that your organization can deploy to support features like Private Link, customer-managed key for encryption. Learn more at: https://aka.ms/adbpe.

ConvertTo-Bylaw converted this policy, and proved that the file compiles back to the same definition.

Azure Policy JSONAllowedDatabricksSkus_Audit.json · 54 lines
{
  "properties": {
    "displayName": "Azure Databricks workspaces should be Premium SKU that supports features like private link, customer-managed key for encryption",
    "policyType": "BuiltIn",
    "mode": "Indexed",
    "description": "Only allow Databricks workspace with Premium Sku that your organization can deploy to support features like Private Link, customer-managed key for encryption. Learn more at: https://aka.ms/adbpe.",
    "metadata": {
      "version": "1.0.1",
      "category": "Azure Databricks"
    },
    "version": "1.0.1",
    "parameters": {
      "effect": {
        "type": "String",
        "metadata": {
          "displayName": "Effect",
          "description": "Enable or disable the execution of the audit policy"
        },
        "allowedValues": [
          "Audit",
          "Deny",
          "Disabled"
        ],
        "defaultValue": "Audit"
      }
    },
    "policyRule": {
      "if": {
        "allOf": [
          {
            "field": "type",
            "equals": "Microsoft.Databricks/workspaces"
          },
          {
            "field": "Microsoft.Databricks/workspaces/sku.name",
            "notEquals": "Premium"
          },
          {
            "value": "[empty(field('Microsoft.Databricks/workspaces/sku.name'))]",
            "notEquals": "true"
          }
        ]
      },
      "then": {
        "effect": "[parameters('effect')]"
      }
    },
    "versions": [
      "1.0.1"
    ]
  },
  "id": "/providers/Microsoft.Authorization/policyDefinitions/2cc2c3b5-c2f8-45aa-a9e6-f90d85ae8352",
  "name": "2cc2c3b5-c2f8-45aa-a9e6-f90d85ae8352"
}
Bylaw2cc2c3b5-c2f8-45aa-a9e6-f90d85ae8352.bylaw.ps1 · 32 lines
# Converted from AllowedDatabricksSkus_Audit.json by ConvertTo-Bylaw.
Policy '2cc2c3b5-c2f8-45aa-a9e6-f90d85ae8352' {

    Properties @{
        DisplayName   = 'Azure Databricks workspaces should be Premium SKU that supports features like private link, customer-managed key for encryption'
        Description   = 'Only allow Databricks workspace with Premium Sku that your organization can deploy to support features like Private Link, customer-managed key for encryption. Learn more at: https://aka.ms/adbpe.'
        Version       = '1.0.1'
        Category      = 'Azure Databricks'
        PolicyVersion = '1.0.1'
        Mode          = 'Indexed'
    }

    Parameter Effect @{
        AllowedValues = @('Audit', 'Deny', 'Disabled')
        Default       = 'Audit'
        DisplayName   = 'Effect'
        Description   = 'Enable or disable the execution of the audit policy'
    }

    Resource 'Microsoft.Databricks/workspaces' {

        When {
            Field sku.name | Must -Not -Be 'Premium'
        }

        Require 'sku.name is as required' {
            Arm '[empty(field(''Microsoft.Databricks/workspaces/sku.name''))]' | Must -Be 'true'
        }
    }

    Effect (Param Effect)
}

Source: built-in-policies/policyDefinitions/Azure Databricks/AllowedDatabricksSkus_Audit.json in Azure/azure-policy, under the MIT licence.