swiftsolves-msft / terraform-on-azure

Demonstrates using Terraform on Azure

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

terraform-on-azure

Demonstrates using Terraform on Azure

Prerequisites

Use the included setup.sh script to create all the prerequisites for this sample, you can run it in the Azure Cloud Shell after you have changed its permissions, like:

chmod 700 setup.sh
./setup.sh

Usage

Use the service principal details to log into Azure, az login --service-principal -u <service_principal_name> -p "<service_principal_password>" --tenant "<service_principal_tenant>"

Replace both the storage_account_name & access_key properties in the main.tf file with the output from the setup.sh script

Let's now run the terraform commands:

terraform init -reconfigure
terraform plan -var-file="local.tfvars" -var "environment=dev" -out=plan
terraform apply plan
terraform destroy -var-file="local.tfvars" -var "environment=dev"

This sample showcases the following Terraform concepts:

References

This sample was built using the following references:

About

Demonstrates using Terraform on Azure

License:MIT License


Languages

Language:HCL 60.5%Language:Shell 39.5%