Skip to content

Contact sales

By filling out this form and clicking submit, you acknowledge our privacy policy.
  • Labs icon Lab
  • A Cloud Guru
Azure icon
Labs

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).

Azure icon
Labs

Path Info

Level
Clock icon Intermediate
Duration
Clock icon 30m
Published
Clock icon Mar 24, 2023

Contact sales

By filling out this form and clicking submit, you acknowledge our privacy policy.

Table of Contents

  1. Challenge

    Import Existing Resources into Terraform State

    1. Open the existing Terraform configuration file in C:\MigrateState.
    2. Initialize the working directory.
    3. Log in to Azure using the Azure CLI.
    4. Import the exsting resource group into your local state.
  2. Challenge

    Inspect the Local State File

    Verify the resource group has been imported into the state file using the Terraform CLI.

  3. Challenge

    Configure a Terraform Cloud Workspace

    1. Create a Terraform Cloud Workspace.
    2. Update the main.tf file with the cloud configuration block.
  4. Challenge

    Migrate State to Terraform Cloud

    Initialize the working directory and migrate the state file to Terraform Cloud.

  5. Challenge

    Delete the Local State File

    Delete the local state file and the state file backup.

The Cloud Content team comprises subject matter experts hyper focused on services offered by the leading cloud vendors (AWS, GCP, and Azure), as well as cloud-related technologies such as Linux and DevOps. The team is thrilled to share their knowledge to help you build modern tech solutions from the ground up, secure and optimize your environments, and so much more!

What's a lab?

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.

Provided environment for hands-on practice

We will provide the credentials and environment necessary for you to practice right within your browser.

Guided walkthrough

Follow along with the author’s guided walkthrough and build something new in your provided environment!

Did you know?

On average, you retain 75% more of your learning if you get time for practice.

Start learning by doing today

View Plans