A workaround for not being able to access custom variables via stagedependencies if they are set in deployment jobs in Azure DevOps Pipelines

I have blogged in the past ( here and here) about the complexities and possible areas of confusion with different types of Azure DevOps pipeline variables. I have also seen issues raised over how to access custom variables across jobs and stages. Safe to say, this is an area where it is really easy to get it wrong and end up with a null value. I have recently come across another edge case to add to the list of gotchas....

February 19, 2022 · 2 min · Richard Fennell

The importance of blogging - or how to do your future self a favour

Yesterday, yet again, I was thankful for my past self taking time to blog about a technical solution I had found. I had an error when trying to digitally sign a package. On searching on the error code I came across my own blog post with the solution. This was, as usual, one I had no recollection of writing. I find this happens all the time. It is a little disturbing when you search for an issue and the only reference is to a post you made and have forgotten, so you are the defacto expert, nobody knows anymore on the subject, but better than having no solution....

January 14, 2022 · 1 min · Richard Fennell

Using Azure DevOps Stage Dependency Variables with Conditional Stage and Job Execution

I have been doing some work with Azure DevOps multi-stage YAML pipelines using stage dependency variables and conditions. They can get confusing quickly, you need one syntax in one place and another elsewhere. So, here are a few things I have learnt… What are stage dependency variables? Stage Dependencies are the way you define which stage follows another in a multi-stage YAML pipeline. This is as opposed to just relying on the order they appear in the YAML file, the default order....

January 10, 2022 · 5 min · Richard Fennell

Setting Azure DevOps 'All Repositories' Policies via the CLI

The Azure DevOps CLI provides plenty of commands to update Team Projects, but it does not cover all things you might want to set. A good example is setting branch policies. For a given repo you can set the policies using the Azure Repo command eg: az repos policy approver-count update --project <projectname> --blocking true --enabled true --branch main --repository-id <guid> --minimum-approver-count w --reset-on-source-push true --creator-vote-counts false --allow-downvotes false However, you hit a problem if you wish to set the ‘All Repositories’ policies for a Team Project....

November 12, 2021 · 1 min · Richard Fennell

The case of the self-cancelling Azure DevOps pipeline

The Issue Today I came across a strange issue with a reasonably old multi-stage YAML pipeline, it appeared to be cancelling itself. The Build stage ran OK, but the Release stage kept being shown as cancelled with a strange error. The strangest thing was it did not happen all the time. I guess this is the reason the problem had not been picked up sooner. If I looked at the logs for the Release stage, I saw that the main job, and meant to be the only job, had completed successfully....

October 29, 2021 · 2 min · Richard Fennell