Upload Terraform State files to remote backend – Amazon S3 and Azure Storage Account

As you might have already learned, Terraform stores information about the infrastructure managed by it by using state files. By default, if we run Terraform code in a directory named /code/tf, it will record state in a file named /code/tf/terraform.tfstate file. This file contains data in JSON format which contains information about resources mentioned in the configuration files from the real-world infrastructure. Using this file, terraform knows what has been deployed and compare that to what has been mentioned in the configuration files, and come up with a plan on what needs to be changed. So its very critical that terraform is referring to correct state file, which ideally should be 1:1 mapping of real-world infrastructure.

Read More »

Storing and Managing Terraform files as Git Repository

This is the 7th part in the series of blog posts on managing the Azure DevOps using Terraform. You can find the series index here. Although this is the one of the part in the series, this can also be a completely independent post in itself. In this post, we’ll be using a Git repository to store the Terraform code files and discuss the best practices around it. This aligns with one of the practices in the Infrastructure as Code (IaC) framework and somewhat aligns with what is now a days known as GitOps framework. We’ll not go into details of if GitOps is suitable for Terraform or not into this post.

Read More »

Using Terraform to create Service Endpoints in Azure DevOps

This is the 6th part in the series of blog posts on managing the Azure DevOps using Terraform. You can find the series index here. In the last part, we discussed the build pipeline creation using Terraform, where we covered only build and testing stages. We could have added release stage as well, but before we deploy anything to Azure, AWS, etc, we need to create respective service endpoints in the Azure DevOps project. In this part, we’ll discuss how we can create service endpoints using Terraform. One of the pre-requisites to create service endpoints is to have a service principal ready, which is basically used for authentication.

Read More »

Using Terraform to define Azure DevOps Variables and Build Pipeline

This is the 5th post in the series of blog posts on managing Azure DevOps using the Terraform. You can find the series index here. In this blog post, we’ll learn to define variables and variable groups within the Azure DevOps as well as creating a Build pipeline, both using Terraform. We’ll be building onto our previous code where we ended up creating a git repository in the Azure DevOps Project. Although going through previous posts is not required to understand the concepts explained here, but its good to have a look because we’ll be referring parts of code from previous posts.

Read More »

Using Terraform to Manage Azure DevOps Project Permissions

This is the 4th part in the series of the blog posts on managing the Azure DevOps using Terraform. You can find the series index here. In this part, we’ll discuss how to create user entitlements, create groups and manage group membership for Azure DevOps Project all using Terraform. For this, we have to use multiple resources from the Terraform Provider and also use data sources to read information back from the Azure DevOps. There are lots of permutations and combinations possible here. Since its not possible to cover every situation, we’ll discuss only some of them.

Read More »

Using Terraform to Create and Initialize Azure DevOps Repos

This is the 3rd part in the series of blog posts on managing the Azure DevOps using Terraform. You can find the series index here. In this blog post, we’ll create an Azure Repository to store source code for the developers using Terraform. We can create an empty repository as well as create a fork from another repository. The master repository needs to be an already hosted Azure DevOps repository. Do note that for fork to work, you need to use a PAT which has required access to the parent project. The code we have written has a little deviation from the official documentation, and we’ll discuss the same as well. Being the first provider version, such a small issue is quite likely and expected.

Read More »

Using Terraform to Manage Azure DevOps Project features

This is the 2nd part in the series of blog posts on managing the Azure DevOps using Terraform. You can find the series index here. In this blog post, we’ll discuss how to manage the Azure DevOps Project features – Boards, Pipelines, Test Plans, Repositories and Artifacts using Terraform. By default, when deploying an Azure DevOps Project, all these features are enabled. However, certain teams may like to enable only certain features for satisfying specific requirements. We can manage the same in Terraform deployment using the features block in the azuredevops_project resource or via using the separate azuredevops_project_features resource. We’ll also discuss which one is a better and preferred method and why.

Read More »

Using Terraform to Manage Azure DevOps – Index

This post contains index for all blog posts related to using Terraform to Manage Azure DevOps using Azure DevOps provider. It can be used to get a quick overview of and navigate to find the related post of interest.

Teil 1 – Getting started with the Terraform Provider for Azure DevOps, configuring authentication, Create / Update / Delete an Azure DevOps project

Teil 2 – Control Azure DevOps Project features – Boards, Pipelines, Test Plans, Repositories and Artifacts using Terraform, Using Inline and Separate resource blocks in Terraform

Read More »