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

--

--