Search code examples
azureazure-marketplace

Is there any way how to restrict access/buy at Azure Marketplace?


is there any way how to restrict access or buy permissions at Azure Marketplace?


Solution

  • You can create a policy like the one below to restrict compute resources from a specific publisher -

            {
              "policyRule": {
                "if": {
                  "allOf": [
                    {
                      "field": "Microsoft.Compute/imagePublisher",
                      "match": "[parameters('NotAllowedImage')]"
                    }
                  ]
                },
                "then": {
                  "effect": "Deny"
                }
              },
              "parameters": {
                "NotAllowedImage": {
                  "type": "String",
                  "metadata": {
                    "displayName": "Not Allowed  Image",
                    "description": "Not Allowed Image for Virtual Machine/Compute"
                  }
                }
              },
              "metadata": {
                "category": "Compute"
              }
            }
    

    When you assign this image to a subscription or a resource group then at the time you will be asked to enter a value for the image name you would like to restrict , please enter "checkpoint" as your publisher name as this is the one you want to restrict. Save the assignment.

    Now once you create a vm/compute resource from "checkpoint" this would fail the validation step as the policy would not allow to create such vm/compute resource.

    The Category of the check point resources I see in market place is compute only. Screenshot market place resource