📅
⏱️ 2 min read (272 words)
Recently, I encountered a challenge with Azure Policy while implementing an “Allowed Locations” policy to ensure resources deployed in the correct regions. Similar to the one listed here but it’s our own custom one to allow us to make our own modifications - AzAdvertizer.net
Our custom policy, configured with “All” mode, was unexpectedly interfering with the creation of new Key Vault access policies.
After careful investigation, we compared our custom policy with the built-in Azure Policy for “Allowed Locations.” This built-in policy, designed specifically for this purpose, leverages the “Indexed” mode. This key difference was the root cause of the issue.
Since these KeyVault access policies don’t have a direct location property, the “All” mode triggered policy evaluation for them, causing unintended consequences. We were unable to create new access policies for our Key Vaults.
We promptly updated our custom policy to use “Indexed” mode. This change immediately resolved the problem with Key Vault access policy creation.
Azure Policy is a powerful tool, but a thorough understanding of its features is essential. A bit of extra research and careful planning can save you from significant challenges down the line.
I hope this blog post resonates with you!