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. The issue is that the above command requires a specific --project parameter. ...

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

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. But I had gained an extra unexpected job that was being cancelled in 90+% of my runs. ...

October 29, 2021 · 2 min · Richard Fennell

Automating adding issues to Beta GitHub Projects using GitHub Actions

The new GitHub Issues Beta is a big step forward in project management over what was previously possible with the old ‘simple’ form of Issues. The Beta adds many great features such as: Project Boards/Lists Actionable Tasks Custom Fields including Iterations Automation However, one thing that is not available out the box is a means to automatically add newly created issues to a project. Looking at the automations available within a project you might initially think that there is a workflow to do this job, but no. ...

October 15, 2021 · 2 min · Richard Fennell

Making SonarQube Quality Checks a required PR check on Azure DevOps

This is another of those posts to remind me in the future. I searched the documentation for this answer for ages and found nothing, eventually getting the solution by asking on the SonarQube Forum When you link SonarQube into an Azure DevOps pipeline that is used from branch protection the success, or failure, of the PR branch analysis is shown as an optional PR Check The question was ‘how to do I make it a required check?’. Turns out the answer is to add an extra Azure DevOps branch policey status check for the ‘SonarQube/quality gate’ ...

September 21, 2021 · 1 min · Richard Fennell

My cancer story – thus far

This is a somewhat different post to my usual technical ones… In December 2017 I had major surgery. This was to remove an adrenal cortical carcinoma (ACC) that had grown on one of my adrenal glands and then up my inferior vena cava (IVC) into my heart. Early on I decided, though not hiding the fact I was ill, to not live every detail on social media. So, it is only now that I am back to a reasonable level of health and with some distance that I feel I can write about my experiences. I hope they might give people some hope that there can be a good outcome when there is a cancer diagnosis. ...

August 23, 2021 · 14 min · Richard Fennell

But what if I can't use GitHub Codespaces? Welcome to github.dev

Yesterday GitHub released Codespaces as a commercial offering. A new feature I have been using during its beta phase. Codespaces provides a means for developers to easily edit GitHub hosted repos in Visual Studio Code on a high-performance VM. No longer does the new developer on the team have to spend ages getting their local device setup ‘just right’. They can, in a couple of clicks, provision a Codespace that is preconfigured for the exact needs of the project i.e the correct VM performance, the right VS Code extensions and the debug environment configured. All billed on a pay as you go basis and accessible from any client. ...

August 12, 2021 · 2 min · Richard Fennell

How I dealt with a strange problem with PSRepositories and dotnet NuGet sources

Background We regularly re-build our Azure DevOps private agents using Packer and Lability, as I have posted about before. Since the latest re-build, we have seen all sorts of problems. All related to pulling packages and tools from NuGet based repositories. Problems we have never seen with any previous generation of our agents. The Issue The issue turned out to be related to registering a private PowerShell repository. $RegisterSplat = @{ Name = 'PrivateRepo' SourceLocation = 'https://psgallery.mydomain.co.uk/nuget/PowerShell' PublishLocation = 'https://psgallery.mydomain.co.uk/nuget/PowerShell' InstallationPolicy = 'Trusted' } Register-PSRepository @RegisterSplat Running this command caused the default dotnet NuGet repository to be unregistered i.e. the command dotnet nuget list source was expected to return ...

July 16, 2021 · 1 min · Richard Fennell

Porting my Visual Studio Parameters.xml Generator tool to Visual Studio 2022 Preview

As I am sure you are all aware the preview of Visual Studio 2022 has just dropped, so it is time for me to update my Parameter.xml Generator Tool to support this new version of Visual Studio. But what does my extension do? As the Marketplace description says… A tool to generate parameters.xml files for MSdeploy from the existing web.config file or from an app.config file for use with your own bespoke configuration transformation system. ...

June 22, 2021 · 3 min · Richard Fennell