Gallery › Communication › Azure built-in policies
Communication service resource should use allow listed data location
Converted Policy Audit Deny Disabled Mode Indexed Version 1.0.0
Create a Communication service resource only from an allow listed data location. This data location determines where the data of the communication service resource will be stored at rest, ensuring your preferred allow listed data locations as this cannot be changed after resource creation.
ConvertTo-Bylaw converted this policy, and proved that the file compiles back to the same definition.
Azure Policy JSONCommunication_DataLocation_Audit.json · 57 lines
{
"properties": {
"displayName": "Communication service resource should use allow listed data location",
"policyType": "BuiltIn",
"mode": "Indexed",
"description": "Create a Communication service resource only from an allow listed data location. This data location determines where the data of the communication service resource will be stored at rest, ensuring your preferred allow listed data locations as this cannot be changed after resource creation.",
"metadata": {
"version": "1.0.0",
"category": "Communication"
},
"version": "1.0.0",
"parameters": {
"allowedDataLocations": {
"type": "Array",
"metadata": {
"displayName": "Allowed data locations",
"description": "The list of allowed data locations for your communication service resources."
}
},
"effect": {
"type": "String",
"defaultValue": "Audit",
"allowedValues": [
"Audit",
"Deny",
"Disabled"
],
"metadata": {
"displayName": "Effect",
"description": "The effect determines what happens when the policy rule is evaluated to match"
}
}
},
"policyRule": {
"if": {
"allOf": [
{
"field": "type",
"equals": "Microsoft.Communication/CommunicationServices"
},
{
"field": "Microsoft.Communication/communicationServices/dataLocation",
"notIn": "[parameters('allowedDataLocations')]"
}
]
},
"then": {
"effect": "[parameters('effect')]"
}
},
"versions": [
"1.0.0"
]
},
"id": "/providers/Microsoft.Authorization/policyDefinitions/93c45b74-42a1-4967-b25d-82c4dc630921",
"name": "93c45b74-42a1-4967-b25d-82c4dc630921"
}Bylaw93c45b74-42a1-4967-b25d-82c4dc630921.bylaw.ps1 · 33 lines
# Converted from Communication_DataLocation_Audit.json by ConvertTo-Bylaw.
Policy '93c45b74-42a1-4967-b25d-82c4dc630921' {
Properties @{
DisplayName = 'Communication service resource should use allow listed data location'
Description = 'Create a Communication service resource only from an allow listed data location. This data location determines where the data of the communication service resource will be stored at rest, ensuring your preferred allow listed data locations as this cannot be changed after resource creation.'
Version = '1.0.0'
Category = 'Communication'
PolicyVersion = '1.0.0'
Mode = 'Indexed'
}
Parameter AllowedDataLocations @{
Type = 'Array'
DisplayName = 'Allowed data locations'
Description = 'The list of allowed data locations for your communication service resources.'
}
Parameter Effect @{
AllowedValues = @('Audit', 'Deny', 'Disabled')
Default = 'Audit'
DisplayName = 'Effect'
Description = 'The effect determines what happens when the policy rule is evaluated to match'
}
Resource 'Microsoft.Communication/CommunicationServices' {
Require 'dataLocation is one of the AllowedDataLocations parameter' {
Field dataLocation | Must -BeIn (Param AllowedDataLocations)
}
}
Effect (Param Effect)
}Source: built-in-policies/policyDefinitions/Communication/Communication_DataLocation_Audit.json in Azure/azure-policy, under the MIT licence.
Bylaw