{"id":2305,"date":"2021-12-05T12:08:44","date_gmt":"2021-12-05T18:08:44","guid":{"rendered":"https:\/\/www.ciraltos.com\/?p=2305"},"modified":"2023-03-23T05:31:46","modified_gmt":"2023-03-23T10:31:46","slug":"terraform-workflow-with-azure-write-plan-and-apply","status":"publish","type":"post","link":"https:\/\/www.ciraltos.com\/staging2\/terraform-workflow-with-azure-write-plan-and-apply\/","title":{"rendered":"Terraform Workflow with Azure: Write, Plan and Apply"},"content":{"rendered":"\n<p>This post is the second part of a multi-part blog post and video on Terraform with Azure.&nbsp; The previous video located <a href=\"https:\/\/www.ciraltos.com\/getting-started-with-terraform-and-azure-overview-and-setup\/\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\"here  (opens in a new tab)\">here <\/a>went over configuring an environment for Terraform and Azure.&nbsp; This post reviews the basic Terraform workflow.&nbsp; In the process, we create our first deployment to Azure with Terraform.<\/p>\n\n\n\n<!--more-->\n\n\n\n<figure class=\"wp-block-embed aligncenter 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=\"Terraform Workflow with Azure: Write, Plan and Apply\" width=\"500\" height=\"281\" src=\"https:\/\/www.youtube.com\/embed\/P06HZqrZUrw?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>The basic workflow for Terraform is to write, plan and\ndeploy. So let&#8217;s get started with the first step, writing the Terraform configuration.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large\"><img decoding=\"async\" src=\"https:\/\/www.ciraltos.com\/wp-content\/uploads\/2021\/11\/Workflow.png\" alt=\"\" class=\"wp-image-2306\"\/><figcaption class=\"wp-element-caption\"> Workflow <\/figcaption><\/figure>\n\n\n\n<h1>Write<\/h1>\n\n\n\n<p>Terraform uses a directory as a workspace.&nbsp; All Terraform files in a directory are treated\nas one file.&nbsp; We can split a configuration\ninto multiple files to make the configuration easier to read and understand,\nbut from Terraform&#8217;s perspective, they are all part of the same project.<\/p>\n\n\n\n<p>Directory structures are important to creating and organizing\nInfrastructure as Code (IaC).&nbsp; For this example,\nwe&#8217;ll start with a folder called TerraformProjects in the documents directory,\nthen add the first project Folder named ResourceGroup.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large\"><img decoding=\"async\" src=\"https:\/\/www.ciraltos.com\/wp-content\/uploads\/2021\/11\/Workspace-Directory.png\" alt=\"\" class=\"wp-image-2307\"\/><figcaption class=\"wp-element-caption\"> Workspace Directory <\/figcaption><\/figure>\n\n\n\n<p>Next, we create our first Terraform configuration file.&nbsp; Terraform uses the extension .tf for configuration\nfiles.&nbsp; There is also a .tf.json option\nfor JSON based configurations, but we&#8217;ll use .tf for this example.&nbsp; A common Terraform file is called <em>main.tf<\/em>.&nbsp; This file is the main configuration file for\na project.&nbsp; As stated earlier, Terraform\nconfiguration files in a directory are treated as a single file by Terraform.&nbsp; We use multiple configuration files to make\nthe code easier to read.<\/p>\n\n\n\n<p>Open VSCode and then go to file&gt;open folder. Next, select\nthe ResourceGroup folder created in the previous step.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large\"><img decoding=\"async\" src=\"https:\/\/www.ciraltos.com\/wp-content\/uploads\/2021\/11\/Create-Config-File.png\" alt=\"\" class=\"wp-image-2308\"\/><figcaption class=\"wp-element-caption\"> Create Config File <\/figcaption><\/figure>\n\n\n\n<p>Once the file is created, we can add the provider\ninformation.&nbsp; The provider information\ncan be added manually, but it&#8217;s easier to get the most up-to-date information\nfrom the Terraform Registry.&nbsp; Go to <a href=\"https:\/\/registry.terraform.io\/\">https:\/\/registry.terraform.io\/<\/a> and\nselect Azure.<\/p>\n\n\n\n<p>From there, you can get the code required to use AzureRM Provider\nfrom the &#8216;Use Provider&#8217; dropdown.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large\"><img decoding=\"async\" src=\"https:\/\/www.ciraltos.com\/wp-content\/uploads\/2021\/11\/Use-Provider.png\" alt=\"\" class=\"wp-image-2309\"\/><figcaption class=\"wp-element-caption\"> Use Provider <\/figcaption><\/figure>\n\n\n\n<p>Copy the code into the main.tf file. To set the AzureRM\nprovider.&nbsp; With this setting, the\nspecified version of the AzureRM provider is used whenever the code is deployed\nto new environments.&nbsp; Version control is\nimportant, if we always used the most recent version of Terraform, it&#8217;s\npossible that changes to an updated version could break the configuration.&nbsp; By specifying a version, we can update and\ntest new versions of Terraform with the code in a controlled manner.<\/p>\n\n\n\n<p>Next, we need to add the resource block.&nbsp; A resource block is the infrastructure to be\ndeployed to Azure.&nbsp; Multiple blocks are\nused to create complete infrastructure sets in Azure.&nbsp; For this example, we will deploy a single resource,\na Resource Group.&nbsp; <\/p>\n\n\n\n<p>The easiest way to add a resource is to go back to the Resource\nProvider in the Registry at <a href=\"https:\/\/registry.terraform.io\/\">https:\/\/registry.terraform.io\/<\/a>\nand change the view on the top right of the page to Documentation.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large\"><img decoding=\"async\" src=\"https:\/\/www.ciraltos.com\/wp-content\/uploads\/2021\/11\/Resource-Provider-Documentation.png\" alt=\"\" class=\"wp-image-2310\"\/><figcaption class=\"wp-element-caption\"> Resource Provider Documentation <\/figcaption><\/figure>\n\n\n\n<p>From here, we can search for the type of resource to deploy.&nbsp; Search for &#8216;Resource Group&#8217; and open\nBase&gt;Resources&gt;azurerm_resource_group.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large\"><img decoding=\"async\" src=\"https:\/\/www.ciraltos.com\/wp-content\/uploads\/2021\/11\/azurerm_resource_group.png\" alt=\"azurerm_resource_group\" class=\"wp-image-2311\"\/><figcaption class=\"wp-element-caption\"> azurerm_resource_group <\/figcaption><\/figure>\n\n\n\n<p>The azurerm_resource_group page provides information to create\na resource group, including an example and a list of required and optional\narguments to deploy the resource.&nbsp; <\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large\"><img decoding=\"async\" loading=\"lazy\" width=\"729\" height=\"607\" src=\"https:\/\/www.ciraltos.com\/wp-content\/uploads\/2021\/11\/Azure-Resource-Group-Example.png\" alt=\"Azure Resource Group Example\" class=\"wp-image-2312\" srcset=\"https:\/\/www.ciraltos.com\/staging2\/wp-content\/uploads\/2021\/11\/Azure-Resource-Group-Example.png 729w, https:\/\/www.ciraltos.com\/staging2\/wp-content\/uploads\/2021\/11\/Azure-Resource-Group-Example-300x250.png 300w\" sizes=\"(max-width: 729px) 100vw, 729px\" \/><figcaption class=\"wp-element-caption\"> Azure Resource Group Example <\/figcaption><\/figure>\n\n\n\n<p>Copy the example and paste it to the bottom of the main.tf\nfile in VSCode.&nbsp; Once done, the main.tf file\nwill look similar to below.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large\"><img decoding=\"async\" src=\"https:\/\/www.ciraltos.com\/wp-content\/uploads\/2021\/11\/Example-main.tf_.png\" alt=\"Example main.tf\" class=\"wp-image-2313\"\/><figcaption class=\"wp-element-caption\"> Example main.tf <\/figcaption><\/figure>\n\n\n\n<p>A resource block starts with the word Resource. Next is the resource\ntype, azurerm_resource_group, for this example.&nbsp;\nAfter that is the local name, <em>example<\/em> in the image above.<\/p>\n\n\n\n<p>Terraform uses the word \u2018example\u2019 frequently in the examples.&nbsp; The image above shows example for the local\nname and the resource name.&nbsp; These two\nitems do not need to be named the same, and they are not related other than being\nin the same resource block.&nbsp; Change the\nfirst instance of <em>example<\/em>, the local name, to &#8216;resoucegroup&#8217;.<\/p>\n\n\n\n<p>A local name is for internal terraform use only.&nbsp; We can reference the resource in other\nsections of code with the local name.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large\"><img decoding=\"async\" src=\"https:\/\/www.ciraltos.com\/wp-content\/uploads\/2021\/11\/Resource-Local-Name.png\" alt=\"Resource Local Name \" class=\"wp-image-2315\"\/><figcaption class=\"wp-element-caption\"> Resource Local Name  <\/figcaption><\/figure>\n\n\n\n<p>The next instance of <em>example<\/em> is the name that the resource\nwill have in Azure.&nbsp; For this example,\nchange that to &#8216;TerraformRG&#8217;.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img alt=\"\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large\"><img decoding=\"async\" loading=\"lazy\" width=\"515\" height=\"416\" src=\"https:\/\/www.ciraltos.com\/wp-content\/uploads\/2021\/11\/Resource-Group-Name.png\" alt=\"Resource Group Name\" class=\"wp-image-2316\" srcset=\"https:\/\/www.ciraltos.com\/staging2\/wp-content\/uploads\/2021\/11\/Resource-Group-Name.png 515w, https:\/\/www.ciraltos.com\/staging2\/wp-content\/uploads\/2021\/11\/Resource-Group-Name-300x242.png 300w\" sizes=\"(max-width: 515px) 100vw, 515px\" \/><figcaption class=\"wp-element-caption\"> Resource Group Name <\/figcaption><\/figure>\n\n\n\n<p>Save the file.&nbsp;\nTerraform uses files in the directory, and if they are not saved,\nchanges won&#8217;t apply.<\/p>\n\n\n\n<p>Now that we have the main.tf updated with a resource, we can\ninitialize the directory.&nbsp; Do this by opening\na terminal window by going to Terminal, New Terminal.<\/p>\n\n\n\n<p>Next, run the command:<\/p>\n\n\n\n<p><em>terraform init<\/em><\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large\"><img decoding=\"async\" src=\"https:\/\/www.ciraltos.com\/wp-content\/uploads\/2021\/11\/terraform-init.png\" alt=\"terraform init\" class=\"wp-image-2317\"\/><figcaption class=\"wp-element-caption\"> terraform init <\/figcaption><\/figure>\n\n\n\n<p>## If you get a message that Terraform can&#8217;t be found, be\nsure you downloaded and extracted the terraform.exe and updated the system path\nto include the location.<\/p>\n\n\n\n<p>As stated previously, terraform works at the directory.&nbsp; Running the <em>terraform init<\/em> command initializes\nthe directory for Terraform.&nbsp; It creates\na new folder called .terraform and adds the specified version of the resource provider\nto the directory.&nbsp; It also makes a terraform.lock.hcl\nfile.&nbsp; This is a dependency lock file\nused to track provider dependencies.&nbsp;\nBoth the .terraform directory and terraform.lock.hcl file are maintained\nby Terraform.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large\"><img decoding=\"async\" loading=\"lazy\" width=\"638\" height=\"240\" src=\"https:\/\/www.ciraltos.com\/wp-content\/uploads\/2021\/11\/Terraform-Managed-Files.png\" alt=\"Terraform Managed Files\" class=\"wp-image-2318\" srcset=\"https:\/\/www.ciraltos.com\/staging2\/wp-content\/uploads\/2021\/11\/Terraform-Managed-Files.png 638w, https:\/\/www.ciraltos.com\/staging2\/wp-content\/uploads\/2021\/11\/Terraform-Managed-Files-300x113.png 300w\" sizes=\"(max-width: 638px) 100vw, 638px\" \/><figcaption class=\"wp-element-caption\"> Terraform Managed Files <\/figcaption><\/figure>\n\n\n\n<p>We have successfully written our first Terraform\nconfiguration file.&nbsp; One important note, any\ntime configuration files are updated in the directory, the changes need to be saved\nthen re-initialized by running the <em>terraform init<\/em> command.<\/p>\n\n\n\n<h1>Log in to Azure<\/h1>\n\n\n\n<p>Logging into Azure is not a designated step in the Terraform\nWorkflow, but it is required before we can deploy resources.&nbsp; Below is a list of commands to log in and\nupdate Azure CLI with the Account extension. Also included are steps to verify we\nare on the correct subscription and if not, change the subscription.&nbsp; <\/p>\n\n\n\n<blockquote class=\"wp-block-quote\">\n<p>Please note, you may need to type these commands in as this was edited in Word, and sometimes a dash isn&#8217;t a dash??<\/p>\n<\/blockquote>\n\n\n\n<p>First, log in with the az login command.<\/p>\n\n\n\n<p><em>az login <\/em><\/p>\n\n\n\n<p>Next, add the account extension for the Azure CLI with the\ncommand below.&nbsp; This is required for the az\naccount commands.<\/p>\n\n\n\n<p><em>az extension add &#8211;upgrade -n account<\/em><\/p>\n\n\n\n<p>If you have more then one subscription, verify you are on\nthe correct one with the az account show command.<\/p>\n\n\n\n<p><em>az account show<\/em><\/p>\n\n\n\n<p>If you need to switch subscriptions, use the command below\nto list all subscriptions.<\/p>\n\n\n\n<p><em>az account subscription list<\/em><\/p>\n\n\n\n<p>To change the subscription, use the command below with the\nname of the subscription you want to use.<\/p>\n\n\n\n<p><em>az account set &#8211;subscription &#8220;&lt;Subscription\nName&gt;&#8221;<\/em><\/p>\n\n\n\n<p>Verify the subscription was switched by running the <em>az\naccount show<\/em> command again.<\/p>\n\n\n\n<h1>Plan<\/h1>\n\n\n\n<p>Now that the directory is initialized and we are logged into\nAzure, we can plan a deployment.&nbsp; A Terraform\nplan reads the current state of remote objects and makes sure it&#8217;s up to\ndate.&nbsp; It also compares the current configuration\nwith the prior state and notes any differences. Terraform plan uses this\ninformation to create a plan of changes that will take place.<\/p>\n\n\n\n<p>At the command prompt, type <em>terraform plan<\/em> to run the\nplan.<\/p>\n\n\n\n<p>The output will show one addition, the Resource Group, for\nthis example.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large\"><img decoding=\"async\" src=\"https:\/\/www.ciraltos.com\/wp-content\/uploads\/2021\/11\/Terraform-Plan-1024x314.png\" alt=\"Terraform Plan\" class=\"wp-image-2319\"\/><figcaption class=\"wp-element-caption\"> Terraform Plan <\/figcaption><\/figure>\n\n\n\n<p>Terraform Plan runs a &#8220;what if&#8221; analysis of the\ncurrent environment against the proposed changes.&nbsp; If the output looks as expected, we can move\nonto applying the configuration.<\/p>\n\n\n\n<h1>Apply<\/h1>\n\n\n\n<p>We have our configuration file written and we agree to the plan;\nnow it&#8217;s time to apply the changes with the <em>terraform apply<\/em>\ncommand.&nbsp; This will run a terraform plan\nand then prompt you to confirm the changes.&nbsp;\nOnce confirmed, the changes are written to Azure.<\/p>\n\n\n\n<p>Run <em>terraform apply<\/em> to apply the configuration.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large\"><img decoding=\"async\" loading=\"lazy\" width=\"460\" height=\"316\" src=\"https:\/\/www.ciraltos.com\/wp-content\/uploads\/2021\/11\/Terraform-Apply-Confirmation.png\" alt=\"Terraform Apply Confirmation\" class=\"wp-image-2320\" srcset=\"https:\/\/www.ciraltos.com\/staging2\/wp-content\/uploads\/2021\/11\/Terraform-Apply-Confirmation.png 460w, https:\/\/www.ciraltos.com\/staging2\/wp-content\/uploads\/2021\/11\/Terraform-Apply-Confirmation-300x206.png 300w\" sizes=\"(max-width: 460px) 100vw, 460px\" \/><figcaption class=\"wp-element-caption\"> Terraform Apply Confirmation <\/figcaption><\/figure>\n\n\n\n<p>Once the change is confirmed, the configuration is\napplied.&nbsp; In the end, you will see a\nnotice that the apply completed.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" loading=\"lazy\" width=\"516\" height=\"318\" src=\"https:\/\/www.ciraltos.com\/wp-content\/uploads\/2021\/11\/Terraform-Apply-Completed.png\" alt=\"Terraform Apply Completed\" class=\"wp-image-2321\" srcset=\"https:\/\/www.ciraltos.com\/staging2\/wp-content\/uploads\/2021\/11\/Terraform-Apply-Completed.png 516w, https:\/\/www.ciraltos.com\/staging2\/wp-content\/uploads\/2021\/11\/Terraform-Apply-Completed-300x185.png 300w\" sizes=\"(max-width: 516px) 100vw, 516px\" \/><figcaption class=\"wp-element-caption\"> Terraform Apply Completed <\/figcaption><\/figure>\n\n\n\n<p>You can verify the change by viewing the new resource group\nin the Azure portal or by running the command below.&nbsp; Update the Resource Group name if yours is different.<\/p>\n\n\n\n<p><em>az group list &#8211;query &#8220;[?name==&#8217;TerraformRG&#8217;]&#8221;<\/em><\/p>\n\n\n\n<p>Once applied, you will notice a new terraform.state file in\nthe directory. &nbsp;&nbsp;The Terraform state file\ntracks the status of resources Terraform manages.&nbsp; It maps real world resources to the\nconfiguration.&nbsp; &nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large\"><img decoding=\"async\" loading=\"lazy\" width=\"316\" height=\"176\" src=\"https:\/\/www.ciraltos.com\/wp-content\/uploads\/2021\/11\/Terraform-State.png\" alt=\"Terraform State\" class=\"wp-image-2322\" srcset=\"https:\/\/www.ciraltos.com\/staging2\/wp-content\/uploads\/2021\/11\/Terraform-State.png 316w, https:\/\/www.ciraltos.com\/staging2\/wp-content\/uploads\/2021\/11\/Terraform-State-300x167.png 300w\" sizes=\"(max-width: 316px) 100vw, 316px\" \/><figcaption class=\"wp-element-caption\"> Terraform State <\/figcaption><\/figure>\n\n\n\n<h1>Destroy<\/h1>\n\n\n\n<p>It may be necessary at times to remove a configuration.&nbsp; We can do this with the destroy command.&nbsp; This will remove all items deployed with the Terraform\nplan.&nbsp; The command to remove the\ndeployment is:<\/p>\n\n\n\n<p><em>terraform destroy<\/em><\/p>\n\n\n\n<p>Run the destroy command and use the <em>az grop list<\/em>\ncommand to verify that resource group was removed.<\/p>\n\n\n\n<h1>Conclusion<\/h1>\n\n\n\n<p>This post covered a lot of information. The example in this post was a simple deployment, but the workflow will be similar for larger deployments. The Terraform AzureRM reference documentation will be important as we build more complex environments.&nbsp; The examples and arguments are valuable references for future projects.&nbsp; <\/p>\n\n\n\n<p>You can find the next post on input variables <a href=\"https:\/\/www.ciraltos.com\/input-variables-with-terraform-and-azure\/\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\"here (opens in a new tab)\">here<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This post is the second part of a multi-part blog post and video on Terraform with Azure.&nbsp; The previous video located here went over configuring an environment for Terraform and Azure.&nbsp; This post reviews the basic Terraform workflow.&nbsp; In the process, we create our first deployment to Azure with Terraform.<\/p>\n","protected":false},"author":1,"featured_media":0,"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,1164,1169,1172,1160,1165,1170,1175,1171,1162,1167,1168,962,1173],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Terraform Workflow with Azure: Write, Plan and Apply - ciraltos<\/title>\n<meta name=\"description\" content=\"This post reviews the basic Terraform workflow of write, plan and apply. In the process, we create our first deployment to Azure with Terraform.\" \/>\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\/terraform-workflow-with-azure-write-plan-and-apply\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Terraform Workflow with Azure: Write, Plan and Apply - ciraltos\" \/>\n<meta property=\"og:description\" content=\"This post reviews the basic Terraform workflow of write, plan and apply. In the process, we create our first deployment to Azure with Terraform.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.ciraltos.com\/staging2\/terraform-workflow-with-azure-write-plan-and-apply\/\" \/>\n<meta property=\"og:site_name\" content=\"ciraltos\" \/>\n<meta property=\"article:published_time\" content=\"2021-12-05T18:08:44+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-03-23T10:31:46+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.ciraltos.com\/wp-content\/uploads\/2021\/11\/Workflow.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=\"10 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.ciraltos.com\/staging2\/terraform-workflow-with-azure-write-plan-and-apply\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.ciraltos.com\/staging2\/terraform-workflow-with-azure-write-plan-and-apply\/\"},\"author\":{\"name\":\"Travis Roberts\",\"@id\":\"http:\/\/www.ciraltos.com\/staging2\/#\/schema\/person\/25391996d6cddfecd4d257162b7e373a\"},\"headline\":\"Terraform Workflow with Azure: Write, Plan and Apply\",\"datePublished\":\"2021-12-05T18:08:44+00:00\",\"dateModified\":\"2023-03-23T10:31:46+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.ciraltos.com\/staging2\/terraform-workflow-with-azure-write-plan-and-apply\/\"},\"wordCount\":1564,\"commentCount\":0,\"publisher\":{\"@id\":\"http:\/\/www.ciraltos.com\/staging2\/#\/schema\/person\/25391996d6cddfecd4d257162b7e373a\"},\"keywords\":[\".tf\",\"Azure\",\"Azure CLI\",\"HashiCorp\",\"IaC Terraform\",\"registry\",\"Terraform\",\"Terraform Apply\",\"Terraform Destroy\",\"Terraform for Azure\",\"Terraform Plan\",\"terraform registry\",\"Terraform Resouce\",\"Terraform Write\",\"VSCode\",\"workdlow\"],\"articleSection\":[\"Terraform\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.ciraltos.com\/staging2\/terraform-workflow-with-azure-write-plan-and-apply\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.ciraltos.com\/staging2\/terraform-workflow-with-azure-write-plan-and-apply\/\",\"url\":\"https:\/\/www.ciraltos.com\/staging2\/terraform-workflow-with-azure-write-plan-and-apply\/\",\"name\":\"Terraform Workflow with Azure: Write, Plan and Apply - ciraltos\",\"isPartOf\":{\"@id\":\"http:\/\/www.ciraltos.com\/staging2\/#website\"},\"datePublished\":\"2021-12-05T18:08:44+00:00\",\"dateModified\":\"2023-03-23T10:31:46+00:00\",\"description\":\"This post reviews the basic Terraform workflow of write, plan and apply. In the process, we create our first deployment to Azure with Terraform.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.ciraltos.com\/staging2\/terraform-workflow-with-azure-write-plan-and-apply\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.ciraltos.com\/staging2\/terraform-workflow-with-azure-write-plan-and-apply\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.ciraltos.com\/staging2\/terraform-workflow-with-azure-write-plan-and-apply\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"http:\/\/www.ciraltos.com\/staging2\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Terraform Workflow with Azure: Write, Plan and Apply\"}]},{\"@type\":\"WebSite\",\"@id\":\"http:\/\/www.ciraltos.com\/staging2\/#website\",\"url\":\"http:\/\/www.ciraltos.com\/staging2\/\",\"name\":\"ciraltos\",\"description\":\"cloud, technology and trends\",\"publisher\":{\"@id\":\"http:\/\/www.ciraltos.com\/staging2\/#\/schema\/person\/25391996d6cddfecd4d257162b7e373a\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"http:\/\/www.ciraltos.com\/staging2\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"http:\/\/www.ciraltos.com\/staging2\/#\/schema\/person\/25391996d6cddfecd4d257162b7e373a\",\"name\":\"Travis Roberts\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"http:\/\/www.ciraltos.com\/staging2\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/www.ciraltos.com\/staging2\/wp-content\/uploads\/2023\/03\/Logo-1.png\",\"contentUrl\":\"https:\/\/www.ciraltos.com\/staging2\/wp-content\/uploads\/2023\/03\/Logo-1.png\",\"width\":5657,\"height\":3563,\"caption\":\"Travis Roberts\"},\"logo\":{\"@id\":\"http:\/\/www.ciraltos.com\/staging2\/#\/schema\/person\/image\/\"},\"sameAs\":[\"http:\/\/www.ciraltos.com\",\"https:\/\/twitter.com\/ciraltos\"],\"url\":\"https:\/\/www.ciraltos.com\/staging2\/author\/admin\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Terraform Workflow with Azure: Write, Plan and Apply - ciraltos","description":"This post reviews the basic Terraform workflow of write, plan and apply. In the process, we create our first deployment to Azure with Terraform.","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\/terraform-workflow-with-azure-write-plan-and-apply\/","og_locale":"en_US","og_type":"article","og_title":"Terraform Workflow with Azure: Write, Plan and Apply - ciraltos","og_description":"This post reviews the basic Terraform workflow of write, plan and apply. In the process, we create our first deployment to Azure with Terraform.","og_url":"https:\/\/www.ciraltos.com\/staging2\/terraform-workflow-with-azure-write-plan-and-apply\/","og_site_name":"ciraltos","article_published_time":"2021-12-05T18:08:44+00:00","article_modified_time":"2023-03-23T10:31:46+00:00","og_image":[{"url":"https:\/\/www.ciraltos.com\/wp-content\/uploads\/2021\/11\/Workflow.png"}],"author":"Travis Roberts","twitter_card":"summary_large_image","twitter_creator":"@ciraltos","twitter_site":"@ciraltos","twitter_misc":{"Written by":"Travis Roberts","Est. reading time":"10 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.ciraltos.com\/staging2\/terraform-workflow-with-azure-write-plan-and-apply\/#article","isPartOf":{"@id":"https:\/\/www.ciraltos.com\/staging2\/terraform-workflow-with-azure-write-plan-and-apply\/"},"author":{"name":"Travis Roberts","@id":"http:\/\/www.ciraltos.com\/staging2\/#\/schema\/person\/25391996d6cddfecd4d257162b7e373a"},"headline":"Terraform Workflow with Azure: Write, Plan and Apply","datePublished":"2021-12-05T18:08:44+00:00","dateModified":"2023-03-23T10:31:46+00:00","mainEntityOfPage":{"@id":"https:\/\/www.ciraltos.com\/staging2\/terraform-workflow-with-azure-write-plan-and-apply\/"},"wordCount":1564,"commentCount":0,"publisher":{"@id":"http:\/\/www.ciraltos.com\/staging2\/#\/schema\/person\/25391996d6cddfecd4d257162b7e373a"},"keywords":[".tf","Azure","Azure CLI","HashiCorp","IaC Terraform","registry","Terraform","Terraform Apply","Terraform Destroy","Terraform for Azure","Terraform Plan","terraform registry","Terraform Resouce","Terraform Write","VSCode","workdlow"],"articleSection":["Terraform"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.ciraltos.com\/staging2\/terraform-workflow-with-azure-write-plan-and-apply\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.ciraltos.com\/staging2\/terraform-workflow-with-azure-write-plan-and-apply\/","url":"https:\/\/www.ciraltos.com\/staging2\/terraform-workflow-with-azure-write-plan-and-apply\/","name":"Terraform Workflow with Azure: Write, Plan and Apply - ciraltos","isPartOf":{"@id":"http:\/\/www.ciraltos.com\/staging2\/#website"},"datePublished":"2021-12-05T18:08:44+00:00","dateModified":"2023-03-23T10:31:46+00:00","description":"This post reviews the basic Terraform workflow of write, plan and apply. In the process, we create our first deployment to Azure with Terraform.","breadcrumb":{"@id":"https:\/\/www.ciraltos.com\/staging2\/terraform-workflow-with-azure-write-plan-and-apply\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.ciraltos.com\/staging2\/terraform-workflow-with-azure-write-plan-and-apply\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.ciraltos.com\/staging2\/terraform-workflow-with-azure-write-plan-and-apply\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"http:\/\/www.ciraltos.com\/staging2\/"},{"@type":"ListItem","position":2,"name":"Terraform Workflow with Azure: Write, Plan and Apply"}]},{"@type":"WebSite","@id":"http:\/\/www.ciraltos.com\/staging2\/#website","url":"http:\/\/www.ciraltos.com\/staging2\/","name":"ciraltos","description":"cloud, technology and trends","publisher":{"@id":"http:\/\/www.ciraltos.com\/staging2\/#\/schema\/person\/25391996d6cddfecd4d257162b7e373a"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"http:\/\/www.ciraltos.com\/staging2\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"http:\/\/www.ciraltos.com\/staging2\/#\/schema\/person\/25391996d6cddfecd4d257162b7e373a","name":"Travis Roberts","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"http:\/\/www.ciraltos.com\/staging2\/#\/schema\/person\/image\/","url":"https:\/\/www.ciraltos.com\/staging2\/wp-content\/uploads\/2023\/03\/Logo-1.png","contentUrl":"https:\/\/www.ciraltos.com\/staging2\/wp-content\/uploads\/2023\/03\/Logo-1.png","width":5657,"height":3563,"caption":"Travis Roberts"},"logo":{"@id":"http:\/\/www.ciraltos.com\/staging2\/#\/schema\/person\/image\/"},"sameAs":["http:\/\/www.ciraltos.com","https:\/\/twitter.com\/ciraltos"],"url":"https:\/\/www.ciraltos.com\/staging2\/author\/admin\/"}]}},"_links":{"self":[{"href":"https:\/\/www.ciraltos.com\/staging2\/wp-json\/wp\/v2\/posts\/2305"}],"collection":[{"href":"https:\/\/www.ciraltos.com\/staging2\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ciraltos.com\/staging2\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ciraltos.com\/staging2\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ciraltos.com\/staging2\/wp-json\/wp\/v2\/comments?post=2305"}],"version-history":[{"count":3,"href":"https:\/\/www.ciraltos.com\/staging2\/wp-json\/wp\/v2\/posts\/2305\/revisions"}],"predecessor-version":[{"id":3798,"href":"https:\/\/www.ciraltos.com\/staging2\/wp-json\/wp\/v2\/posts\/2305\/revisions\/3798"}],"wp:attachment":[{"href":"https:\/\/www.ciraltos.com\/staging2\/wp-json\/wp\/v2\/media?parent=2305"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ciraltos.com\/staging2\/wp-json\/wp\/v2\/categories?post=2305"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ciraltos.com\/staging2\/wp-json\/wp\/v2\/tags?post=2305"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}