Updating the Azure Application client_secret used by Packer

As I have posted about previously, we create our Azure DevOps build agent images using the same Packer definitions as used by Microsoft. This time when I ran my Packer command to build an updated VHD I got the error Build ‘vhd’ errored after 135 milliseconds 708 microseconds: adal: Refresh request failed. Status Code = ‘401’. Response body: {“error”:“invalid_client”,“error_description”:“AADSTS7000222: The provided client secret keys for app ‘6425416f-aa94-4c20-8395-XXXXXXX’ are expired. Visit the Azure portal to create new keys for your app: https://aka....

May 3, 2022 · 1 min · Richard Fennell

Speaking at the rescheduled Microsoft and GitHub DevOps Forum on the 4th of May

I’m speaking at the resheduled Microsoft and GitHub DevOps Forum on the 4th of March. To Register: https://mktoevents.com/Microsoft+Event/333304/157-GQE-382?wt.mc_id=AID3045587_QSG_EML_586670

April 7, 2022 · 1 min · Richard Fennell

Fix for Azure DevOps deployment to an environment stuck in "Job is pending" state

Issue I had an Azure DevOps YAML based pipeline that had been working but was now getting stuck with the message “Job is pending…” when trying to start a stage in which there is a deployment to an environment. Looking at the logs and Azure DevOps UI it was not obvious what the issue was. Solution Turns out it was due to environment checks and approvals. There was a branch policy on the environment....

April 7, 2022 · 1 min · Richard Fennell

Speaking at the Microsoft and GitHub DevOps Forum on the 10th of March

Update: This event has been rescheduled for the 4th May. The new registration link is here I’m speaking at the Microsoft and GitHub DevOps Forum on the 10th of March. To register - https://mktoevents.com/Microsoft+Event/325749/157-GQE-382

March 3, 2022 · 1 min · Richard Fennell

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

How to fix Azure Pipeline YAML parsing errors seen after renaming the default Git branch

If in Azure DevOps you rename your Git Repo’s default branch, say from ‘master’ to ‘main’, you will probably see an error in the form ‘Encountered error(s) while parsing pipeline YAML: Could not get the latest source version for repository BlackMarble.NET.App hosted on Azure Repos using ref refs/heads/master.’ when you try to manually queue a pipeline run. You could well think, as I did, ‘all I need to do is update the YAML build files with a find and replace for master to main’, but this does not fix the problem....

November 3, 2021 · 1 min · Richard Fennell

New features for my Azure DevOps Release Notes Extension

Over the past couple of weeks, I have shipped three user-requested features for my Azure DevOps Release Notes Extension Generate multiple documents in a single run You can now specify multiple templates and output files. This allows a single instance of the task to generate multiple release note documents with different formats/content. This is useful when the generation of the dataset is slow, but you need a variety of document formats for different consumers....

October 30, 2021 · 2 min · Richard Fennell