azureazure-policy

Azure policy Inherith tags from resource groups


currently we have implemented a modify policy that inherit tags from the resource group to the resources.

The resource group have only 15 tags, I know that the limit is around 50 max

But I am seeing this error when the remediation task is executed, just with some Automation accounts, I am pretty sure that I am not reaching the max tags as I said before, but seems that is something special with the automation account that I am missing.

{"code":"BadRequest","message":"{"Message":"The request is invalid.","ModelState":{"delta.tags":["Too many tags."]}}"}', Correlation Id: '517cdcdb-72a2-4d59-ab2b-9bc493b4708a'.

is there anyone went through this before?


Solution

  • Azure policy Inherith tags from resource groups

    The Azure Automation account supports only 15 tags, not 50 tags. Additionally, the default policy includes one required tag. If the resource group already has 15 tags, adding the tag from the Azure policy makes it a total of 16 tags. This exceeds the limit, which is why you are encountering the "too many tags" issue for the Automation account. Follow the MS Doc more details.

    enter image description here

    To resolve the issue, you can either remove one tag from the resource group or modify the default policy to remove the mandatory tag. This ensures that all 15 tags in the resource group will be inherited by the resources without exceeding the limit.

    enter image description here

    Reference: Inherit a tag from the resource group