Use azure storage as backend for terraform state with Github actions
Lets directly jump into the implementation.
Lets directly jump into the implementation.
Let’s see how to use Azure Storage account as backend in Terraform.
terraform_resource_group
if you don’t have using Azure cliaz group create --name terraform_resource_group --location eastus
terraform_backend
on terraform_resource_group
resource groupaz storage account create --resource-group terraform_resource_group --name terraform_backend --sku Standard_LRS --encryption-services blob
my_service_name
az storage container create --name my_service_name --account-name terraform_backend
terraform {
required_version = ">=1.0"
required_providers {
azapi = {
source = "Azure/azapi"
version = "1.14.0"
}
azurerm = {
source = "hashicorp/azurerm"
version = "3.113.0"
}
}
}
provider "azurerm" {
skip_provider_registration = "true"
features {}
}
terraform {
backend "azurerm" {
resource_group_name = "terraform_resource_group"
storage_account_name = "terraform_backend"
container_name = "my_service_name"
key = "terraform.tfstate"
}
}
Lets directly jump into the implementation.
While easy to get started, Astrowind is quite complex internally. This page provides documentation on some of the more intricate parts.
Start your web journey with Dculus – harness Astro and Tailwind CSS for a stunning site. Explore our guide now.
Explore vital tools and resources for a sleek website. From design to functionality, our guide elevates your online presence.