- Lab
- A Cloud Guru
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.
Path 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.
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.