Bylaw

Gallery › General › Azure built-in policies

[Deprecated]: Allow resource creation only in Asia data centers

Converted Policy Deny Mode Indexed Version 1.0.0-deprecated Deprecated

Allows resource creation in the following locations only: East Asia, Southeast Asia, West India, South India, Central India, Japan East, Japan West

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

Azure Policy JSONAsiaRegionsOnly_Deny.json · 39 lines
{
  "properties": {
    "displayName": "[Deprecated]: Allow resource creation only in Asia data centers",
    "policyType": "BuiltIn",
    "mode": "Indexed",
    "description": "Allows resource creation in the following locations only: East Asia, Southeast Asia, West India, South India, Central India, Japan East, Japan West",
    "metadata": {
      "version": "1.0.0-deprecated",
      "category": "General",
      "deprecated": true
    },
    "version": "1.0.0",
    "parameters": {},
    "policyRule": {
      "if": {
        "not": {
          "field": "location",
          "in": [
            "eastasia",
            "southeastasia",
            "westindia",
            "southindia",
            "centralindia",
            "japaneast",
            "japanwest"
          ]
        }
      },
      "then": {
        "effect": "Deny"
      }
    },
    "versions": [
      "1.0.0"
    ]
  },
  "id": "/providers/Microsoft.Authorization/policyDefinitions/c1b9cbed-08e3-427d-b9ce-7c535b1e9b94",
  "name": "c1b9cbed-08e3-427d-b9ce-7c535b1e9b94"
}
Bylawc1b9cbed-08e3-427d-b9ce-7c535b1e9b94.bylaw.ps1 · 22 lines
# Converted from AsiaRegionsOnly_Deny.json by ConvertTo-Bylaw.
Policy 'c1b9cbed-08e3-427d-b9ce-7c535b1e9b94' {

    Properties @{
        DisplayName   = '[Deprecated]: Allow resource creation only in Asia data centers'
        Description   = 'Allows resource creation in the following locations only: East Asia, Southeast Asia, West India, South India, Central India, Japan East, Japan West'
        Version       = '1.0.0-deprecated'
        Category      = 'General'
        Deprecated    = $true
        PolicyVersion = '1.0.0'
        Mode          = 'Indexed'
    }

    Resource * {

        Require 'location is one of 7 values' {
            Field location | Must -BeIn @('eastasia', 'southeastasia', 'westindia', 'southindia', 'centralindia', 'japaneast', 'japanwest')
        }
    }

    Effect Deny
}

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