Introduction to Terraform on Azure

Introduction to Terraform on Azure

4h 13mBeginner2025-09-04

Authors

Prince Mokut

Prince Mokut

System, Cloud, and DevOps Engineer

Course details

In this course Prince Mokut—a certified Cloud and DevOps engineer—teaches intermediate cloud and DevOps professionals how to harness the power of Terraform to manage and automate Azure infrastructure. Learn how to configure Terraform, set up Azure credentials, and write effective configurations using HCL. Explore best practices for variables and state management with Azure Blob Storage. Dive into advanced topics, such as creating reusable modules, managing multiple environments with workspaces, and integrating CI/CD pipelines using Azure DevOps. Plus, gain practical experience deploying key Azure resources and establishing temporary QA environments for rapid testing. By the end of the course, you will be equipped with the skills to build, secure and tear down production-ready infrastructure on Azure using Terraform.

Learning objectives
Install and configure the Terraform CLI, set up Azure Credentials.
Understand the role of Terraform providers to establish a solid foundation in Infrastructure as Code.
Write and customize Terraform configurations, manage variables and tfvar files and execute essential Terraform commands to provision and manage Azure resources.
Automate infrastructure deployments using CI/CD pipelines, enabling seamless orchestration of resource provisioning and supporting ephemeral QA environments.
Apply best practices in organizing Terraform code, managing sensitive data with environment variables, and debugging Terraform configuration issues.

Skills covered

TerraformHashiCorpData CentersIntroduction toDevOps ToolsCloud AdministrationDatabase ManagementAzureDevOpsCloud PlatformsCloud ComputingMicrosoft

Concepts

Introduction

  • From clicks to code - Terraform for Azure
  • What you should know
  • Exercise files on GitHub

Introduction to Terraform

  • What is Terraform
  • Benefits of using Terraform
  • Terraform vs. other IaC tools
  • Installing the Terraform CLI
  • Configuring Azure credentials for Terraform
  • Overview of Terraform providers

Terraform Fundamentals

  • Writing your first Terraform configuration
  • Understanding Terraform's HCL syntax
  • Key Terraform commands - Init, plan, apply, and destroy
  • Declaring variables and using tfvar files
  • Best practices for managing configuration with variables

State Management and Workspaces

  • What are workspaces
  • Using Terraform workspaces
  • Define and provision Azure VM with workspaces
  • Understanding Terraform state (local vs. remote)
  • Configuring remote state using Azure Blob Storage
  • Implementing state locking and versioning

Terraform Modules

  • Why use modules
  • Defining variable for compute module
  • Defining compute infrastructure
  • Reference and deploy compute module
  • Defining Azure SQL database module
  • Defining an Azure Web App module
  • Deploying our modules
  • Destroying our provisioned resources

Terraform Deployments with Azure DevOps Pipelines

  • Introduction to CI CD for Terraform
  • Configure and clone your DevOps project
  • Configure service principal and variable groups
  • Define CI workflow for Terraform
  • Define environments and dev CD workflow
  • Automating deployments in Azure - Staging and production
  • Approval gate for production workflow
  • Destroy resources with CI CD

Conclusion

  • Put your Terraform skills to work
100,000 Toman