Share via


Build your Universal Windows Platform app

Azure Pipelines | TFS 2018 | TFS 2017.2

Note

In Microsoft Team Foundation Server (TFS) 2018 and previous versions, build and release pipelines are called definitions, runs are called builds, service connections are called service endpoints, stages are called environments, and jobs are called phases.

Universal Windows Platform (UWP) is a common app platform available on every device that runs Windows 10. Azure Pipelines and Team Foundation Server (TFS) provide a highly customizable continuous integration (CI) pipeline to automatically build and package your UWP app whenever your team pushes or checks in code. In this quickstart, you learn how to define your CI pipeline.

Prerequisites

  • You need an Azure DevOps organization. If you don't have one, you can create one for free. If your team already has one, then make sure you're an administrator of the Azure DevOps project that you want to use. (An Azure DevOps organization is different from your GitHub organization. Give them the same name if you want alignment between them.)

  • While the simplest way to try this quickstart is to use an Azure DevOps organization, you can also use a TFS server instead of an Azure DevOps organization. Make sure that you have configured a build agent for your project, and that you have a version of Visual Studio matching your development machine installed on the agent machine.

Get sample app code

You can copy this sample app code directly into your version control system so that it can be accessed by your CI build pipeline. To get started, copy this URL to your clipboard:

https://github.com/microsoft/Windows-appsample-rssreader

To import the sample app into a Git repo in TFS:

  1. On the Code page for your project in TFS, select the option to Import repository.

  2. In the Import a Git repository dialog box, paste the above URL into the Clone URL text box.

  3. Click Import to copy the sample code into your Git repo.

Set up continuous integration

A continuous integration (CI) pipeline automatically builds and tests code every time a team member commits changes to version control. Here you'll create a CI pipeline that helps your team keep the main branch clean.

  1. Create a new build pipeline.

    Under the Build and Release menu, select Builds then New to create a new build definition.

    Create a new build definition for a repository

    Select a source and chose your team project, repository, and default branch then select Continue.

    Select a template or start with an Empty process to create your build pipeline.


  1. In the right panel, click Universal Windows Platform, and then click Apply.

    You now see all the tasks that were automatically added to the build pipeline by the template. These are the tasks that will automatically run every time you push code changes.

  2. For the Agent pool:

    • Azure Pipelines: Select Hosted VS2017. This is how you can use our pool of agents that have the software you need to build your app.

    • TFS: Select a pool that includes a Windows build agent.

  3. Click Get sources and then:

    Observe that the new build pipeline is automatically linked to your repository.


  1. Click the Triggers tab in the build pipeline. Enable the Continuous Integration trigger. This will ensure that the build pipeline is automatically triggered every time you commit a change to your repository.

  2. Click Save & queue to kick off your first build. On the Save build pipeline and queue dialog box, click Save & queue.

  3. A new build is started. You'll see a link to the new build on the top of the page. Click the link to watch the new build as it happens.

View the build summary

  1. Once the build completes, select the build number to view a summary of the build.

    Navigate to build summary

  2. Notice the various sections in the build summary - the source version of the commit in build details section, list of all associated changes, links to work items associated with commits, and test results. When the build is automatically triggered by a push to your Git repository, these sections are populated with all the relevant information.

Next steps

You can now update the build pipeline to generate production builds.