POST POST

NOV
11
2022

Removing Azure Backups in Terraform

ORIGINALLY POSTED TO: https://blog.simontimms.com/2022/11/11/azure-backus-protip

If you have a VM backup in your Terraform state and need to get rid of it be aware that it is probably going to break your deployment pipeline. The reason is that Terraform will delete the item but then find that the resource still there. This is because backup deletion takes a while (say 14 days). Eventually the backup will delete but not before Terraform times out.

The solution I'm using is to just go in an manually delete the backup from the terraform state to unblock my pipelines.

1
2
3
terraform state list | grep <name of your backup>
-- make note of the resource identifier --
terraform state rm <found resource identifier>

Editing Terraform state seems scary but it's not too bad after you do it a bit. Take backups!


Simon Timms

Email Email
Web Web
Twitter Twitter
GitHub GitHub
RSS

Looking for someone else?

You can find the rest of the Western Devs Crew here.

© 2015 Western Devs. All Rights Reserved. Design by Karen Chudobiak, Graphic Designer