Featured resource
2025 Tech Upskilling Playbook
Tech Upskilling Playbook

Build future-ready tech teams and hit key business milestones with seven proven plays from industry leaders.

Check it out
  • Lab
    • Libraries: If you want this lab, consider one of these libraries.
    • Cloud
Azure icon
Labs

Setting Up Remote State Storage

Welcome to the Setting Up Remote State Storage lab. In this lab, we will cover three objectives: 1. Create an Azure Storage Account 1. Deploy a virtual network with the local backend 1. Update the backend and migrate state data By the end of this lab, you will know how to configure a Terraform deployment to use the `azurerm` backend and how to migrate existing state data.

Azure icon
Lab platform
Lab Info
Level
Intermediate
Last updated
Sep 25, 2025
Duration
30m

Contact sales

By filling out this form and clicking submit, you acknowledge our privacy policy.
Table of Contents
  1. Challenge

    Create an Azure Storage Account

    In this objective, you'll create an Azure Storage account using Terraform. Make sure to include the storage account name in the outputs.

    1. Log into Azure using the Azure CLI.
    2. Create a new folder to hold a Terraform Configuration to deploy a storage account.
    3. Add a provider block for the azurerm provider with skip_provider_registration and storage_use_azuread set to true.
    4. Add the existing resource group as a data source.
    5. Create a random integer resource to generate a unique storage account name.
    6. Create an Azure Storage account with the following settings:
      • HTTPS traffic only: Enabled
      • Shared access key: Disabled
      • Default to OAuth authentication: Enabled
    7. Create a container in the storage account named tfstate.
    8. Initialize and deploy the Terraform configuration.
    9. Make note of the storage account name for the next objective.
  2. Challenge

    Deploy a Virtual Network with the Local Backend

    In this objective, you'll deploy a simple virtual network configuration using the local backend. The configuration will be updated in the next objective to use the azurerm backend instead.

    1. Create a new folder to hold a Terraform Configuration to deploy a virtual network.
    2. Add a provider block for the azurerm provider with skip_provider_registration and storage_use_azuread set to true.
    3. Add the existing resource group as a data source.
    4. Add an azurerm_virtual_network resource.
    5. Initialize and deploy the Terraform configuration.
  3. Challenge

    Update the Backend and Migrate State Data

    In this objective, you'll update the virtual network configuration to use the azurerm backend with a partial configuration. Then you'll initialize the configuration to migrate the existing state data to the storage account created in the first objective.

    1. Update you configuration to use the azurerm backend with a partial configuration.
    2. Create a backend configuration file with use_azuread_auth set to true.
    3. Use the storage account name from the first objective and the existing resource group name in the backend configuration.
    4. Run terraform init to initialize the configuration and migrate state data.
    5. Accept the migration prompt to copy the state data to the storage account.
    6. Verify the state data is stored in the storage account container.
About the author

Pluralsight Skills gives leaders confidence they have the skills needed to execute technology strategy. Technology teams can benchmark expertise across roles, speed up release cycles and build reliable, secure products. By leveraging our expert content, skill assessments and one-of-a-kind analytics, keep up with the pace of change, put the right people on the right projects and boost productivity. It's the most effective path to developing tech skills at scale.

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.

Get started with Pluralsight