Create a service hook for Azure DevOps with Jenkins
TFS 2017
If you use Jenkins to build your apps, you can store your code in Azure DevOps and continue to use Jenkins for your continuous integration builds. You can trigger a Jenkins build when you push code to your project's Git repository or when you check in code to Team Foundation version control.
Important
Azure DevOps no longer supports Alternate Credentials authentication since the beginning of March 2, 2020. If you're still using Alternate Credentials, we strongly encourage you to switch to a more secure authentication method (for example, personal access tokens). Learn more.
Configure Jenkins
If you haven't already, set up a Jenkins server.
If you're setting up Jenkins on-premises, enable HTTPS.
Set up a Jenkins build
In Jenkins, create a new item.
Create the type of build that's appropriate for your project.
Set the URL for your Git repository in Azure DevOps Services. The URL is in the form
https://dev.azure.com/{orgName}/DefaultCollection/_git/{projectName}
.
Trigger Jenkins
Go to your project Service Hooks page:
https://dev.azure.com/{orgName}/{project_name}/_apps/hub/ms.vss-servicehooks-web.manageServiceHooks-project
Select Create Subscription.
Add Jenkins.
Pick the event from Azure DevOps Services that you want to trigger a Jenkins build.
Configure the action to take in Jenkins.
Now, when that event occurs in Azure DevOps Services, your Jenkins build gets triggered.
Pricing
Azure DevOps Services doesn't charge for the framework for integrating with external services. Check out the specific service's site for pricing related to their services.
Q & A
Q: Can I build part of my app in Azure DevOps Services and part in Jenkins?
A: Yes. You can trigger a Jenkins build when your Azure DevOps Services build is completed so that you use both systems to build your app.
Q: Can I programmatically create subscriptions?
A: Yes, use REST APIs.