-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
OnlyDeployAllowedRegistryModels_Deny.json
83 lines (83 loc) · 2.82 KB
/
OnlyDeployAllowedRegistryModels_Deny.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
{
"properties": {
"displayName": "[Preview]: Azure Machine Learning Model Registry Deployments are restricted except for the allowed Registry",
"policyType": "BuiltIn",
"mode": "Microsoft.MachineLearningServices.v2.Data",
"description": "Only deploy Registry Models in the allowed Registry and that are not restricted.",
"metadata": {
"version": "1.0.0-preview",
"category": "Machine Learning",
"preview": true
},
"version": "1.0.0-preview",
"parameters": {
"allowedRegistryName": {
"type": "String",
"defaultValue": "",
"metadata": {
"displayName": "Allowed Registry Name",
"description": "The exact registry name where models are allowed to be deployed. If not set, by default all models from all registries will be restricted."
}
},
"restrictedModels": {
"type": "Array",
"defaultValue": [],
"metadata": {
"displayName": "Restricted Model AssetIds",
"description": "The list of Model AssetIds from the allowedRegistryName to be restricted from being deployed. If not set, by default all models from the allowedRegistryName will be allowed."
}
},
"effect": {
"type": "string",
"allowedValues": [
"Deny",
"Disabled"
],
"metadata": {
"displayName": "Effect",
"description": "'Deny' restricts deploying the registry models except for the allowedRegistryName."
}
}
},
"policyRule": {
"if": {
"allOf": [
{
"field": "type",
"equals": "Microsoft.MachineLearningServices.v2.Data/workspaces/deployments"
},
{
"anyOf": [
{
"field": "Microsoft.MachineLearningServices.v2.Data/workspaces/deployments/model.assetId",
"in": "[parameters('restrictedModels')]"
},
{
"allOf": [
{
"field": "Microsoft.MachineLearningServices.v2.Data/workspaces/deployments/model.assetId",
"like": "azureml://registries/*"
},
{
"not": {
"field": "Microsoft.MachineLearningServices.v2.Data/workspaces/deployments/model.assetId",
"like": "[concat('azureml://registries/', parameters('allowedRegistryName'), '/*')]"
}
}
]
}
]
}
]
},
"then": {
"effect": "[parameters('effect')]"
}
},
"versions": [
"1.0.0-PREVIEW"
]
},
"id": "/providers/Microsoft.Authorization/policyDefinitions/19539b54-c61e-4196-9a38-67598701be90",
"name": "19539b54-c61e-4196-9a38-67598701be90"
}