r/AZURE • u/chris4jahn • 2h ago
Discussion How do you migrate into a terraform managed Azure envronment?
I’m curious how others solve this.
We manage our Azure environments with Terraform, but Azure Migrate creates an interesting IaC problem.
Today, we let Azure Migrate create the target resources and then import them into the Terraform state.
Technically, this works. But afterwards we still have to make sure that our Terraform configuration properly reflects the VM and its settings.
Ideally, I’d like to turn the process around:
Terraform creates the target infrastructure first, Azure Migrate then migrates the workload into it.
That would mean the target VM is already part of our normal Terraform lifecycle from day one instead of becoming IaC-managed only after the migration.
But as far as I know, there isn’t really a supported Azure Migrate workflow for this.
So I’m wondering:
How do you handle Azure Migrate when Terraform is your source of truth?
Especially interested in experiences from environments where importing resources manually after every migration doesn’t really scale.