简体   繁体   English

如何通过 Azure Policy 限制“发布者”

[英]How to restrict "Publisher" by Azure Policy

we have hard time, because we are trying to restrict specific "Publishers" by Azure Policy but we find only how to restrict a "Type".我们很难,因为我们试图通过 Azure Policy 限制特定的“发布者”,但我们只找到了如何限制“类型”的方法。 Isnt there a noble soul, who know, how to help us?难道没有一个高贵的灵魂,谁知道,如何帮助我们?

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.当您将此图像分配给订阅或资源组时,系统会要求您输入要限制的图像名称的值。 Save the assignment.保存作业。

Now once you create a vm/compute resource from the denied image publisher then it would fail the validation step as the policy would not allow to create such vm/compute resource.现在,一旦您从被拒绝的映像发布者创建了 vm/compute 资源,验证步骤就会失败,因为策略不允许创建此类 vm/compute 资源。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何通过策略将公共 IP 限制为所有 Azure 开发测试实验室 - How to restrict public IP to all Azure DevTest Labs by policy 如何向使用 Azure 服务总线 Java SDK 的发布者/订阅者客户端添加重试选项(重试策略)? - How to add retry options (retry policy) to publisher/subscriber client which uses Azure Service Bus Java SDK? 如何使用 Azure Policy 限制对网络安全组的任何/任何 RDP 和 SSH 访问? - How to Restrict Any/Any RDP & SSH access on network security groups using Azure Policy? 将 azure 角色分配限制为仅按 azure policy 分组 - Restrict azure role assignment only to group by azure policy 如何创建 Azure 策略? - How to create Azure Policy? Azure 存储 - 使用存储访问策略时限制 SAS 中的 IP - Azure Storage - Restrict IP in SAS when using Stored Access Policy 如何在 Azure 门户上限制用户 - How to restrict users on Azure Portal 如何找到天蓝色政策的流程 - how to find the flow of azure policy 如何在Azure策略中准备JSON - How to prepare JSON in Azure Policy 如何上传 azure 自定义策略 - How to upload azure custom policy
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM