Gallery › Machine Learning › Azure built-in policies
Azure Machine Learning workspaces should use user-assigned managed identity
Converted Policy Audit Deny Disabled Mode Indexed Version 1.0.0
Manange access to Azure ML workspace and associated resources, Azure Container Registry, KeyVault, Storage, and App Insights using user-assigned managed identity. By default, system-assigned managed identity is used by Azure ML workspace to access the associated resources. User-assigned managed identity allows you to create the identity as an Azure resource and maintain the life cycle of that identity. Learn more at https://docs.microsoft.com/azure/machine-learning/how-to-use-managed-identities?tabs=python.
ConvertTo-Bylaw converted this policy, and proved that the file compiles back to the same definition.
{
"properties": {
"displayName": "Azure Machine Learning workspaces should use user-assigned managed identity",
"policyType": "BuiltIn",
"mode": "Indexed",
"description": "Manange access to Azure ML workspace and associated resources, Azure Container Registry, KeyVault, Storage, and App Insights using user-assigned managed identity. By default, system-assigned managed identity is used by Azure ML workspace to access the associated resources. User-assigned managed identity allows you to create the identity as an Azure resource and maintain the life cycle of that identity. Learn more at https://docs.microsoft.com/azure/machine-learning/how-to-use-managed-identities?tabs=python.",
"metadata": {
"version": "1.0.0",
"category": "Machine Learning"
},
"version": "1.0.0",
"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.MachineLearningServices/workspaces"
},
{
"anyOf": [
{
"field": "Microsoft.MachineLearningServices/workspaces/primaryUserAssignedIdentity",
"exists": false
},
{
"field": "Microsoft.MachineLearningServices/workspaces/primaryUserAssignedIdentity",
"equals": ""
}
]
}
]
},
"then": {
"effect": "[parameters('effect')]"
}
},
"versions": [
"1.0.0"
]
},
"id": "/providers/Microsoft.Authorization/policyDefinitions/5f0c7d88-c7de-45b8-ac49-db49e72eaa78",
"name": "5f0c7d88-c7de-45b8-ac49-db49e72eaa78"
}# Converted from Workspace_UAIEnabled_Audit.json by ConvertTo-Bylaw.
Policy '5f0c7d88-c7de-45b8-ac49-db49e72eaa78' {
Properties @{
DisplayName = 'Azure Machine Learning workspaces should use user-assigned managed identity'
Description = 'Manange access to Azure ML workspace and associated resources, Azure Container Registry, KeyVault, Storage, and App Insights using user-assigned managed identity. By default, system-assigned managed identity is used by Azure ML workspace to access the associated resources. User-assigned managed identity allows you to create the identity as an Azure resource and maintain the life cycle of that identity. Learn more at https://docs.microsoft.com/azure/machine-learning/how-to-use-managed-identities?tabs=python.'
Version = '1.0.0'
Category = 'Machine Learning'
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.MachineLearningServices/workspaces' {
Require 'primaryUserAssignedIdentity exists' {
Field primaryUserAssignedIdentity | Must -Exist
}
Require 'primaryUserAssignedIdentity is not' {
Field primaryUserAssignedIdentity | Must -Not -Be '' -IfPresent
}
}
Effect (Param Effect)
}Source: built-in-policies/policyDefinitions/Machine Learning/Workspace_UAIEnabled_Audit.json in Azure/azure-policy, under the MIT licence.
Bylaw