In my recent client I had a feature to get the list of private IP addresses of Azure virtual machines based on theirs tags.

For apply this I used the Azure cli tools and execute this command

az vm list-ip-addresses --ids $(az resource list --query "[?type=='Microsoft.Compute/virtualMachines' && tags.ENV == 'DEV'].id" --output tsv) --query "[].virtualMachine.network.privateIpAddresses[0]" | jq -r @csv
Read More

In this article I present how I build my private Azure pipeline agent in Azure based on Packer script provided by Microsoft that it’s use for build the Hosted Azure pipeline agent.

For build my private agent I do that in 4 steps:

  1. Create an image (VHD format) with Packer script provided by Microsoft
  2. Use this VHD for create a custom VM image with Terraform
  3. Provision a new Azure DevOps Pipeline Agent VM with Terraform
  4. Install and Configure the Azure DevOps Pipeline Agent with Ansible
Read More

This post is the second of the multiple infrastructure deployment with Terraform subject and in this part we will see how to use remotes backend in Azure.

One of great strengths of Terraform is maintaining the state of the environment it applies in a tfstate file. This file in Json format allows Terraform to apply only the differential for each execution. It is on this file that Terraform is based when executing plan/apply/destroy commands.

For more information about the tfstate read the official documentation.

Read More

This article is part of the series on using Terraform in Azure and after explaining how to get started with Terraform in Azure, I will share my experience with using Terraform to provision your infrastructure for several environments.

Indeed, in a DevOps process in which your application will be deployed on several environments (example Dev - Test - QA - Production), it is the same for the infrastructure.

In Terraform there are several concepts that allow you to provision our infrastructure on multiple environments by having a maintainable code.

Among these concepts there are 2 that I will share to you, that are usage of:

  • Variables
  • Remotes backends for tfstates in Azure Storage
Read More