Azure Policy to add tag values for single tag name

无人久伴 提交于 2020-01-06 06:44:33

问题


Need to assign a policy in Azure, where the resources are to be deployed only using the specified tag names and values. We need to add a Tag name for which there can be multiple Tag values depending upon the scenario.

For Example,

Tag Name: Environment

Tag Value: Prod, Non-Prod, UAT, Test

So, here the Tag Name is same for all the values, and the values will change accordingly for different scenarios. What could be the code for the same?


回答1:


You can user Azure Policy Framework and there is built-in definition for your requirement- "Enforces existence of a tag. Does not apply to resource groups."

Steps to create assignment from portal is specified here. This will not allow creation of resources without tag. You can checkout more in built definitions from Azure Portal



来源:https://stackoverflow.com/questions/56629219/azure-policy-to-add-tag-values-for-single-tag-name

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!