user1197981
user1197981

Reputation: 163

Azure Resource tag change history/Restore deleted tags

We have an azure environment with multiple vms with a number of tags. A process ran overnight that replaced all the tags with another new tag(both key and value). I would like to recover the old tags. I am aware that the application change analysis feature will give me the details on GUI/portal.

I am looking to have this info ready to be exported(csv,txt etc), as we have 100s of VMs. Is there a powershell/CLI/any other method by which I can capture this data.

Upvotes: 0

Views: 2349

Answers (1)

Bhargavi Annadevara
Bhargavi Annadevara

Reputation: 5492

You can invoke the Resource Change History API that is in Public Preview.

With the last 14 days of change history, Azure Resource Graph enables you to:

  • Find when changes were detected on an Azure Resource Manager property
  • For each resource change, see property change details See a full
  • comparison of the resource before and after the detected change

For the preview, two API actions are now available in the Azure Resource Graph API:

  • resourceChanges: returns a list of change events for a resource and time interval
  • resourceChangeDetails: returns the before and after resource content for a given resource and change event

Check this article for the detailed description and examples.

Upvotes: 1

Related Questions