https://github.com/piyushsachdeva/terraform-azuredevops-sample
https://github.com/piyushsachdeva/terraform-azuredevops-sample
Last synced: over 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/piyushsachdeva/terraform-azuredevops-sample
- Owner: piyushsachdeva
- Created: 2023-12-01T05:57:14.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-12-03T06:42:23.000Z (over 2 years ago)
- Last Synced: 2025-04-01T13:46:09.788Z (over 1 year ago)
- Language: HCL
- Size: 4.88 KB
- Stars: 12
- Watchers: 2
- Forks: 60
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Terraform-AzureDevOps-Sample
### You can use the below Azure cli commands to set the terraform remote backend, or you can do it via the portal
``` shell
#!/bin/bash
## The Storage account name must be unique, and the values below should match your backend.tf
RESOURCE_GROUP_NAME=demo-resources
STORAGE_ACCOUNT_NAME=techtutorialswithpiyush
CONTAINER_NAME=prod-tfstate
# Create resource group
az group create --name $RESOURCE_GROUP_NAME --location canadacentral
# Create storage account
az storage account create --resource-group $RESOURCE_GROUP_NAME --name $STORAGE_ACCOUNT_NAME --sku Standard_LRS --encryption-services blob
# Create blob container
az storage container create --name $CONTAINER_NAME --account-name $STORAGE_ACCOUNT_NAME
```
## Usage/Examples
### 1) login to the CLI
```shell
az login --use-device-code
```
### 2) set alias
```shell
alias tf=terraform
```
### 3) initialize the providers
```shell
tf init
```
### 4) Run the plan
```shell
tf plan
```
### 5) Apply the changes
```shell
tf apply --auto-approve
```