Bylaw

Gallery › App Configuration › Azure built-in policies

App Configuration should use a SKU that supports private link

Converted Policy Audit Deny Disabled Mode Indexed Version 1.0.0

When using a supported SKU, Azure Private Link lets you connect your virtual network to Azure services without a public IP address at the source or destination. The private link platform handles the connectivity between the consumer and services over the Azure backbone network. By mapping private endpoints to your app configuration instances instead of the entire service, you'll also be protected against data leakage risks. Learn more at: https://aka.ms/appconfig/private-endpoint.

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

Azure Policy JSONPrivateLink_AllowedSku_Audit.json · 50 lines
{
  "properties": {
    "displayName": "App Configuration should use a SKU that supports private link",
    "description": "When using a supported SKU, Azure Private Link lets you connect your virtual network to Azure services without a public IP address at the source or destination. The private link platform handles the connectivity between the consumer and services over the Azure backbone network. By mapping private endpoints to your app configuration instances instead of the entire service, you'll also be protected against data leakage risks. Learn more at: https://aka.ms/appconfig/private-endpoint.",
    "metadata": {
      "version": "1.0.0",
      "category": "App Configuration"
    },
    "version": "1.0.0",
    "policyType": "BuiltIn",
    "mode": "Indexed",
    "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.AppConfiguration/configurationStores"
          },
          {
            "field": "Microsoft.AppConfiguration/configurationStores/sku.name",
            "equals": "Free"
          }
        ]
      },
      "then": {
        "effect": "[parameters('effect')]"
      }
    },
    "versions": [
      "1.0.0"
    ]
  },
  "id": "/providers/Microsoft.Authorization/policyDefinitions/89c8a434-18f0-402c-8147-630a8dea54e0",
  "name": "89c8a434-18f0-402c-8147-630a8dea54e0"
}
Bylaw89c8a434-18f0-402c-8147-630a8dea54e0.bylaw.ps1 · 28 lines
# Converted from PrivateLink_AllowedSku_Audit.json by ConvertTo-Bylaw.
Policy '89c8a434-18f0-402c-8147-630a8dea54e0' {

    Properties @{
        DisplayName   = 'App Configuration should use a SKU that supports private link'
        Description   = 'When using a supported SKU, Azure Private Link lets you connect your virtual network to Azure services without a public IP address at the source or destination. The private link platform handles the connectivity between the consumer and services over the Azure backbone network. By mapping private endpoints to your app configuration instances instead of the entire service, you''ll also be protected against data leakage risks. Learn more at: https://aka.ms/appconfig/private-endpoint.'
        Version       = '1.0.0'
        Category      = 'App Configuration'
        PolicyVersion = '1.0.0'
        Mode          = 'Indexed'
    }

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

    Resource 'Microsoft.AppConfiguration/configurationStores' {

        Require 'sku.name is not Free' {
            Field sku.name | Must -Not -Be 'Free' -IfPresent
        }
    }

    Effect (Param Effect)
}

Source: built-in-policies/policyDefinitions/App Configuration/PrivateLink_AllowedSku_Audit.json in Azure/azure-policy, under the MIT licence.