I have an use case like this: the dev team creates resource groups and resources in it, using azure devops pipelines. One of the pipelines steps, is to assign role to a newly created Key Vault with a newly create web app. I would like to assign a role granting "assignment power" to the pipeline SP, only for the resource groups it creates, not for the whole subscription. Checked the ABAC (attribute based access control) documentation, at first look, it seems the right way, but I can only add conditions for Data Actions roles (for now only available for storage account).
Is there a way to achieve this without granting permission to the whole subscription? Like adding a role based on a tag?
Tried: Tested role conditions
Expecting: Assign a specific role (builtin or custom) to the newly created resource group.
You can assign a specific role to the newly created resource group based on a specific tag by using Azure Policy based on a specific tag.
Here is an
Azure policydefinition that assigns a specific role toresource groupsbased on a specifictag.Assign
Azure Policyin portal as below.The
ifclause of the policy rule specifies that the policy should only be evaluated if the resource group has the tagYourTagName. Thethenclause of the policy rule specifies that the role<roledefinition-Id>should be assigned to the resource group if the resource group has the tagYourTagNameand the value of the tag isYourTagValue.Reference: azure-docs/govern-tags.md at main · MicrosoftDocs/azure-docs · GitHub