Gallery › Sovereignty › Azure built-in policies
[Preview]: Azure Machine Learning registry replica locations should use allowed locations
Converted Policy Audit Disabled Mode Indexed Version 1.0.0-preview Preview
Restrict the regions where Azure Machine Learning registries provision replicated backing resources to meet data residency and sovereignty requirements. This policy evaluates the locations configured in the registry region details.
ConvertTo-Bylaw converted this policy, and proved that the file compiles back to the same definition.
Azure Policy JSONAMLRegistryReplicaLocations_Audit.json · 64 lines
{
"properties": {
"displayName": "[Preview]: Azure Machine Learning registry replica locations should use allowed locations",
"policyType": "BuiltIn",
"mode": "Indexed",
"description": "Restrict the regions where Azure Machine Learning registries provision replicated backing resources to meet data residency and sovereignty requirements. This policy evaluates the locations configured in the registry region details.",
"metadata": {
"version": "1.0.0-preview",
"category": "Sovereignty",
"preview": true
},
"version": "1.0.0-preview",
"parameters": {
"allowedReplicaLocations": {
"type": "Array",
"metadata": {
"displayName": "Allowed replica locations",
"description": "The list of locations where Azure Machine Learning registries are allowed to provision replicated backing resources.",
"strongType": "location"
}
},
"effect": {
"type": "String",
"metadata": {
"displayName": "Effect",
"description": "Enable or disable the execution of the policy"
},
"allowedValues": [
"Audit",
"Disabled"
],
"defaultValue": "Audit"
}
},
"policyRule": {
"if": {
"allOf": [
{
"field": "type",
"equals": "Microsoft.MachineLearningServices/registries"
},
{
"count": {
"field": "Microsoft.MachineLearningServices/registries/regionDetails[*]",
"where": {
"value": "[replace(toLower(current('Microsoft.MachineLearningServices/registries/regionDetails[*].location')), ' ', '')]",
"notIn": "[parameters('allowedReplicaLocations')]"
}
},
"greater": 0
}
]
},
"then": {
"effect": "[parameters('effect')]"
}
},
"versions": [
"1.0.0-PREVIEW"
]
},
"id": "/providers/Microsoft.Authorization/policyDefinitions/c58f681b-52c4-4935-820b-e2ced188a98c",
"name": "c58f681b-52c4-4935-820b-e2ced188a98c"
}Bylawc58f681b-52c4-4935-820b-e2ced188a98c.bylaw.ps1 · 37 lines
# Converted from AMLRegistryReplicaLocations_Audit.json by ConvertTo-Bylaw.
Policy 'c58f681b-52c4-4935-820b-e2ced188a98c' {
Properties @{
DisplayName = '[Preview]: Azure Machine Learning registry replica locations should use allowed locations'
Description = 'Restrict the regions where Azure Machine Learning registries provision replicated backing resources to meet data residency and sovereignty requirements. This policy evaluates the locations configured in the registry region details.'
Version = '1.0.0-preview'
Category = 'Sovereignty'
Preview = $true
PolicyVersion = '1.0.0-preview'
Mode = 'Indexed'
}
Parameter AllowedReplicaLocations @{
Type = 'Array'
DisplayName = 'Allowed replica locations'
Description = 'The list of locations where Azure Machine Learning registries are allowed to provision replicated backing resources.'
Metadata = [ordered]@{ strongType = 'location' }
}
Parameter Effect @{
AllowedValues = @('Audit', 'Disabled')
Default = 'Audit'
DisplayName = 'Effect'
Description = 'Enable or disable the execution of the policy'
}
Resource 'Microsoft.MachineLearningServices/registries' {
Require 'regionDetails is as required' {
Count 'regionDetails[*]' -Where {
Arm '[replace(toLower(current(''Microsoft.MachineLearningServices/registries/regionDetails[*].location'')), '' '', '''')]' | Must -Not -BeIn (Param AllowedReplicaLocations)
} | Must -Be 0
}
}
Effect (Param Effect)
}Source: built-in-policies/policyDefinitions/Sovereignty/AMLRegistryReplicaLocations_Audit.json in Azure/azure-policy, under the MIT licence.
Bylaw