Gallery › Sovereignty › Azure built-in policies
[Preview]: Data Residency for Replication across Azure Services
Converted Initiative Version 1.2.0-preview Preview
Help restrict replication, replicated backups, and data processing to approved locations and security boundaries across supported Azure services.
ConvertTo-Bylaw converted this initiative, and proved that the file compiles back to the same definition.
Azure Policy JSONDataResidencyReplication.json · 251 lines
{
"properties": {
"displayName": "[Preview]: Data Residency for Replication across Azure Services",
"policyType": "BuiltIn",
"description": "Help restrict replication, replicated backups, and data processing to approved locations and security boundaries across supported Azure services.",
"metadata": {
"version": "1.2.0-preview",
"category": "Sovereignty",
"preview": true
},
"version": "1.2.0-preview",
"parameters": {
"effect_deny": {
"type": "String",
"metadata": {
"displayName": "Effect-Deny",
"description": "This effect applies to policies that support Deny or Audit effect."
},
"allowedValues": [
"Audit",
"Deny",
"Disabled"
],
"defaultValue": "Deny"
},
"effect_audit": {
"type": "String",
"metadata": {
"displayName": "Effect-Audit",
"description": "This effect applies to policies that only support Audit effect."
},
"allowedValues": [
"Audit",
"Disabled"
],
"defaultValue": "Audit"
},
"effect_auditIfNotExists": {
"type": "String",
"metadata": {
"displayName": "Effect-AuditIfNotExists",
"description": "This effect applies to policies that support AuditIfNotExists effect."
},
"allowedValues": [
"AuditIfNotExists",
"Disabled"
],
"defaultValue": "AuditIfNotExists"
},
"listOfAllowedLocations": {
"type": "Array",
"metadata": {
"displayName": "Allowed replication locations",
"description": "The list of Azure regions where replicated data and service data processing are allowed.",
"strongType": "location"
}
}
},
"policyDefinitions": [
{
"policyDefinitionReferenceId": "allowedReplicationLocationsCosmosDB",
"policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/0473574d-2d43-4217-aefe-941fcdf7e684",
"definitionVersion": "1.*.*",
"parameters": {
"policyEffect": {
"value": "[parameters('effect_deny')]"
},
"listOfAllowedLocations": {
"value": "[parameters('listOfAllowedLocations')]"
}
}
},
{
"policyDefinitionReferenceId": "allowedDefaultSecondaryLocationSqlDatabase",
"policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/4778c705-6ec3-4a0e-86bb-01b7da8a5bf4",
"definitionVersion": "1.*.*-preview",
"parameters": {
"effect": {
"value": "[parameters('effect_audit')]"
},
"allowedDefaultSecondaryLocations": {
"value": "[parameters('listOfAllowedLocations')]"
}
}
},
{
"policyDefinitionReferenceId": "allowedGeoReplicationLocationsServiceBus",
"policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/9bf20ff2-0f28-47ea-ab41-0d070cf1d73b",
"definitionVersion": "1.*.*-preview",
"parameters": {
"effect": {
"value": "[parameters('effect_audit')]"
},
"allowedGeoReplicationLocations": {
"value": "[parameters('listOfAllowedLocations')]"
}
}
},
{
"policyDefinitionReferenceId": "allowedGeoReplicationLocationsEventHubs",
"policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/28db9b68-6637-453e-afc5-1dbb3b16df1b",
"definitionVersion": "1.*.*-preview",
"parameters": {
"effect": {
"value": "[parameters('effect_audit')]"
},
"allowedGeoReplicationLocations": {
"value": "[parameters('listOfAllowedLocations')]"
}
}
},
{
"policyDefinitionReferenceId": "allowedReplicaLocationsAPIManagement",
"policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/a2713d30-18dc-48a3-8e2f-0966c2133989",
"definitionVersion": "1.*.*-preview",
"parameters": {
"effect": {
"value": "[parameters('effect_audit')]"
},
"allowedReplicaLocations": {
"value": "[parameters('listOfAllowedLocations')]"
}
}
},
{
"policyDefinitionReferenceId": "allowedDefaultSecondaryLocationSqlManagedInstanceDatabase",
"policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/25ff226b-1747-454d-8ae2-0c11e0935753",
"definitionVersion": "1.*.*-preview",
"parameters": {
"effect": {
"value": "[parameters('effect_audit')]"
},
"allowedDefaultSecondaryLocations": {
"value": "[parameters('listOfAllowedLocations')]"
}
}
},
{
"policyDefinitionReferenceId": "allowedReplicaLocationsIoTDps",
"policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/92af37fe-f8ff-4ebd-883d-2f80cd765f8f",
"definitionVersion": "1.*.*-preview",
"parameters": {
"effect": {
"value": "[parameters('effect_audit')]"
},
"allowedReplicaLocations": {
"value": "[parameters('listOfAllowedLocations')]"
}
}
},
{
"policyDefinitionReferenceId": "allowedSecondaryLocationsIoTHub",
"policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/93fc07ef-f4b9-418a-9190-6e2628e72856",
"definitionVersion": "1.*.*-preview",
"parameters": {
"effect": {
"value": "[parameters('effect_audit')]"
},
"allowedSecondaryLocations": {
"value": "[parameters('listOfAllowedLocations')]"
}
}
},
{
"policyDefinitionReferenceId": "allowedReplicaLocationsManagedHsm",
"policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/0eb02880-8961-46b2-a106-107bb2058f00",
"definitionVersion": "1.*.*-preview",
"parameters": {
"effect": {
"value": "[parameters('effect_audit')]"
},
"allowedReplicaLocations": {
"value": "[parameters('listOfAllowedLocations')]"
}
}
},
{
"policyDefinitionReferenceId": "allowedReplicaLocationsAMLRegistry",
"policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/c58f681b-52c4-4935-820b-e2ced188a98c",
"definitionVersion": "1.*.*-preview",
"parameters": {
"effect": {
"value": "[parameters('effect_audit')]"
},
"allowedReplicaLocations": {
"value": "[parameters('listOfAllowedLocations')]"
}
}
},
{
"policyDefinitionReferenceId": "allowedFailoverGroupPartnerLocationsSqlManagedDatabase",
"policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/99645d66-5f63-4f02-b947-46de4e9a040e",
"definitionVersion": "1.*.*-preview",
"parameters": {
"effect": {
"value": "[parameters('effect_auditIfNotExists')]"
},
"listOfAllowedLocations": {
"value": "[parameters('listOfAllowedLocations')]"
}
}
},
{
"policyDefinitionReferenceId": "allowedReplicaLocationsLogAnalyticsWorkspace",
"policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/1ab7fa8d-5574-4983-97ed-2a184ca9526e",
"definitionVersion": "1.*.*-preview",
"parameters": {
"effect": {
"value": "[parameters('effect_audit')]"
},
"allowedReplicaLocations": {
"value": "[parameters('listOfAllowedLocations')]"
}
}
},
{
"policyDefinitionReferenceId": "allowedReplicaLocationsNetAppVolume",
"policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/9860282b-3c80-4538-8bd7-dbc8cf012c6e",
"definitionVersion": "1.*.*-preview",
"parameters": {
"effect": {
"value": "[parameters('effect_audit')]"
},
"allowedReplicaLocations": {
"value": "[parameters('listOfAllowedLocations')]"
}
}
},
{
"policyDefinitionReferenceId": "allowedPartnerLocationsSqlFailoverGroup",
"policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/e4bff06e-8af8-455b-8bec-58515205f65b",
"definitionVersion": "1.*.*-preview",
"parameters": {
"effect": {
"value": "[parameters('effect_audit')]"
},
"allowedPartnerLocations": {
"value": "[parameters('listOfAllowedLocations')]"
}
}
}
],
"versions": [
"1.2.0-PREVIEW",
"1.1.0-PREVIEW",
"1.0.0-PREVIEW"
]
},
"id": "/providers/Microsoft.Authorization/policySetDefinitions/35877bcb-9bd2-49fc-8a00-4614b3a0e73a",
"name": "35877bcb-9bd2-49fc-8a00-4614b3a0e73a"
}Bylaw35877bcb-9bd2-49fc-8a00-4614b3a0e73a.bylaw.ps1 · 177 lines
# Converted from DataResidencyReplication.json by ConvertTo-Bylaw.
Initiative '35877bcb-9bd2-49fc-8a00-4614b3a0e73a' {
Properties @{
DisplayName = '[Preview]: Data Residency for Replication across Azure Services'
Description = 'Help restrict replication, replicated backups, and data processing to approved locations and security boundaries across supported Azure services.'
Version = '1.2.0-preview'
Category = 'Sovereignty'
Preview = $true
PolicyVersion = '1.2.0-preview'
}
Parameter Effect_deny @{
AllowedValues = @('Audit', 'Deny', 'Disabled')
Default = 'Deny'
DisplayName = 'Effect-Deny'
Description = 'This effect applies to policies that support Deny or Audit effect.'
}
Parameter Effect_audit @{
AllowedValues = @('Audit', 'Disabled')
Default = 'Audit'
DisplayName = 'Effect-Audit'
Description = 'This effect applies to policies that only support Audit effect.'
}
Parameter Effect_auditIfNotExists @{
AllowedValues = @('AuditIfNotExists', 'Disabled')
Default = 'AuditIfNotExists'
DisplayName = 'Effect-AuditIfNotExists'
Description = 'This effect applies to policies that support AuditIfNotExists effect.'
}
Parameter ListOfAllowedLocations @{
Type = 'Array'
DisplayName = 'Allowed replication locations'
Description = 'The list of Azure regions where replicated data and service data processing are allowed.'
Metadata = [ordered]@{ strongType = 'location' }
}
PolicyDefinition @{
Id = '0473574d-2d43-4217-aefe-941fcdf7e684'
ReferenceId = 'allowedReplicationLocationsCosmosDB'
Version = '1.*.*'
Parameters = [ordered]@{
policyEffect = (Param Effect_deny)
listOfAllowedLocations = (Param ListOfAllowedLocations)
}
}
PolicyDefinition @{
Id = '4778c705-6ec3-4a0e-86bb-01b7da8a5bf4'
ReferenceId = 'allowedDefaultSecondaryLocationSqlDatabase'
Version = '1.*.*-preview'
Parameters = [ordered]@{
effect = (Param Effect_audit)
allowedDefaultSecondaryLocations = (Param ListOfAllowedLocations)
}
}
PolicyDefinition @{
Id = '9bf20ff2-0f28-47ea-ab41-0d070cf1d73b'
ReferenceId = 'allowedGeoReplicationLocationsServiceBus'
Version = '1.*.*-preview'
Parameters = [ordered]@{
effect = (Param Effect_audit)
allowedGeoReplicationLocations = (Param ListOfAllowedLocations)
}
}
PolicyDefinition @{
Id = '28db9b68-6637-453e-afc5-1dbb3b16df1b'
ReferenceId = 'allowedGeoReplicationLocationsEventHubs'
Version = '1.*.*-preview'
Parameters = [ordered]@{
effect = (Param Effect_audit)
allowedGeoReplicationLocations = (Param ListOfAllowedLocations)
}
}
PolicyDefinition @{
Id = 'a2713d30-18dc-48a3-8e2f-0966c2133989'
ReferenceId = 'allowedReplicaLocationsAPIManagement'
Version = '1.*.*-preview'
Parameters = [ordered]@{
effect = (Param Effect_audit)
allowedReplicaLocations = (Param ListOfAllowedLocations)
}
}
PolicyDefinition @{
Id = '25ff226b-1747-454d-8ae2-0c11e0935753'
ReferenceId = 'allowedDefaultSecondaryLocationSqlManagedInstanceDatabase'
Version = '1.*.*-preview'
Parameters = [ordered]@{
effect = (Param Effect_audit)
allowedDefaultSecondaryLocations = (Param ListOfAllowedLocations)
}
}
PolicyDefinition @{
Id = '92af37fe-f8ff-4ebd-883d-2f80cd765f8f'
ReferenceId = 'allowedReplicaLocationsIoTDps'
Version = '1.*.*-preview'
Parameters = [ordered]@{
effect = (Param Effect_audit)
allowedReplicaLocations = (Param ListOfAllowedLocations)
}
}
PolicyDefinition @{
Id = '93fc07ef-f4b9-418a-9190-6e2628e72856'
ReferenceId = 'allowedSecondaryLocationsIoTHub'
Version = '1.*.*-preview'
Parameters = [ordered]@{
effect = (Param Effect_audit)
allowedSecondaryLocations = (Param ListOfAllowedLocations)
}
}
PolicyDefinition @{
Id = '0eb02880-8961-46b2-a106-107bb2058f00'
ReferenceId = 'allowedReplicaLocationsManagedHsm'
Version = '1.*.*-preview'
Parameters = [ordered]@{
effect = (Param Effect_audit)
allowedReplicaLocations = (Param ListOfAllowedLocations)
}
}
PolicyDefinition @{
Id = 'c58f681b-52c4-4935-820b-e2ced188a98c'
ReferenceId = 'allowedReplicaLocationsAMLRegistry'
Version = '1.*.*-preview'
Parameters = [ordered]@{
effect = (Param Effect_audit)
allowedReplicaLocations = (Param ListOfAllowedLocations)
}
}
PolicyDefinition @{
Id = '99645d66-5f63-4f02-b947-46de4e9a040e'
ReferenceId = 'allowedFailoverGroupPartnerLocationsSqlManagedDatabase'
Version = '1.*.*-preview'
Parameters = [ordered]@{
effect = (Param Effect_auditIfNotExists)
listOfAllowedLocations = (Param ListOfAllowedLocations)
}
}
PolicyDefinition @{
Id = '1ab7fa8d-5574-4983-97ed-2a184ca9526e'
ReferenceId = 'allowedReplicaLocationsLogAnalyticsWorkspace'
Version = '1.*.*-preview'
Parameters = [ordered]@{
effect = (Param Effect_audit)
allowedReplicaLocations = (Param ListOfAllowedLocations)
}
}
PolicyDefinition @{
Id = '9860282b-3c80-4538-8bd7-dbc8cf012c6e'
ReferenceId = 'allowedReplicaLocationsNetAppVolume'
Version = '1.*.*-preview'
Parameters = [ordered]@{
effect = (Param Effect_audit)
allowedReplicaLocations = (Param ListOfAllowedLocations)
}
}
PolicyDefinition @{
Id = 'e4bff06e-8af8-455b-8bec-58515205f65b'
ReferenceId = 'allowedPartnerLocationsSqlFailoverGroup'
Version = '1.*.*-preview'
Parameters = [ordered]@{
effect = (Param Effect_audit)
allowedPartnerLocations = (Param ListOfAllowedLocations)
}
}
}Members (14)
- Azure Cosmos DB allowed locations
- [Preview]: Azure SQL databases with a default secondary location should use an allowed location
- [Preview]: Azure Service Bus geo-replication locations should use allowed regions
- [Preview]: Azure Event Hubs geo-replication locations should use allowed regions
- [Preview]: Azure API Management additional gateway locations should use allowed locations
- [Preview]: Azure SQL Managed Instance databases with a default secondary location should use an allowed location
- [Preview]: IoT Hub Device Provisioning Service linked IoT Hub locations should use allowed locations
- [Preview]: Azure IoT Hub disaster recovery secondary locations should use allowed locations
- [Preview]: Azure Key Vault Managed HSM extended regions should use allowed locations
- [Preview]: Azure Machine Learning registry replica locations should use allowed locations
- [Preview]: SQL Managed Instance databases should use failover groups with partner regions in allowed locations
- [Preview]: Log Analytics workspace replicas should use allowed locations
- [Preview]: Azure NetApp Files volumes should replicate only with volumes in allowed locations
- [Preview]: Azure SQL Database failover groups should use allowed partner locations
Source: built-in-policies/policySetDefinitions/Sovereignty/DataResidencyReplication.json in Azure/azure-policy, under the MIT licence.
Bylaw