Jenkins with Azure DevOps Services

If you use Jenkins to build your apps, you can store your code in Azure DevOps Services 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 code in to Team Foundation version control.

Configure Jenkins

  1. If you haven't already, set up a Jenkins server.

  2. If you're setting up Jenkins on-premises, enable HTTPS.

Set up a Jenkins build

  1. In Jenkins, create a new item.

    New item link in Jenkins

  2. Create the type of build that's appropriate for your project.

    Build name and type in Jenkins

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

    Source code management settings with Git selected

Trigger Jenkins from Azure DevOps Services

  1. If you haven't already, enable alternate credentials in your Azure DevOps Services profile. Be sure to set a secondary user name because you won't be able to use your email account to connect Azure DevOps Services to Jenkins.

    Profile, credentials tab, alternative credentials enabled with a secondary user name

  2. Go to your Azure DevOps Services project service hooks page: https://dev.azure.com/{orgName}/{projectName}/_apps/hub/ms.vss-servicehooks-web.manageServiceHooks-project

    Project administration page

    Click Create Subscription.

  3. Add Jenkins.

    Select target service dialog box, Jenkins selected

  4. Pick the event from Azure DevOps Services that you want to trigger a Jenkins build.

    Configure event dialog box

  5. Configure the action to take in Jenkins.

    New service hook subscription dialog box

Now, when that event occurs in Azure DevOps Services, your Jenkins build will be 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.