- Lab
-
Libraries: If you want this lab, consider one of these libraries.
- Cloud

Migrate Terraform State to Terraform Cloud for Azure
In this hands-on lab, you will learn how to import Azure resources into Terraform state, view objects in Terraform state, and migrate your state to Terraform Cloud. **Note:** To complete this lab, you will need your own free Terraform Cloud account. You can sign up for a free account at [Terraform Cloud](https://app.terraform.io/public/signup).

Lab Info
Table of Contents
-
Challenge
Import Existing Resources into Terraform State
- Open the existing Terraform configuration file in
C:\MigrateState
. - Initialize the working directory.
- Log in to Azure using the Azure CLI.
- Import the exsting resource group into your local state.
- Open the existing Terraform configuration file in
-
Challenge
Inspect the Local State File
Verify the resource group has been imported into the state file using the Terraform CLI.
-
Challenge
Configure a Terraform Cloud Workspace
- Create a Terraform Cloud Workspace.
- Update the
main.tf
file with the cloud configuration block.
-
Challenge
Migrate State to Terraform Cloud
Initialize the working directory and migrate the state file to Terraform Cloud.
-
Challenge
Delete the Local State File
Delete the local state file and the state file backup.
About the author
Real skill practice before real-world application
Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.
Learn by doing
Engage hands-on with the tools and technologies you’re learning. You pick the skill, we provide the credentials and environment.
Follow your guide
All labs have detailed instructions and objectives, guiding you through the learning process and ensuring you understand every step.
Turn time into mastery
On average, you retain 75% more of your learning if you take time to practice. Hands-on labs set you up for success to make those skills stick.