How to setup terraform backend with Azure Storage

If you are using Terraform for infrastructure provisioning on any cloud it is very important to store tfstate files at a centralized place. This will allow us to update the infrastructure very easily and allow multiple developers to use the same terraform repository.

How does it work?

In the example below I have defined backend block(azurerm) inside terraform block where I have given details of storage account where generated tfstate files will get stored. Now, whenever we use command terraform apply this will create/update infrastructure as described in the main.tf. The tfstate file gets stored on a specified storage account.

State storage

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

Gaurav Wadghule
Gaurav Wadghule

Written by Gaurav Wadghule

Devops | Kubernetes | Docker | CICD | Test Automation

No responses yet

Write a response