
Learn to build Azure infrastructure with Terraform, deploy a small web app from GitHub using Azure platform as a service, and structure code for state file handling and multi-environment deployments.
Set up an Azure subscription, install Azure CLI and Terraform, and configure a workstation on Windows, macOS, or Linux; use VS Code with the Terraform extension for clarity.
Understand how Terraform providers act as the interface to cloud services, exposing resources and data sources for Azure, with authentication via Azure CLI and alternative methods.
Create a provider configuration for Terraform, copy the provider snippet from the docs, adhere to file naming and coding standards, and include a mandatory features block so the code runs.
Explore how Terraform models cloud resources, defining attributes for a Windows web app and using meta arguments, lifecycle, and dependencies to control creation, updates, and provisioning.
Create a new Azure resource group with Terraform by defining azurerm_resource_group in main.tf, naming it recipe-dev-g and setting location North Central US, then run Terraform.
Learn how to run Terraform on Azure, including logging in with the Azure CLI, initializing, planning, applying, and destroying deployments, and managing state, providers, modules, and subscriptions.
Complete the assignment to practice version pinning in Terraform on Azure. Pin Terraform to 1.5.6 and pin the provider to the latest 3.x, referencing provider docs for guidance.
Pin the Terraform version to 1.5.6 using required_version, and pin Azure to a major version with version expressions; emphasize testing updates in dev before prod for consistency.
Add an Azure service plan to your Terraform deployment, a container for web apps and Azure Functions with a predefined hardware type, supporting Linux, Windows, and instances for production use.
Explore how Terraform builds a dependency graph to determine deployment order in Azure, using implicit references to resource groups, and when to apply explicit dependencies for a key vault.
Explore Terraform variables, including strings, numbers, booleans, and complex constructs like lists, maps, and objects, and learn to set defaults, mark sensitive data, and validate values.
Create a variables.tf file to define a location variable, reducing duplication and deployment flexibility. Provide a default North Central US or pass values via command line or files as var.location.
Learn how Terraform changes infrastructure, using plan to preview in-place updates or destructive changes, with guidance on production safety and using Git pipelines to manage code.
Discover locals in terraform as module-scoped expressions and local variables defined in a locals block, reused to build resource names, with interpolation covered next.
Master interpolation in Terraform to generate unique Azure resource names by injecting a base name into attributes, using locals and functions like lower.
Learn to tag Azure resources with Terraform to manage metadata, ownership, and who pays, using a tags block, variables, and a time provider for environment tags.
Explore how Terraform's lifecycle block controls resource behavior, including preventing destruction and ignoring changes. Apply ignore_changes to specific attributes like tags and observe plan results, not recommended for production.
Explore the purpose of Terraform state, local vs remote state, and how the remote backend in Azure enables locking, RBAC, versioning, and point-in-time restore.
Create a remote state backend in Azure for Terraform by provisioning a storage account and a private container, then migrate from local to remote state with Terraform init.
Learn to manipulate Terraform state in Azure by listing, moving, and removing resources, handling locks, and understanding module naming and bringing existing resources into state.
Learn how to remove a resource from Terraform state and re-import it from Azure using an import block, plan, and apply, with examples like service plan and Azure ID.
Add an outputs.tf with an output named service_plan_id to expose the resource id, write it to the state file, and reference it as a data source in future deployments.
Rename the service_plan in main.tf to plan and update the output in output.tf; observe the plan, then manipulate the Terraform state to keep future plans unchanged.
Learn how to rename a Terraform service plan without recreation by using terraform state list and terraform state mv, ensuring no changes on apply and maintaining state integrity.
Explore Terraform modules to restructure code with a root module and reusable module blocks, enabling identical environments via input variables.
Reorganize the Terraform project into modules by creating a root module named recipe and moving files from main.tf into a resources/recipe layout, discarding old state and locking files.
Define an environment object to pass settings to the recipe module, enabling flexible deployment configuration and easy type, location, plan, and apply resource references.
Manage terraform outputs across modules by writing outputs to outputs.tf and bubbling values up to the route module. Reference module outputs like service plan ID when data sources are insufficient.
Explore Azure web apps as a platform as a service, with built-in scaling, automated management, security, and deployment options for Python, NET, and node stacks.
Create an Azure Linux web app resource in Terraform, choosing the Linux variant, configure name, resource group, and service plan id, enable https only, and set python 3.11 in application_stack.
Enable a system identity for Azure resources and explore user assigned identities to securely grant a web app access to a key vault without exposed keys.
Learn to create application settings with terraform on Azure by passing environment and proteins through modules into a web app, and see how settings are used at runtime.
Outlines the assignment solution: add an environment app setting set to development, and define a proteins variable in the root module’s ingredients object to pass to the module.
Explore using Terraform conditionals to set environment variables based on the environment type, avoiding hard-coded values. Learn the simple syntax, its limitations, and how to route to development or production.
Explore how Terraform data resources bring outside information into Azure deployments, such as the Azure Client Config data source, enabling dynamic configuration via a data.tf file.
Add a key vault to securely store secrets and certificates in Azure; enable RBAC, reference the vault from the web app, and leverage versioning and unique naming when applying configuration.
Configure Azure role-based access control with built-in and custom roles via Terraform, enforcing least-privileged access, scoping from subscription to resource like key vault, and assigning users, groups, or identities.
Create a Terraform key vault role assignment scoped to the vault ID using the key vault administrator role and your current object ID. This grants access to manage secrets.
Assign the web app the key vault secret user role using RBAC, locate the web app's principal ID, and review the documentation for guidance.
Explains a Terraform on Azure assignment solution, including scoping a resource group to a key vault, granting key vault secret user role, and using the web app identity block.
Explore iteration in Terraform by using for_each to create key vault secrets from a sources list. Define static keys and leverage variables to generate secrets, then plan and apply.
Explore Terraform dependencies on Azure, using depends_on to order role assignments and secrets creation, and learn to visualize the dependency graph to prevent timing issues during destroy and reapply.
Iterate over variables to perform variable transformation and create dynamic key vault references in app settings for web and function apps using Terraform; plan and apply.
Deploy python flask app to azure app service via github source control, configure app id, repo url, main branch, and use_manual_integration, with kudu build handling pull, build, and deployment.
Learn to conditionally deploy resources in terraform using count and a boolean deploy variable. Create zero or one instance by evaluating var.environment.deploy.
Add a health check endpoint to the web app to verify environment variables and return 200 when present, and set a two-minute eviction time to recycle unhealthy instances in Azure.
Learn to secure Azure resources by building a virtual network with Terraform on Microsoft Azure, using an environment variable for the VNet address space 10.1.0.0/22 and interpolation-based naming.
Demonstrates using Terraform to add a variable and create an Azure VNet with a list address space, using interpolation, planning, and applying to show the VNet and upcoming subnets.
Use cidr subnet function to create two /28 subnets from a /22 in an Azure virtual network, named resources and app, with the app subnet delegated to the web app.
Delegate the subnet and configure the service delegation with the Microsoft.web/server_farms action, then join the web app to the subnet using the virtual_network_subnet_id attribute.
Learn to use Terraform dynamic blocks to stamp IP restrictions into an Azure web app, fetching your IP with a data resource and using service tags.
Learn how private link keeps traffic to your key vault private by attaching it to a VNet with a private dns zone and a private network link.
Configure a private endpoint for a key vault using Terraform, linking a private DNS zone and a private link to a VNet, with a subnet and DNS registrations.
Reconfigure Terraform backends to support multiple deployments across dev and prod environments by using partial backend configurations and environment-specific state files.
Create a variable file and define environment-specific variables for Terraform on Azure, pass them via the command line, enabling multi-environment and multi-region deployments.
Deploy multi-environment Terraform on Azure by switching backends, reinitializing with backend config, and using var files to deploy dev and prod in separate resource groups.
Troubleshoot Terraform on Azure by diagnosing misconfigurations and id mismatches—subscription and tenant IDs, object and principal IDs—and enable the tf log environment variable for detailed error surfaces.
Celebrate completing the course and invite learners to provide Udemy feedback, while encouraging ongoing improvement and future exploration of Terraform on Microsoft Azure for platform engineering.
This course takes you through all aspects of Terraform from initial setup and the basics, though to how structure the code for reliable, constant deployments to multiple environments or locations
This course has been developed to take you from the basics of using terraform, though to building a functional web application using Azure platform as a service resources. The primary focus of the course is terraform and I will teach and give you real world examples of how to use this, from an initial monolithic deployment to a well-structured and modularised deployment. The course covers all the essential terraform topics and as it progresses builds until we’ve a working deployment that you’d find in a production environment.
From an Azure perspective, we will be working with several PaaS resources like web app, key vault, DNS and private link. Just to set expectations this isn’t an Azure course, but I do cover some basics and provide background information. All the resources will be deployed following current best practice and secured, so you’ll have an excellent frame of reference for your future deployments.
This course has been developed to be as practical as possible, most of the lessons are follow along in nature.