Configure VSTS Build for UWP Apps

UWP Apps usually require a lot of time to compile a "release" package for submitting to Windows Store, and if you are working in a team, TFS/VSTS can help your team ensure that each check-in has a success build, and make it easier for deployment and testing. Let's see a basic example of how to setup a CI build for a UWP App on VSTS.

Important Pre-condition:

Before you do that, please ensure that your App is already build and running on your local machine.

If you want the package can be used to upload to the Windows Store, you need to manually associate the App to the store and create App packages and validate the release on your machine for the first time.

VSTS build on host agents can not automatically increase the build number in your App's manifest, you will need to do it manually in each check-in, or you can create a custom agent to do that (not discussed in this article)

Example App:

My example App "Thirukkural" is under project "Universal-Windows", you can follow my steps.

Step 1

Go to "Build and Release"

Screenshot (295)

Step 2

Click on +New Build

Screenshot (297)

Step 3

Set a Name, change Agent queue to "Hosted VS2017", and select the "sln" path for this particular App. This is very important, otherwise VSTS will build every "sln" under "Universal-Windows".

Step 4

In "Get sources", change Server path to this particular App source folder (Thirukkural), this is also very important, otherwise VSTS will get all content under "Universal-Windows" even it is only building "Thirukkural" solution.

Screenshot (301)

Step 5

Click "Save & queue" button, and test the build definition.

Screenshot (302)

Double check if the environment configuration is correct. In this case, I want the build artifacts can be used to upload to the Windows Store, so I need to use "release" mode on x86, x64 and ARM. You can change this in the build definition settings according to your demands.

Step 6

After the build is queued, click the build number on the message will open the build watcher window

Screenshot (303)

If everything is correct, you should see the build success after 10-20 minutes depending on your project size. I usually takes more time to build on VSTS comparing to your local machine.

Screenshot (304)

Step 7

Now, we have validated the build works. Let's configure the CI trigger.

Back to the build definition, click "Triggers", and enable "Continuous Integration" trigger. We also need to change the Path specification to this particular App folder, or every check-in under "Universal Windows" will trigger this build, which is not our intention.

Step 8

The build number by VSTS will not automatically increase like you do it with Visual Studio manually. If you want to upload to the store, the build number must be higher than the old one already in the store. Now we need to go back to Visual Studio, open your project's manifest file, and manually increase the build number.

Step 9

Now when you check-in the App source, a build will be triggered.

After it is done, go to "Artifacts", now you can download or browse the App packages.

Step 10

Upload your wonderful App to Windows Store and change the world!!! You can see the "appxupload" file is successfully recognized by Windows Dev Center.


Thank You!

© 2018 - Tamilan Subramani
Design and Developed by TAMILS1809
Version 1.0.0 CV:feb201827

Follow Me