Member-only story

Using a YAML Pipeline to Collect DevTest Labs VM Details in Azure DevOps

Luca Berton
7 min readOct 6, 2024

In modern DevOps practices, YAML-based pipelines have largely replaced the classic pipeline structure in Azure DevOps due to their flexibility, code-based structure, and version control benefits. This article will walk you through how to set up a YAML pipeline that collects the details of a DevTest Labs VM by running an Azure PowerShell script, which is stored in your repository.

Instead of using the classic release pipeline interface to add tasks manually, we will define everything in the YAML pipeline file, making it easier to manage and track changes over time.

Overview

We will cover the following steps:

  1. Setting up a YAML pipeline that interacts with Azure DevTest Labs.
  2. Running an Azure PowerShell script to collect the VM details.
  3. Using pipeline variables to pass the Lab VM ID (labVmId) between tasks.
  4. Referencing the PowerShell script stored in the repository.

Step 1: Setting Up the YAML Pipeline

Here’s how you can structure the YAML pipeline to create and manage a DevTest Labs VM and run a PowerShell script to collect the VM details.

Example YAML Pipeline

--

--

Luca Berton
Luca Berton

Written by Luca Berton

I help creative Automation DevOps, Cloud Engineer, System Administrator, and IT Professional to succeed with Ansible Technology to automate more things everyday

No responses yet