The Azure Makefile has been updated to work like the AWS Makefile - it's now located in the azure/ directory (not azure/dev/) and supports multiple environments with the format make <action> <environment>.
azure/
├── Makefile # ← Main Makefile (NEW)
├── dev/
├── staging/
├── prod/
├── global/
├── rbac/
└── modules/
make <action> <environment>init- Initialize Terraform and pre-commit dependenciesplan- Create Terraform planapply- Apply Terraform changes using the plandestroy- Destroy Terraform infrastructurefmt- Format Terraform filesvalidate- Validate Terraform configurationcheckov- Run Checkov security scancheck- Run fmt, validate, and Checkov scantest- Run deployment testspre-commit-install- Install pre-commit hookspre-commit-run- Run pre-commit hooks
dev- Development environment (default)staging- Staging environmentprod- Production environmentglobal- Global resourcesrbac- RBAC resources
cd azure
# Step 1: Validate all environments
./scripts/validate-all.sh
# Step 2: Deploy infrastructure in order (dependencies matter)
make plan global && make apply global # Deploy shared resources first
make plan rbac && make apply rbac # Deploy role assignments second
make plan dev && make apply dev # Deploy environment resources last
# Step 3: Test deployment
./scripts/test-deployment.shcd azure
# Initialize dev environment
make init dev
# Create plan for dev
make plan dev
# Apply changes to dev
make apply dev
# Run tests
make test dev# Format all environments
make fmt dev
make fmt staging
make fmt prod
make fmt global
make fmt rbac
# Validate all environments
make validate dev
make validate staging
make validate prod
# Check all environments (fmt + validate + checkov)
make check dev
make check staging
make check prod# Install pre-commit hooks (once)
make pre-commit-install
# Run pre-commit on all files
make pre-commit-run
# Format specific environment
make fmt dev# Test deployment (requires deployed infrastructure)
make test dev- Consistent with AWS: Same pattern as
aws/Makefile - Single Location: One Makefile for all environments
- Environment Validation: Checks if environment directory exists
- Better Error Handling: Clear error messages for missing files/directories
- Flexible: Easy to add new environments or actions
Before (old way):
cd azure/dev
make init
make plan
make applyAfter (new way):
cd azure
make init dev
make plan dev
make apply dev# Test help
make help
# Test format (safe operation)
make fmt dev
# Test validation (safe operation)
make validate dev
# Test with different environments
make fmt global
make validate rbacmake fmt invalid
# Output: Error handling -chdir option: no such file or directorymake apply dev # without running plan first
# Output: Error: No plan file found for dev. Run 'make plan dev' firstmake test dev # without deployed infrastructure
# Output: ❌ No terraform state found. Please run 'terraform apply' first.| Action | Command | Description |
|---|---|---|
| Get help | make help |
Show all available commands |
| Initialize | make init dev |
Set up Terraform and pre-commit |
| Plan changes | make plan dev |
Create execution plan |
| Apply changes | make apply dev |
Deploy infrastructure |
| Format code | make fmt dev |
Format Terraform files |
| Validate config | make validate dev |
Validate Terraform syntax |
| Run all checks | make check dev |
Format + validate + security scan |
| Test deployment | make test dev |
Run deployment health checks |
| Destroy infra | make destroy dev |
Destroy infrastructure (with confirmation) |
The new Makefile provides a much better developer experience and consistency with the AWS setup! 🎉