There are 3 ways to write Azure DevOps builds, as I can see it:
So far I am a fan of the last way because it allows me to debug most of my build logic locally. However, there are downsides:
It is possible to address the latter through dedicated VSTS logging commands, but this seems tedious.
I am not considering the first option serious, because the build is not treated as code.
YAML option is very intriguing, but how do I debug it locally? So, I can debug various pieces when they call my powershell scripts, but is there a way to debug it really? Like running locally, I do not hope to place breakpoints inside the YAML, but being able to break inside the scripts (without ReadHost) would be terrific.
Get logs to diagnose problems Start by looking at the logs in your completed build or release. You can view logs by navigating to the pipeline run summary and selecting the job and task. If a certain task is failing, check the logs for that task.
From Visual Studio, select Tools > Options > Debugging. Select Symbols from the list, and then select the + sign to add a new Azure DevOps symbol server location.
In earlier agent it supports locally testing YAML configuration without queuing a build against the server, but it's internal only and according to my test it's not available now. Please refer to YAML getting started - Run local (internal only, public preview soon) for details.
So, currently, we are unable to fully debug YAML locally. However Microsoft have added a new functionality to the Azure Pipelines extension for VSCode. Now, you will be able to create Azure Pipelines directly from VSCode without leaving the IDE.
Enter the Azure Pipelines extension for Visual Studio Code. Now, you can have syntax highlighting and IntelliSense that's aware of the Azure Pipelines YAML format. This means that you’ll be alerted in red “ink” if you write “tasks:” where you should have written “task:”. IntelliSense is also schema-aware. Wherever you are in the file, press Ctrl-Space (or Cmd-Space on macOS) to see what’s accepted at that point in the file.
You can reference below blogs to edit/debug the YAML file with VSCode:
In addition, there's also a suggestion ticket submitted about that : Ability to test YAML builds locally and the state is Under Review
. You could also go and vote it up to achieve that in future release.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With