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

Deploy to Azure Using the Terraform Command Line Interface (CLI)
In this hands-on lab, you will author a Terraform configuration for Azure and apply the configuration using the Terraform Command Line Interface (CLI). > **Important Note**: Version 4.x of the AzureRM provider for Terraform introduces breaking changes, you must **use version 3.116.0** or lower to follow the guide and/or videos provided with this lab. Please refer to the lab guide for more details.

Lab Info
Table of Contents
-
Challenge
Log In to Azure
- Connect to the virtual machine using the credentials provided.
- Using the terminal in Visual Studio Code, log in to Azure using the Azure CLI.
-
Challenge
Author Your Terraform Configuration
- Create a folder for your configuration.
- Create a
main.tf
file in the folder. - Author your configuration, including the
terraform
block andrequired providers
meta-argument. - Use
azurerm
provider version 3.116.0 or lower.
Note: Version 4.x of the AzureRM provider for Terraform introduces breaking changes, you must use version 3.116.0 or lower to follow the guide and/or videos provided with this lab.
-
Challenge
Initialize the Working Directory
Use the Terraform executable to initialize the working directory.
-
Challenge
Declare Your Provider Configuration
- Add the provider configuration block to your Terraform configuration file.
- The
skip_provider_registration = true
must be set.
-
Challenge
Import the Existing Resource Group
Import the existing resource group into your Terraform state.
-
Challenge
Declare a Storage Account Resource
Create an Azure Storage Account resource block, using the following properties:
``` account_tier = "Standard" account_replication_type = "LRS" ```
-
Challenge
Format and Validate the Configuration
Use the Terraform executable to format and validate the configuration.
-
Challenge
Plan and Deploy Your Configuration
Use the Terraform executable to plan and apply your configuration.
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.