Refreshing Terraform state prior to plan...
The Terraform execution plan has been generated and is shown below.
Resources are shown in alphabetical order for quick scanning. Green resources
will be created (or destroyed and then created if an existing resource
exists), yellow resources are being changed in-place, and red resources
will be destroyed.
Note: You didn't specify an "-out" parameter to save this plan, so when
"apply" is called, Terraform can't guarantee this is what will execute.
+ azurerm_resource_group.test
location: "" => "westeurope"
name: "" => "HelloWorld"
Plan: 1 to add, 0 to change, 0 to destroy.

Next you can apply the plan to Azure, run: terraform apply

azurerm_resource_group.test: Creating...
location: "" => "westeurope"
name: "" => "HelloWorld"
azurerm_resource_group.test: Creation complete
Apply complete! Resources: 1 added, 0 changed, 0 destroyed.
The state of your infrastructure has been saved to the path
below. This state is required to modify and destroy your
infrastructure, so keep it safe. To inspect the complete state
use the `terraform show` command.
State path: terraform.tfstate

Now we have created our first azurerm_resource_group. Next we can expand the resource group with more azure infrastructure. Lets add a VM with Windows Datacenter to the deployment:

Now you have seen creating a Terraform template, and updating the template with Terraform on AzureRM. More information on what resources are available from the azurerm provider, check the Terraform documentation.

10 thoughts on “Getting started with Terraform on Windows and Azure”

I like you VSTS Custom Build Task. I couldn’t find a post on your blog about it. I like that it can use the Azure Service Principal Endpoint. I’m interested in how you wrote the VSTS Custom Build Task and how to integrate with this feature, I’m guessing you can call some VSTS PowerShell module commands.