Troubleshoot YAML Build First Run
We take a step-by-step look at how to fix a common error developers face when working with YAML builds.
Join the DZone community and get the full member experience.Join For Free
scenario : you create a branch in your git repository to start with a new shiny yaml build definition for azure devops, you create a yaml file, push the branch to azure devops, and create a new build based on that yaml definition. everything seems okay, but when you press the run button you got and error
could not find a pool with name default. the pool does not exist or has not been authorized for use. for authorization details, refer to https://aka.ms/yamlauthz .
figure 1: error running your new shiny pipeline
okay, this is frustrating and following the link gives you little clue on what really happened. the problem is that, with the new editor experience, when you navigate to the pipeline page, all you see is the editor of yaml build and nothing more.
figure 2: new editor page of yaml pipeline, advanced editor and nothing more.
the new editor is fantastic , but it somewhat hides the standard configuration parameters page, where the default branch can be set. as you can see from figure 2, you can specify the pool name (default) and trigger it directly in the yaml build, so you'd think that this is everything you'd need, but there is more. clicking on the three buttons in the right upper corner you can click on the trigger menu to open the old editor.
figure 3: clicking on the triggers menu item will bring on the old ui.
this is where the yaml pipeline experience still needs some love. you are surely puzzled why you need to click the triggers menu item if you already specified triggers directly in the yaml definition, but the reason is simple — it will open the old pipeline editor page.
the new editor page with the yaml editor is fantastic, but you should not forget that there are still some parameters, like a default branch, that are editable from the old interface.
the trigger page is not really useful, it only gives you the ability to override the yaml configuration, but the important aspect is that we can now access the first tab of the yaml configuration to change the default branch.
figure 4: the trigger page is not useful, but now we can access the default configuration for the pipeline.
figure 5: default configuration tab where you can edit default branch
in figure 5, we can now understand what went wrong. the wizard created my pipeline using master as the default branch, but clearly my buid yaml file does not exists in master, but exists only in my feature branch. just change the default build to the branch that contains your build definition file, save and queue again; now everything should work again.
this trick also works when you got errors about not being authorized to use endpoints, like sonar endpoint, nuget endpoint, etc.
happy yaml building experience!
Published at DZone with permission of Ricci Gian Maria, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.