A step-by-step course for deploying and managing Azure infrastructure with Terraform. Learn from basics to advanced patterns through hands-on examples.
Begin with Lesson 01: Introduction
- 01. Introduction - Get familiar with Terraform and Infrastructure as Code
- 02. Install Terraform - Set up Terraform on your machine
- 03. Set up VS Code - Configure your development environment
- 04. Core Terraform commands - Learn init, plan, apply, destroy
- 05. Resources and data sources - Create and query Azure resources
- 06. Azure provider setup - Configure authentication and providers
- 07. Variables - Make configurations reusable with variables
- 08. State: local - Understand Terraform state management
- 09. State: remote - Store state in Azure Storage for teams
- 10. Advanced: depends_on - Control resource dependencies
- 11. Advanced: for_each - Create multiple similar resources
- 12. Advanced: count - Create multiple identical resources
- 13. Advanced: conditionals - Make configuration decisions
- 14. Advanced: dynamic blocks - Generate nested blocks
- 15. Secret management - Secure secrets with Azure Key Vault
- 16. Modules - Build reusable infrastructure components
- 17. AzAPI provider - Use day-one Azure resources
- 18. Testing - Validate configurations with terraform test
- 19. Import - Bring existing Azure resources under Terraform
- 20. State commands - Inspect and manage state
- 21. Pre- and post-conditions - Add validation to resources
- 22. Terraform functions - Transform and manipulate data
- 23. Terraform MCP server - Use AI assistance with Terraform
- 24. Cleanup - Remove all Azure resources and avoid charges
- Terraform fundamentals: core concepts, workflow, and Azure provider
- State management: local and remote state with Azure Storage backend
- Advanced patterns: resource dependencies, loops, conditionals, dynamic blocks
- Production practices: secret management, testing, modules, validation
- Operations: import existing resources, state manipulation, troubleshooting
- Modern tooling: AzAPI provider, Terraform test framework, AI assistance
- Azure subscription (free account)
- Basic command-line knowledge
- Understanding of cloud infrastructure concepts
- 24 progressive lessons from basics to advanced topics and cleanup
- Each lesson has a
README.mdwith explanations and steps - Hands-on examples in
examples/directories with working Terraform code - Examples use azurerm 4.0+ with latest provider features
- Lesson 24 provides scripts to clean up all resources and avoid charges
# Clone the repository
git clone https://github.com/thomast1906/terraform-on-azure.git
cd terraform-on-azure
# Start with lesson 01
cd 01-introduction- Issues: Report bugs or request features
- Discussions: Ask questions and share your experience
Contributions welcome! Open a pull request to:
- Fix errors or typos
- Improve explanations
- Add new examples
- Suggest new lessons
This course is provided for educational purposes.