A YAML build pipeline execution was cancelled in Azure DevOps. No logs are available for download. How do I find out why it was cancelled?
This execution was started automatically by Bitbucket to verify a pull request. I might figure out the reason of cancellation if I review Bitbucket's webhook logs (if Bitbucket has cancelled it), but is there a way to find it out from Azure DevOps?
Knowing what event or user have triggered cancellation is enough.
Any pipelines run started in Azure DevOps should be visible in https://dev.azure.com/YOURORGANIZATION/YOURTEAMPROJECT/_build?view=runs (replace YOURORGANIZATION and YOURTEAMPROJECT with your own). Another way is to check the Agent Pool (but then you'll need to know which Agent Pool was used);
Navigate to your organization: https://dev.azure.com/YOURORGANIZATION
Click Organization settings in the right bottom corner
Click Agent pools under Pipelines
Choose the Agent Pool
Then you see the jobs that reached an Agent
From either of the two options, you should be able to check the logs or warnings to find out what is wrong.
If it's not there, it never started, and you should check BitBucket.
Related
I created a classic CI azure pipeline for a .net application present in GitHub repo and enabled continuous integration in triggers and also added 2 branches in branch filters. But when my team members made some changes and make commits, my pipeline is not triggering and build is not created. I can't understand what might be the problem as I'm new to azure pipelines
Here is some troubleshooting advices, and you can click this document for more detailed information:
Are you using the GitHub app connection to connect the pipeline to GitHub? If you are using a GitHub app connection, follow these steps:
Is the mapping set up properly between GitHub and Azure DevOps? Open a
pull request in your GitHub repository, and make the comment /azp
where. This reports back the Azure DevOps organization that the
repository is mapped to.
If no organizations are set up to build this repository using the app,
go to
https://github.com/<org_name>/<repo_name>/settings/installations and
complete the configuration of the app.
If a different Azure DevOps organization is reported, then someone has
already established a pipeline for this repo in a different
organization. We currently have the limitation that we can only map a
GitHub repo to a single DevOps org. Only the pipelines in the first
Azure DevOps org can be automatically triggered. To change the
mapping, uninstall the app from the GitHub organization, and
re-install it. As you re-install it, make sure to select the correct
organization when you are redirected to Azure DevOps.
Are you using OAuth or PAT to connect the pipeline to GitHub? If you are using a GitHub connection, follow these steps:
OAuth and PAT connections rely on webhooks to communicate updates to
Azure Pipelines. In GitHub, navigate to the settings for your
repository, then to Webhooks. Verify that the webhooks exist. Usually
you should see three webhooks - push, pull_request, and issue_comment.
If you don't, then you must re-create the service connection and
update the pipeline to use the new service connection.
Select each of the webhooks in GitHub and verify that the payload that
corresponds to the user's commit exists and was sent successfully to
Azure DevOps. You may see an error here if the event could not be
communicated to Azure DevOps.
Is your pipeline paused or disabled? Open the editor for the pipeline, and then select Settings to check. If your pipeline is
paused or disabled, then triggers do not work.
Have you used variables in defining the trigger or the paths? That is not supported.
Have you excluded the branches or paths to which you pushed your changes? Test by pushing a change to an included path in an included
branch. Note that paths in triggers are case-sensitive. Make sure that
you use the same case as those of real folders when specifying the
paths in triggers.
Updates:
You don't need to change webhooks in github, what you need to do is that go to github Settings -> Webhooks, check whether there are "Recent Deliveries". If there are errors in recent deliveries, the cause of the question is indicated.
If Azure DevOps and GitHub are properly connected, GitHub will automatically generate Webhooks. As shown below:
The content of "Payload URL" is:
https://dev.azure.com/{organization}/_apis/public/hooks/externalEvents?publisherId=github&channelId={channelId}&api-version=6.1-preview
Please note that a GitHub repository can only connect to one Azure DevOps organization. If you have connected to more than one organizations, keep the only one you are using currently.
In DevOps click Pipelines on the left-hand side navigation
Select your pipeline.
Click Edit
Then in the new window pane (top left), you'll see a tab for triggers.
This is where you can configure the continuous integration settings to trigger builds on push / pull requests etc.
Here's an example
Continues integration is enabled for the development branch, thus any push to that branch will trigger a build.
I know that we can verify extend template used or not at deployment stage on targeted azure devops environment using extend template check.
I have a requirement to verify or run this check at run time before any of the build task starts i.e. when user run the build . I've asked similar question here Azure pipeline build Stage verification but as a centralized compliance team we want to block user from running the build if they are not extending certain template.
You can achieve above requirement by setting a template check for the agent pools. If a agent pool is configured approvals and checks, then all the jobs that targeting this agent pools will need to validate the approvals and checks before running.
You can follow below steps to set approvals and checks for agent pools.
Go to Project settings --> Agent pools under Pipelines-->Select the agent pools(eg. Azure Pipelines).
Click the 3dots on the top right corner--> Click Approvals and checks--> Click the plus sign to Add a template check.
Then all the jobs that targeting an agent in this agent pool will have to pass the template checks before running on the agent.
Note: Please make sure the Multi-stage pipelines experience is turned on. Check the document here here to turn on or off the Preview features.
Context
We have a C# project, hosted in Azure devops.
We have a pretty standard workflow :
build + unit tests,
manual QA,
then mark the built artifacts as "validated by QA".
These artifacts are then made available to our deployment team.
Since our product is deployed on our clients' premises, the actual deployment will not be triggered from the azure pipeline.
Situation
So far, we work with a build job, and we communicate with the deployment team by sending a notification : "build 345 is validated, use that one for deployment".
The problem is : they basically have access to the list of all builds, including the ones which were built correctly, but where QA found a bug for example.
What I would like to have
Give the deployment team access to a section where only validated builds are published.
This could be :
using a release pipeline : let the result of the release pipeline be to offer the artifacts for download
but I did't find an action which just states "publish the artifacts"
in the build pipeline, keep the builds in a "not yet completed" state, and wait for a manual action of the QA team to flag them as "success" or "failure".
I don't see a way to add a manual step to a "Build" job (and I think this would be a bad setup for a build job anyway)
Question
What would be the prefered way to represent this workflow in azure devops ?
Then you could have a release pipeline with only these tasks:
1. Manual intervention Sends an e-mail to the QA-team telling them to do their thing with build x.y.z. When the build is approved for release, someone from the QA-team signs into Azure Devops and lets the release resume.
2. Notification E-mail or whatever notification you're using goes out to the deployment team, informing them about the newly approved build.
I have installed Azure Pipelines Marketplace app on GitHub: https://github.com/marketplace/azure-pipelines
During the installation process, I selected the repository and ended up with the configuration flow to create a new .yml file.
BUT - I already have a rather advanced build definition set up in Azure DevOps (configured 2-3 years ago) and it won't let me export it to YAML.
So as a result, when a Pull Request is opended the Checks tab in GitHub shows the Azure Pipeline check, but just says it is queued and it never updates:
Status checks are still reported back to the PR, using the old way - the top one is build status, reported back automatically from Azure DevOps PR trigger:
You should remove completely Azure Pipelines application:
go to your GitHub installation settings : https://github.com/settings/installations or https://github.com/[organization]/[project]/settings/installations
open configuration for Azure Pipelines
Uninstall Azure Pipelines application
Then reinstall https://github.com/marketplace/azure-pipelines application.
I run build pipelines in Azure DevOps to daily update a Dockerfile and rebuild a container image with updated dependencies. The purpose is to have an up-to-date version of a dependency for the project and release a new artifact in container registry.
In Azure DevOps I have three chained build pipelines. The first pipeline is triggered every day with scheduled trigger. The next two pipelines are triggered with CI trigger file path filters. This all works well, most of the times.
My problem is that sometimes the schedule is not triggered at all. This happens after the pipelines have been running normally for days (ranging from about 1 to 15 days). The checkbox "Only schedule builds if the source or pipeline has changed" is unchecked, so having no commits should not be the problem.
Strange thing after this problem situation is that when I login to Azure DevOps portal the scheduled event is immediately triggered and I can see that the latest daily build starts running. I don't need to start it manually, it starts automatically like it would be scheduled but at the time I logged in.
This project is running with the free version of Azure DevOps. The project and pipelines have been created when Azure DevOps was VSTS and the same triggering problem was also in VSTS. Sometimes I run out of free quota and then I get an error that the agent cannot be started. This is not the case when the scheduled trigger is not running.
What could cause the problem in triggering by the schedule? Have any of you encountered this same problem? How could I debug or resolve this and get my builds running reliably? I cannot find any debug information about the trigger events, only logs from agent after the trigger has already happened. I have not yet recreated the pipelines to find out if "rebooting" helps in this case. That's my next step if no better answers will come up.
Update 07/11/2019:
We have since updated this logic to give 1 full month of scheduled builds to continue to run without any user activity.
Nightly builds require someone to sign in daily.
From the docs:
My build didn't run. What happened?
Your Azure DevOps organization goes dormant five minutes after the last user signed out. After that, each of your build pipelines will run one more time. For example, while your organization is dormant:
A nightly build of code in your Azure DevOps organization will run only one night until someone signs in again.
CI builds of an external Git repo will stop running until someone signs in again.
https://learn.microsoft.com/en-us/azure/devops/pipelines/build/triggers?view=vsts&tabs=yaml