Azure devops yaml template bugs

Over the past couple of days I have been investigating using Templates for Azure Pipelines. So far, I am not impressed. After some googling, it seems like there's not that many helpful blogs on the topic, so I'm writing this one to let you know you are not alone!

UI bugs

  • If the template is invalid, the pipeline will fail to run, which is great, however the "Run" button is then disabled - even after you fix the template. This is really confusing. But all you need to do is refresh the page and the button is enabled again. (Handy UI hint - if you're going to disable a button, you need to re-enable it again at some stage)
  • The syntax highlighting for the "resources: repositories" says my syntax is wrong when referencing a template. Even though it works perfectly fine.
  • The Azure Devops UI changes the capitalisation of my step names. Even though I explicity set them in my yaml with "display name". (Handy UI hint - if I have the option to set it, don't override it for me)
  • If I edit the template from within the Azure Devops UI, and click the commit button, the comment message is not highlightable. It seems like it's automatically populated, however if I try to highlight it all to type over it, the highlight magically disappears and the focus is moved to somewhere else. This is really annoying.
  • When editing the YAML, if you highlight an open bracket and type an open curly brace, it doesn't replace it. Instead it adds a close curly bracket (??) and keeps the open bracket!! This is infuriating.
  • When editing the YAML, if you add a single quote before a variable name, it works fine. If you add a single quote at the end of a line it adds another one for you. If you then hit delete, it deletes both, even though your cursor is in the middle of the two quotes! It's just inconsistent and annoying, and you have to keep second-guessing everything that the editor is doing.
  • There is no link to any associated pipelines from the repository screen. Kind of annoying, especially now that they are linked.

Templating bugs:

  • $(packageid) is a reserved variable name - but no warning is given! If you attempt to set this variable yourself it will screw up your builds.
  • When you add the "Dotnet build" task - "WorkingDir" does not work! It works fine when using the UI and non-yaml builds.. but when using yaml, no deal. At least a warning should be given but it just continues on it's merry way, silently. This is really, really infuriating.
  • If using a template, the "repository" and "name" variables are the wrong way around. You specify the repository location in the name variable!
  • When using parameters in the YAML file, if you mis-type the parameters name (like ${{parameters.BuildOutputDirectoryz}}, no checking is done. It will just be blank.
  • The syntax documented for parameters does not work on Azure Devops 2019 server. This is known but not explained anywhere in the documentation.
  • No way of specifying mandatory parameters - I mean... seriously. You have to write some custom nightmarish bash code. I find this kind of ridiculous. Where's the "optional=false" or "mandatory=true" option? Haven't we moved beyond this?

Sigh.

Templates for Azure devops pipelines do actually work, and when they work, it's all good. But it's all a bit too new. The experience isn't great, and I spent many days on the above when I was only expecting to take a few hours. Oh well, give it another year.