Bylaw

Gallery › Synapse › Azure built-in policies

Synapse Workspaces should have Microsoft Entra-only authentication enabled

Converted Policy Audit Deny Disabled Mode All Version 1.0.0

Require Synapse Workspaces to use Microsoft Entra-only authentication. This policy doesn't block workspaces from being created with local authentication enabled. It does block local authentication from being enabled on resources after create. Consider using the 'Microsoft Entra-only authentication' initiative instead to require both. Learn more at: https://aka.ms/Synapse.

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

Azure Policy JSONWorkspaceDisableAadOnlyAuthentication_Audit.json · 58 lines
{
  "properties": {
    "displayName": "Synapse Workspaces should have Microsoft Entra-only authentication enabled",
    "description": "Require Synapse Workspaces to use Microsoft Entra-only authentication. This policy doesn't block workspaces from being created with local authentication enabled. It does block local authentication from being enabled on resources after create. Consider using the 'Microsoft Entra-only authentication' initiative instead to require both. Learn more at: https://aka.ms/Synapse.",
    "policyType": "BuiltIn",
    "mode": "All",
    "metadata": {
      "version": "1.0.0",
      "category": "Synapse"
    },
    "version": "1.0.0",
    "parameters": {
      "effect": {
        "type": "String",
        "metadata": {
          "displayName": "Effect",
          "description": "Enable or disable the execution of the policy"
        },
        "allowedValues": [
          "Audit",
          "Deny",
          "Disabled"
        ],
        "defaultValue": "Audit"
      }
    },
    "policyRule": {
      "if": {
        "allOf": [
          {
            "field": "type",
            "equals": "Microsoft.Synapse/workspaces/azureADOnlyAuthentications"
          },
          {
            "anyOf": [
              {
                "field": "Microsoft.Synapse/workspaces/azureADOnlyAuthentications/azureADOnlyAuthentication",
                "exists": false
              },
              {
                "field": "Microsoft.Synapse/workspaces/azureADOnlyAuthentications/azureADOnlyAuthentication",
                "equals": false
              }
            ]
          }
        ]
      },
      "then": {
        "effect": "[parameters('effect')]"
      }
    },
    "versions": [
      "1.0.0"
    ]
  },
  "id": "/providers/Microsoft.Authorization/policyDefinitions/6ea81a52-5ca7-4575-9669-eaa910b7edf8",
  "name": "6ea81a52-5ca7-4575-9669-eaa910b7edf8"
}
Bylaw6ea81a52-5ca7-4575-9669-eaa910b7edf8.bylaw.ps1 · 32 lines
# Converted from WorkspaceDisableAadOnlyAuthentication_Audit.json by ConvertTo-Bylaw.
Policy '6ea81a52-5ca7-4575-9669-eaa910b7edf8' {

    Properties @{
        DisplayName   = 'Synapse Workspaces should have Microsoft Entra-only authentication enabled'
        Description   = 'Require Synapse Workspaces to use Microsoft Entra-only authentication. This policy doesn''t block workspaces from being created with local authentication enabled. It does block local authentication from being enabled on resources after create. Consider using the ''Microsoft Entra-only authentication'' initiative instead to require both. Learn more at: https://aka.ms/Synapse.'
        Version       = '1.0.0'
        Category      = 'Synapse'
        PolicyVersion = '1.0.0'
        Mode          = 'All'
    }

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

    Resource 'Microsoft.Synapse/workspaces/azureADOnlyAuthentications' {

        Require 'azureADOnlyAuthentication exists' {
            Field azureADOnlyAuthentication | Must -Exist
        }

        Require 'azureADOnlyAuthentication is not false' {
            Field azureADOnlyAuthentication | Must -Not -Be $false -IfPresent
        }
    }

    Effect (Param Effect)
}

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