Azure / azure-policy

Repository for Azure Resource Policy built-in definitions and samples
MIT License
1.49k stars 1.08k forks source link

Built-in Policy Release 090250c3 #1287

Closed gokmen-msft closed 5 months ago

gokmen-msft commented 6 months ago

Built-in policies pulled from commit 090250c315b0bca9f4be15860658640dabbefee7

rajeews commented 5 months ago

@gokmen-msft @robga Hi, We have automation built to compare built-in azure policies to our existing policy catalog and record the results. It seems this PR changed the name of all the policies (checked randomly) and which unfortunately broke our automation. We would like to know;

  1. Was the intention of this PR to rename all built-in policies?
  2. Is this something you are planning to often in the future?
  3. Is there a way to identify a policy uniquely even if the name changes via such PRs?

Thanks, Rajeew.

robga commented 5 months ago

@rajeew, sorry for the inconvenience.

  1. The reason was we changed the folder structure in our internal repo. I have to shorten the file name to work around the Windows path length limit. It's a one-time migration.
  2. It won't be often. But I am aware that our partner is working on renaming all of the 'Monitoring' category built-in filenames. We cannot guarantee that there won't be another rename.
  3. The name/ID is the identifier of each built-in. It will never change. I'd suggest to traversal the folder to parse every file to json to create a map using the name of each built-in. Please be aware the folder https://github.com/Azure/azure-policy/tree/master/built-in-policies/policyDefinitions/Azure%20Government is for the built-ins in U.S. government cloud. The rest of folders are for public cloud. The built-in policies in different clouds are using the same name/ID. So, you will need to exclude the 'Azure Government' folder when traversal the files.
rajeews commented 5 months ago

Thanks for the prompt response, Robert. We will switch to definition name. Good to know about additional context around gov cloud policies, will exclude that as well. Have a good day.