{"id":2425,"date":"2022-01-09T12:55:11","date_gmt":"2022-01-09T18:55:11","guid":{"rendered":"https:\/\/www.ciraltos.com\/?p=2425"},"modified":"2023-03-23T05:24:35","modified_gmt":"2023-03-23T10:24:35","slug":"remote-backend-state-with-terraform-and-azure-storage","status":"publish","type":"post","link":"http:\/\/www.ciraltos.com\/staging2\/remote-backend-state-with-terraform-and-azure-storage\/","title":{"rendered":"Remote Backend State with Terraform and Azure Storage"},"content":{"rendered":"\n<figure class=\"wp-block-image alignleft size-large\"><img decoding=\"async\" loading=\"lazy\" width=\"169\" height=\"162\" src=\"https:\/\/www.ciraltos.com\/wp-content\/uploads\/2021\/12\/TerraformAzureLogo.png\" alt=\"\" class=\"wp-image-2407\"\/><\/figure>\n\n\n\n<p>Until now, we have developed our Infrastructure code as a\nsingle developer. As a result, our state file is created and maintained on the\nlocal development computer.&nbsp; This is fine\nfor a team of one, but having multiple versions of a state file can become an\nissue as others join in.&nbsp; This post and\naccompanying video examines using a remote backend state on Azure Storage to\nhost shared state files. <\/p>\n\n\n\n<!--more-->\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<div class=\"ast-oembed-container\" style=\"height: 100%;\"><iframe loading=\"lazy\" title=\"Remote Backend State with Terraform and Azure Storage\" width=\"500\" height=\"281\" src=\"https:\/\/www.youtube.com\/embed\/mpoTI660_Yg?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" allowfullscreen><\/iframe><\/div>\n<\/div><\/figure>\n\n\n\n<p>This post and video is a continuation of my series on Terraform.&nbsp; Check the link below for a list of other articles in this series. <br><a href=\"https:\/\/www.ciraltos.com\/category\/terraform\/\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\" https:\/\/www.ciraltos.com\/category\/terraform\/  (opens in a new tab)\"> https:\/\/www.ciraltos.com\/category\/terraform\/ <\/a><\/p>\n\n\n\n<p>The Terraform state maps real-world resources to the\nconfiguration, it tracks metadata, such as dependencies between resources, and\nimproves performance for large infrastructure by caching information on resources\nin the state.&nbsp; <\/p>\n\n\n\n<p>How do we address potential issues when working in a team to\ndeploy infrastructure as code? We use a centralized state file that everyone has\naccess to.&nbsp; Terraform supports storing a\nremote state in Terraform Cloud, Amazon S3, Azure Blob Storage, Google Cloud\nStorage, Alibaba Cloud, and more.&nbsp; These\nremote states can be accessed and shared by multiple people.&nbsp; <\/p>\n\n\n\n<p>As this series is on Terraform with Azure, we will use Azure\nBlob Storage.&nbsp; There are two steps to\nfollow.&nbsp; First, we need to create a\nstorage account.&nbsp; Second, we configure\nthe main.tf to use the remote state location.<\/p>\n\n\n\n<h1>Create the Storage Account<\/h1>\n\n\n\n<p>One thing to note before we get started, we are not using\nTerraform to create the storage account.&nbsp;\nTerraform could be used, it will work the same.&nbsp; The remote state is stateful, meaning the\ndata needs to persist through the lifecycle of the code.&nbsp; We can\u2019t simply delete and recreate the storage\naccount without removing the state file.&nbsp;\nBecause of that, this example uses the Azure CLI.<\/p>\n\n\n\n<p>The images below are missing parts of the commands.&nbsp; All code used in this example can be found here:<br> <a href=\"https:\/\/github.com\/tsrob50\/TerraformExamples\">https:\/\/github.com\/tsrob50\/TerraformExamples<\/a><\/p>\n\n\n\n<p>Start by connecting to Azure and set the resource group\nname, storage account name, and container name variables in the storage setup\nscript.&nbsp; Once updated, highlight and run the\nlines to add the variables to memory.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote\">\n<p>get-random adds random numbers to the end of the storage account to ensure the name is unique.<\/p>\n<\/blockquote>\n\n\n\n<p>Run the <em>az group create<\/em>, <em>az storage account\ncreate,<\/em> and <em>az storage container create<\/em> commands to create the resource\ngroup, storage account, and the blob container used for the state file. <\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" loading=\"lazy\" width=\"1024\" height=\"326\" src=\"https:\/\/www.ciraltos.com\/wp-content\/uploads\/2022\/01\/Create-the-Storage-Account-1024x326.png\" alt=\"\" class=\"wp-image-2427\" srcset=\"http:\/\/www.ciraltos.com\/staging2\/wp-content\/uploads\/2022\/01\/Create-the-Storage-Account-1024x326.png 1024w, http:\/\/www.ciraltos.com\/staging2\/wp-content\/uploads\/2022\/01\/Create-the-Storage-Account-300x96.png 300w, http:\/\/www.ciraltos.com\/staging2\/wp-content\/uploads\/2022\/01\/Create-the-Storage-Account-768x245.png 768w, http:\/\/www.ciraltos.com\/staging2\/wp-content\/uploads\/2022\/01\/Create-the-Storage-Account.png 1098w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\"> Create the Storage Account <\/figcaption><\/figure>\n\n\n\n<p>Terraform needs rights to access the storage account when running\nthe <em>terraform<\/em> <em>init, plan, <\/em>and <em>apply<\/em> commands.&nbsp; We will use the storage account key for\nthis.&nbsp; We could add the key to the <em>main.tf<\/em>\nfile, but that would go against best practices of keeping security string out\nof code.&nbsp; Instead, we\u2019ll use an\nenvironment variable to pass in the string when running commands.&nbsp; The variable <em>$env:ARM_ACCESS_KEY<\/em> will\nget the security key.&nbsp; Run the commands\nbelow to add the key to the environment variable.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" loading=\"lazy\" width=\"1024\" height=\"88\" src=\"https:\/\/www.ciraltos.com\/wp-content\/uploads\/2022\/01\/Storage-Key-Environment-Variable-1024x88.png\" alt=\"\" class=\"wp-image-2428\" srcset=\"http:\/\/www.ciraltos.com\/staging2\/wp-content\/uploads\/2022\/01\/Storage-Key-Environment-Variable-1024x88.png 1024w, http:\/\/www.ciraltos.com\/staging2\/wp-content\/uploads\/2022\/01\/Storage-Key-Environment-Variable-300x26.png 300w, http:\/\/www.ciraltos.com\/staging2\/wp-content\/uploads\/2022\/01\/Storage-Key-Environment-Variable-768x66.png 768w, http:\/\/www.ciraltos.com\/staging2\/wp-content\/uploads\/2022\/01\/Storage-Key-Environment-Variable.png 1262w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\"> Storage Key Environment Variable<\/figcaption><\/figure>\n\n\n\n<p>This example uses the environment variable, but there are\nother options for hosting the Storage Account key, such as Azure Key\nVault.&nbsp; Keep in mind that anyone\ndeploying code will need to set the environment variable to access the storage\naccount.<\/p>\n\n\n\n<h1>Create the Backend State<\/h1>\n\n\n\n<p>Now that we have created the backend state location, we can\nconfigure Terraform to use it.&nbsp; The configuration\nis set in the <em>terraform<\/em> block of the <em>main.tf<\/em> file.&nbsp; Add the following code into the storage\nblock.<\/p>\n\n\n\n<p>backend &#8220;azurerm&#8221; {<br> &nbsp;&nbsp;&nbsp; resource_group_name &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = &#8221; &lt;storage_account_resouce_group&gt;&#8221;<br> &nbsp;&nbsp;&nbsp; storage_account_name &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = &#8220;&lt;storage_account_name&gt;&#8221;<br> &nbsp;&nbsp;&nbsp; container_name&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;= &#8220;&lt;storage_container_name&gt;&#8221;<br> &nbsp;&nbsp;&nbsp; key&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;= &#8220;terraform.tfstate&#8221;<br> }<\/p>\n\n\n\n<p>Start with the <em>backend<\/em> configuration in the <em>terraform<\/em>\nresource block.&nbsp; Give it a local name, <em>azurerm,<\/em>\nfor the example below.<\/p>\n\n\n\n<p>Provide the storage account resource group name, storage\naccount name, and container name. <\/p>\n\n\n\n<p>Provide a key.&nbsp; The\nkey is the name of the state file.&nbsp; This\nexample uses <em>terraform.tfstate<\/em>.&nbsp; Don\u2019t\nconfuse Key in the backend block for the storage account key.<\/p>\n\n\n\n<p>Once finished, the terraform block will look similar to the\nimage below:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" loading=\"lazy\" width=\"604\" height=\"493\" src=\"https:\/\/www.ciraltos.com\/wp-content\/uploads\/2022\/01\/Terraform-Block.png\" alt=\"\" class=\"wp-image-2429\" srcset=\"http:\/\/www.ciraltos.com\/staging2\/wp-content\/uploads\/2022\/01\/Terraform-Block.png 604w, http:\/\/www.ciraltos.com\/staging2\/wp-content\/uploads\/2022\/01\/Terraform-Block-300x245.png 300w\" sizes=\"(max-width: 604px) 100vw, 604px\" \/><figcaption class=\"wp-element-caption\"> Terraform Block <\/figcaption><\/figure>\n\n\n\n<p>The configuration above will direct the state file to the\nshared Azure Storage Account, where it will be available for others working on\nthe infrastructure.<\/p>\n\n\n\n<h1>Storage Account Lease Status<\/h1>\n\n\n\n<p>A shared backend provides a central location for the state\nfile, allowing multiple reads from a single location.&nbsp; But what if two people apply an update at the\nsame time?<\/p>\n\n\n\n<p>An Azure Storage Account has a locking mechanism that will\nprevent multiple applies from happening simultaneously.&nbsp; If we go to the storage account in the portal,\nthen to data storage and open containers.<\/p>\n\n\n\n<p>Click on the state file, terraform.tfstate, for this example.\n&nbsp;Notice the lease status and lease state\nshow unlocked and available.&nbsp; <\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" loading=\"lazy\" width=\"457\" height=\"602\" src=\"https:\/\/www.ciraltos.com\/wp-content\/uploads\/2022\/01\/Lease-Avaialble.png\" alt=\"\" class=\"wp-image-2430\" srcset=\"http:\/\/www.ciraltos.com\/staging2\/wp-content\/uploads\/2022\/01\/Lease-Avaialble.png 457w, http:\/\/www.ciraltos.com\/staging2\/wp-content\/uploads\/2022\/01\/Lease-Avaialble-228x300.png 228w\" sizes=\"(max-width: 457px) 100vw, 457px\" \/><figcaption class=\"wp-element-caption\"> Lease Available <\/figcaption><\/figure>\n\n\n\n<p>When <em>terraform init, plan <\/em>or<em> apply<\/em> are ran,\nthe lease status changes to locked and lease state changes to leased as shown\nbelow.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" loading=\"lazy\" width=\"489\" height=\"685\" src=\"https:\/\/www.ciraltos.com\/wp-content\/uploads\/2022\/01\/Lease-Locked.png\" alt=\"\" class=\"wp-image-2431\" srcset=\"http:\/\/www.ciraltos.com\/staging2\/wp-content\/uploads\/2022\/01\/Lease-Locked.png 489w, http:\/\/www.ciraltos.com\/staging2\/wp-content\/uploads\/2022\/01\/Lease-Locked-214x300.png 214w\" sizes=\"(max-width: 489px) 100vw, 489px\" \/><figcaption class=\"wp-element-caption\"> Lease Locked <\/figcaption><\/figure>\n\n\n\n<p>IMAGE Lease Locked<\/p>\n\n\n\n<p>Locking the file prevents multiple actions on the state file\nsimultaneously.&nbsp; <\/p>\n\n\n\n<p>That\nis how to use an Azure storage account as a terraform remote backed.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Until now, we have developed our Infrastructure code as a single developer. As a result, our state file is created and maintained on the local development computer.&nbsp; This is fine for a team of one, but having multiple versions of a state file can become an issue as others join in.&nbsp; This post and accompanying &hellip;<\/p>\n<p class=\"read-more\"> <a class=\"\" href=\"http:\/\/www.ciraltos.com\/staging2\/remote-backend-state-with-terraform-and-azure-storage\/\"> <span class=\"screen-reader-text\">Remote Backend State with Terraform and Azure Storage<\/span> Read More &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":2407,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"default","ast-global-header-display":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":""},"categories":[1159],"tags":[1163,9,992,554,1208,1164,1169,1174,1181,1172,1209,1210,1160,1165,1207,1170,1186,1175,1184,1171,1162,1185,1179,1178,1177,1183,1168,1211,962,268],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Remote Backend State with Terraform and Azure Storage - ciraltos<\/title>\n<meta name=\"description\" content=\"his post and accompanying video examines using a remote backend state on Azure Storage to host shared state files.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.ciraltos.com\/staging2\/remote-backend-state-with-terraform-and-azure-storage\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Remote Backend State with Terraform and Azure Storage - ciraltos\" \/>\n<meta property=\"og:description\" content=\"his post and accompanying video examines using a remote backend state on Azure Storage to host shared state files.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.ciraltos.com\/staging2\/remote-backend-state-with-terraform-and-azure-storage\/\" \/>\n<meta property=\"og:site_name\" content=\"ciraltos\" \/>\n<meta property=\"article:published_time\" content=\"2022-01-09T18:55:11+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-03-23T10:24:35+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.ciraltos.com\/staging2\/wp-content\/uploads\/2021\/12\/TerraformAzureLogo.png\" \/>\n\t<meta property=\"og:image:width\" content=\"169\" \/>\n\t<meta property=\"og:image:height\" content=\"162\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Travis Roberts\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@ciraltos\" \/>\n<meta name=\"twitter:site\" content=\"@ciraltos\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Travis Roberts\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.ciraltos.com\/staging2\/remote-backend-state-with-terraform-and-azure-storage\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.ciraltos.com\/staging2\/remote-backend-state-with-terraform-and-azure-storage\/\"},\"author\":{\"name\":\"Travis Roberts\",\"@id\":\"https:\/\/www.ciraltos.com\/staging2\/#\/schema\/person\/25391996d6cddfecd4d257162b7e373a\"},\"headline\":\"Remote Backend State with Terraform and Azure Storage\",\"datePublished\":\"2022-01-09T18:55:11+00:00\",\"dateModified\":\"2023-03-23T10:24:35+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.ciraltos.com\/staging2\/remote-backend-state-with-terraform-and-azure-storage\/\"},\"wordCount\":1023,\"commentCount\":5,\"publisher\":{\"@id\":\"https:\/\/www.ciraltos.com\/staging2\/#\/schema\/person\/25391996d6cddfecd4d257162b7e373a\"},\"keywords\":[\".tf\",\"Azure\",\"Azure CLI\",\"Azure Storage\",\"Backend\",\"HashiCorp\",\"IaC Terraform\",\"main.tf\",\"Modules\",\"registry\",\"remote backend\",\"shared state\",\"Terraform\",\"Terraform Apply\",\"terraform backend state\",\"Terraform Destroy\",\"Terraform Examples\",\"Terraform for Azure\",\"terraform modules\",\"Terraform Plan\",\"terraform registry\",\"Terraform Resource\",\"terraform training\",\"terraform tutorial\",\"terraform var\",\"terraform variables\",\"Terraform Write\",\"terraform.tfstate Azure Storage State\",\"VSCode\",\"workflow\"],\"articleSection\":[\"Terraform\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.ciraltos.com\/staging2\/remote-backend-state-with-terraform-and-azure-storage\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.ciraltos.com\/staging2\/remote-backend-state-with-terraform-and-azure-storage\/\",\"url\":\"https:\/\/www.ciraltos.com\/staging2\/remote-backend-state-with-terraform-and-azure-storage\/\",\"name\":\"Remote Backend State with Terraform and Azure Storage - ciraltos\",\"isPartOf\":{\"@id\":\"https:\/\/www.ciraltos.com\/staging2\/#website\"},\"datePublished\":\"2022-01-09T18:55:11+00:00\",\"dateModified\":\"2023-03-23T10:24:35+00:00\",\"description\":\"his post and accompanying video examines using a remote backend state on Azure Storage to host shared state files.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.ciraltos.com\/staging2\/remote-backend-state-with-terraform-and-azure-storage\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.ciraltos.com\/staging2\/remote-backend-state-with-terraform-and-azure-storage\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.ciraltos.com\/staging2\/remote-backend-state-with-terraform-and-azure-storage\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.ciraltos.com\/staging2\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Remote Backend State with Terraform and Azure Storage\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.ciraltos.com\/staging2\/#website\",\"url\":\"https:\/\/www.ciraltos.com\/staging2\/\",\"name\":\"ciraltos\",\"description\":\"cloud, technology and trends\",\"publisher\":{\"@id\":\"https:\/\/www.ciraltos.com\/staging2\/#\/schema\/person\/25391996d6cddfecd4d257162b7e373a\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.ciraltos.com\/staging2\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/www.ciraltos.com\/staging2\/#\/schema\/person\/25391996d6cddfecd4d257162b7e373a\",\"name\":\"Travis Roberts\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.ciraltos.com\/staging2\/#\/schema\/person\/image\/\",\"url\":\"http:\/\/www.ciraltos.com\/staging2\/wp-content\/uploads\/2023\/03\/Logo-1.png\",\"contentUrl\":\"http:\/\/www.ciraltos.com\/staging2\/wp-content\/uploads\/2023\/03\/Logo-1.png\",\"width\":5657,\"height\":3563,\"caption\":\"Travis Roberts\"},\"logo\":{\"@id\":\"https:\/\/www.ciraltos.com\/staging2\/#\/schema\/person\/image\/\"},\"sameAs\":[\"http:\/\/www.ciraltos.com\",\"https:\/\/twitter.com\/ciraltos\"],\"url\":\"http:\/\/www.ciraltos.com\/staging2\/author\/admin\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Remote Backend State with Terraform and Azure Storage - ciraltos","description":"his post and accompanying video examines using a remote backend state on Azure Storage to host shared state files.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.ciraltos.com\/staging2\/remote-backend-state-with-terraform-and-azure-storage\/","og_locale":"en_US","og_type":"article","og_title":"Remote Backend State with Terraform and Azure Storage - ciraltos","og_description":"his post and accompanying video examines using a remote backend state on Azure Storage to host shared state files.","og_url":"https:\/\/www.ciraltos.com\/staging2\/remote-backend-state-with-terraform-and-azure-storage\/","og_site_name":"ciraltos","article_published_time":"2022-01-09T18:55:11+00:00","article_modified_time":"2023-03-23T10:24:35+00:00","og_image":[{"width":169,"height":162,"url":"https:\/\/www.ciraltos.com\/staging2\/wp-content\/uploads\/2021\/12\/TerraformAzureLogo.png","type":"image\/png"}],"author":"Travis Roberts","twitter_card":"summary_large_image","twitter_creator":"@ciraltos","twitter_site":"@ciraltos","twitter_misc":{"Written by":"Travis Roberts","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.ciraltos.com\/staging2\/remote-backend-state-with-terraform-and-azure-storage\/#article","isPartOf":{"@id":"https:\/\/www.ciraltos.com\/staging2\/remote-backend-state-with-terraform-and-azure-storage\/"},"author":{"name":"Travis Roberts","@id":"https:\/\/www.ciraltos.com\/staging2\/#\/schema\/person\/25391996d6cddfecd4d257162b7e373a"},"headline":"Remote Backend State with Terraform and Azure Storage","datePublished":"2022-01-09T18:55:11+00:00","dateModified":"2023-03-23T10:24:35+00:00","mainEntityOfPage":{"@id":"https:\/\/www.ciraltos.com\/staging2\/remote-backend-state-with-terraform-and-azure-storage\/"},"wordCount":1023,"commentCount":5,"publisher":{"@id":"https:\/\/www.ciraltos.com\/staging2\/#\/schema\/person\/25391996d6cddfecd4d257162b7e373a"},"keywords":[".tf","Azure","Azure CLI","Azure Storage","Backend","HashiCorp","IaC Terraform","main.tf","Modules","registry","remote backend","shared state","Terraform","Terraform Apply","terraform backend state","Terraform Destroy","Terraform Examples","Terraform for Azure","terraform modules","Terraform Plan","terraform registry","Terraform Resource","terraform training","terraform tutorial","terraform var","terraform variables","Terraform Write","terraform.tfstate Azure Storage State","VSCode","workflow"],"articleSection":["Terraform"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.ciraltos.com\/staging2\/remote-backend-state-with-terraform-and-azure-storage\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.ciraltos.com\/staging2\/remote-backend-state-with-terraform-and-azure-storage\/","url":"https:\/\/www.ciraltos.com\/staging2\/remote-backend-state-with-terraform-and-azure-storage\/","name":"Remote Backend State with Terraform and Azure Storage - ciraltos","isPartOf":{"@id":"https:\/\/www.ciraltos.com\/staging2\/#website"},"datePublished":"2022-01-09T18:55:11+00:00","dateModified":"2023-03-23T10:24:35+00:00","description":"his post and accompanying video examines using a remote backend state on Azure Storage to host shared state files.","breadcrumb":{"@id":"https:\/\/www.ciraltos.com\/staging2\/remote-backend-state-with-terraform-and-azure-storage\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.ciraltos.com\/staging2\/remote-backend-state-with-terraform-and-azure-storage\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.ciraltos.com\/staging2\/remote-backend-state-with-terraform-and-azure-storage\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.ciraltos.com\/staging2\/"},{"@type":"ListItem","position":2,"name":"Remote Backend State with Terraform and Azure Storage"}]},{"@type":"WebSite","@id":"https:\/\/www.ciraltos.com\/staging2\/#website","url":"https:\/\/www.ciraltos.com\/staging2\/","name":"ciraltos","description":"cloud, technology and trends","publisher":{"@id":"https:\/\/www.ciraltos.com\/staging2\/#\/schema\/person\/25391996d6cddfecd4d257162b7e373a"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.ciraltos.com\/staging2\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/www.ciraltos.com\/staging2\/#\/schema\/person\/25391996d6cddfecd4d257162b7e373a","name":"Travis Roberts","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.ciraltos.com\/staging2\/#\/schema\/person\/image\/","url":"http:\/\/www.ciraltos.com\/staging2\/wp-content\/uploads\/2023\/03\/Logo-1.png","contentUrl":"http:\/\/www.ciraltos.com\/staging2\/wp-content\/uploads\/2023\/03\/Logo-1.png","width":5657,"height":3563,"caption":"Travis Roberts"},"logo":{"@id":"https:\/\/www.ciraltos.com\/staging2\/#\/schema\/person\/image\/"},"sameAs":["http:\/\/www.ciraltos.com","https:\/\/twitter.com\/ciraltos"],"url":"http:\/\/www.ciraltos.com\/staging2\/author\/admin\/"}]}},"_links":{"self":[{"href":"http:\/\/www.ciraltos.com\/staging2\/wp-json\/wp\/v2\/posts\/2425"}],"collection":[{"href":"http:\/\/www.ciraltos.com\/staging2\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.ciraltos.com\/staging2\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.ciraltos.com\/staging2\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.ciraltos.com\/staging2\/wp-json\/wp\/v2\/comments?post=2425"}],"version-history":[{"count":7,"href":"http:\/\/www.ciraltos.com\/staging2\/wp-json\/wp\/v2\/posts\/2425\/revisions"}],"predecessor-version":[{"id":3789,"href":"http:\/\/www.ciraltos.com\/staging2\/wp-json\/wp\/v2\/posts\/2425\/revisions\/3789"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/www.ciraltos.com\/staging2\/wp-json\/wp\/v2\/media\/2407"}],"wp:attachment":[{"href":"http:\/\/www.ciraltos.com\/staging2\/wp-json\/wp\/v2\/media?parent=2425"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.ciraltos.com\/staging2\/wp-json\/wp\/v2\/categories?post=2425"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.ciraltos.com\/staging2\/wp-json\/wp\/v2\/tags?post=2425"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}