Category Archives: Azure DevOps

Information related to Azure DevOps pipelines and related information

Azure Pipeline Conditions

October 31, 2024

Typical task condition statements look like this PowerShell task: Below are example condition statements. Note that you cannot use macro variable format such as $(Build.SourceBranch). Case is ignored on the variable names. Other useful conditions are available from Microsoft. Template Parameter Conditions (From Microsoft documents) Parameter expansion happens before conditions are considered. Therefore, when you declare a parameter… Read More »

Using PowerShell in Azure

October 31, 2024

Let’s start by saying the PowerShell is one of the most opaque and crappy languages that was ever created. I’m glad some people like it – but as far as me, it sucks. Adding PowerShell to Azure YAML Build Script Adding PowerShell scripts is easy. The example below shows how to create a script with embedded PowerShell code.… Read More »

Add Build Output Messages to Azure DevOps

September 11, 2024

Azure has a tool that is used in many DevOps YAML scripts. It has many capabilities – to the point of wondering why they crammed so many unrelated functions into one construct. All of this information is from a Microsoft Azure DevOps Services page: Logging commands. Check it out because I will not list these options: Show percentage… Read More »

Embed File in Assembly with MSBuild Targets

February 28, 2023

I have a problem – I want to automatically generate a license file then embed the file in my C# assembly. This solution works by creating a new MSBuild targets file and embedding it in my project (csproj) file. Let’s start by modifying my project file. I imported the new MSBuild targets file near the bottom of my… Read More »

Azure Pipeline Debugging Snippets

September 11, 2024

These are pipeline YAML snippets that I have found very handy. Print all Environmental Variables This is essential for debugging paths and composite variables. It generates an output similar to this. Notice that the environment variables are sorted and the trailing Format-Table with the -wrap parameter will ensure the values are not cut off at the end of… Read More »

Azure Pipeline Variables

August 14, 2024

There exists several types of variables that can be added to YAML scripts. I really like the Microsoft page that lays out a table that specifies the type of variable and when its value is computed and set. I have reproduced it below. The Azure documentation is listed in the Links section. Variable Naming Restrictions User-defined and environment… Read More »

Conditions and DependsOn in Azure Pipeline YAML

October 26, 2020

I needed the ability to automatically build one of several possible build types for testing. I also wanted to just change one variable in the YAML to update the build type. This is an excellent use for pipeline “conditions”. Conditions can be used to enable a step, job, or stage. In this example, the user can select between… Read More »

Typical Environment Variables in Azure DevOps Pipeline

August 13, 2024

This an an example of many of the environmental variables available to the build pipeline. The following YAML step… …created the following (excerpted) list. Variables are treated in different ways depending on the type it is and how it is references in the YAML file. See Azure Pipeline Variables article for more information.

Checkout Additional Git Repos in Azure Pipeline

October 26, 2020

The typical use case for my department is that when a build is triggered in Azure DevOps, we automatically load the single Git repository. Note that for these examples, the self repository is named ProductXYZ. the self repo is the one that triggered the build to occur because of an automatic trigger (someone committed changes to the repo)… Read More »