I made some ARM templates changes and unintentionally removed Access Policy items from an Azure Key Vault in a (thankfully) non-production environment. Since the ARM template doesn’t have the before state in the repository, reverting the pull request isn’t going to fix it.

However, we can get the before state of the template using Change history on the Activity log viewable on the Azure portal.

Change history

We can use Change history to see the before state of the ARM template. Copy paste the before state into a code editor. You may find it useful to run a ARM template deployment what-if operation to verify the template before proceeding. You may need to work with it a bit to get it in a working state.

Applying ARM template

To manually publish the ARM template to Azure, see The “Edit and deploy the template” anchor on “Quickstart: Create and deploy ARM templates by using the Azure portal”.

In Closing

I hope this is helpful if you find yourself needing to revert like I did.