Tag Archives: YAML

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 »