Azure resources and resource groups in different regions
While working on a client project, I ran into some strange behavior with Azure and Terraform.
It is entirely possible to have Azure resources created in a different region from their parent Resource Group. But I’ll let you in on a secret: it is not a good idea.
The metadata for the resources is stored within the Resource Group. If they are in different regions, Azure has to constantly sync this metadata across regions. Not only can this incur data transfer charges, but it also introduces a sync delay.
I started seeing issues where I would delete a resource via Terraform and try to recreate it, only for Azure to report an error saying a resource with the same name already existed. Either the deletion didn’t complete, or the Resource Group was still seeing the old state due to the sync delay.
It turns out there’s a better way: just keep your resources and their Resource Groups in the same region. I hope this helps.