Bylaw

Gallery › Machine Learning › Azure built-in policies

[Preview]: Azure Machine Learning Model Registry Deployments are restricted except for the allowed Registry

Doesn't convert yet Policy Deny Disabled Mode Microsoft.MachineLearningServices.v2.Data Version 1.0.0-preview Preview

Only deploy Registry Models in the allowed Registry and that are not restricted.

ConvertTo-Bylaw can't convert this policy yet:

Azure Policy JSONOnlyDeployAllowedRegistryModels_Deny.json · 83 lines
{
  "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"
}

Source: built-in-policies/policyDefinitions/Machine Learning/OnlyDeployAllowedRegistryModels_Deny.json in Azure/azure-policy, under the MIT licence.