https://github.com/mviegas/tf-examples
This repo is a collection of Terraform scripts with the Azure Resource Manager provider for study purposes.
https://github.com/mviegas/tf-examples
azure devops iac terraform
Last synced: about 1 month ago
JSON representation
This repo is a collection of Terraform scripts with the Azure Resource Manager provider for study purposes.
- Host: GitHub
- URL: https://github.com/mviegas/tf-examples
- Owner: mviegas
- Created: 2021-02-16T22:27:44.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2021-02-17T09:05:55.000Z (over 5 years ago)
- Last Synced: 2025-10-29T20:53:41.213Z (8 months ago)
- Topics: azure, devops, iac, terraform
- Language: HCL
- Homepage:
- Size: 5.86 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Terraform Examples
This repo is a collection of Terraform scripts for study purposes.
## Azure App Service for Containers w/ Blue-Green Deployments
This boilerplate creates a Web App for Containers w/ a Staging Slot for Blue-Green Deployments.
### Creating an Azure Service Principal
This is required for interacting with an Azure Subscription through the ARM provider.
* Place your Azure Subscription Id into the .env file (there is a .env.example copy).
* Navigate to the scripts folder.
* Run `chmod +x create-az-sp-sh && ./create-az-sp.sh`.
* After a while, this script will output a json containing an `appId`, `displayName`, `name`, `password` and `tenant`. Store these values under the `src/tf-az-blue-green/terraform.tfvars` file to keep secrets. This file is git ignored and contains sensitive values.
### Setting up
* Navigate to the `src/tf-az-blue-green` folder.
* Under the `terraform.tfvars` file place the `container_image` variable with an image of your choice, like `nginx:latest` for instance.
* Run `tf plan` to check the configuration that will be created and if everythings is right.
* On this step, the `sku_size` var will be required to be prompted, if not setted on the `terraform.tfvars` file.
* Create your App Service for Containers with `tf apply`.
* On this step, the `sku_size` var will be required to be prompted, if not setted on the `terraform.tfvars` file.