创建没有标签的资源组时Azure策略的怪异行为 [英] Azure Policy weird behaviour while creating resource group without tag

查看:75
本文介绍了创建没有标签的资源组时Azure策略的怪异行为的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

团队,

谢谢,我已经应用了下面提到的Azure策略,当我创建一个新的VM,然后填写所有字段时,我在同一向导中创建了一个资源组,然后单击查看并创建"按钮.这次天青政策已正确触发, 阻止了我,因为新创建的RG没有使用标签创建.

Thanks in advance, I've applied Azure policy mentioned below and when i create a new VM and then fill in all the fields, i create a Resource Group in the same wizard and then click review and create button. This time azure policy is triggered properly and blocks me as the newly created RG is not created with tag.

但是当我转到资源组策略并单击添加"以创建新的RG时.那个时候我不填写标签,那么政策也不会触发.

But when i goto resource group policy and click on Add to create a new RG. that time i don't fill Tags then too policy doesn't get trigger.

为什么这项政策第一次生效却第二次没有生效

I'm little surprise why the first time this policy worked but not the second time

{
  "if": {
    "allOf": [
      {
        "field": "tags",
        "exists": "false"
      },
      {
        "field": "type",
        "equals": "Microsoft.Resources/subscriptions/resourceGroups"
      }
    ]
  },
  "then": {
    "effect": "deny"
  }

}

推荐答案

@Aquib Qureshi,我看到您在 堆栈溢出,并一直在积极接收响应.为避免混乱/重复,建议您在上述平台上继续进行对话.
@Aquib Qures I see that you've raised this query on GitHub as well as on Stack Overflow and has been receiving responses actively. To avoid confusion/duplicity, suggest you continue the conversation on the above platforms.


这篇关于创建没有标签的资源组时Azure策略的怪异行为的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆