0
votes

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

2
Hi there, is there any updates for this issue? Please check whether my answer below can help you and feel free to comment~ My suggestion is to try method two to see if GitHub's webhook has requests for it. If you have questions during your investigation, you can update your question to add more detailed information. I will do my best to help you.Jane Ma-MSFT
Thank you so much Jane Ma-MSFT! Even I think this issue is related to webhooks and service connection, so I changed my service connection allowing webhooks in github.Mansa
I am glad to be able to help you! You can accept it as an answer so that people with relative questions can benefit form it~Jane Ma-MSFT
Even I though I changed/added webhooks, my pipeline is not triggering automatically. I really can't understand what changes I have to make in order to run it automatically! Do I need to change anything in my GitHub repo settings??!Mansa
I have updated my answer and hope it can help you.Jane Ma-MSFT

2 Answers

1
votes

Here is some troubleshooting advices, and you can click this document for more detailed information:

  1. 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.

  1. 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.

  1. 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.

  2. Have you used variables in defining the trigger or the paths? That is not supported.

  3. 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.

enter image description here

If Azure DevOps and GitHub are properly connected, GitHub will automatically generate Webhooks. As shown below:

enter image description here

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.

0
votes

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 enter image description here

Continues integration is enabled for the development branch, thus any push to that branch will trigger a build.