skip to content
Alvin Lucillo

Migrate state to az

/ 1 min read

💻 Tech

If you already have Terraform state files from your workspaces in your local machine, you can move them to Azure Blob Storage:

  1. Create the backend configuration
  backend "azurerm" {
      container_name        = "container"
      key                   = "tfstate"
      resource_group_name   = "rgname"
      storage_account_name  = "scname"
  }
  1. Ensure those resources in step #2 exist in Azure Blob Storage and that your az cli is already authenticated
  2. Run terraform init -migrate-state