Continuous deployment to the Windows Store

Last week Microsoft released an API to add submissions to your app in dev center. With that API they also released an VSTS extension that is using that API to get continuous deployment working from VSTS. Unfortunately the extension is somewhat limited and doesn't support flighted submissions (yet?). Maybe that still to come but in the meanwhile i build my own extension that supports also lighted submissions. Beside that flighting support it also has a nice task to automatic increase the version number. That is normally been done by Visual Studio but also missing.

You can get the extension from the gallery. In this blog post i will explain how you can setup an automated build solution with release management by using this extension.

Download and install the extension

First (and most important ;) ) get my extension from the gallery: https://marketplace.visualstudio.com/items?itemName=davesmits.windows-store-automation you can easily install it in your VSTS account via this link.

Configure the dev center account

It will only work if your dev center account is linked to Azure Active Directory. In AAD you then need to register an application that will have access. You will need the TenantID, ClientID and Client Secret. How to get this is very well explained here: https://github.com/Microsoft/windows-dev-center-vsts-extension#obtaining-your-credentials

When you acquired these tokens you go to the settings page of you team project and there to the services tab. Add new add point and click for dev center. You will get this popup

enter image description here

The connection name you can fill in something that identities the connections for you and fill in the tokens you acquired. API Token is the client secret.

Configure the Build

Create a new build definition and select the UWP template. Make the following changes: 1. Create new variable named BuildPlatformSep and as value assign it to x86 2. Add new build step; Update Appx Version Number. Set this step on top of the tasks

  • Configure the path to the manifest. you simply can use the file selector
  • Configure the build id. this have to a number that will be used in your version number of the package. I always use the BuildId variable. So you can fill in $(Build.BuildId)

enter image description here

  1. In the Build Solution make the following changes:
    • Change MSBuild arguments to: /p:UapAppxPackageBuildMode=StoreUpload /p:AppxBundlePlatforms="$(BuildPlatform)" /p:AppxPackageDir="$(Build.BinariesDirectory)\AppxPackages\" /p:AppxBundle=Always
      • In platform fill in the new variable you made: $(BuildPlatformSep)

enter image description here

Configure Release Management

Create a new release definition. Pick the output of the build. In this sample i will do it for a flighted submission and a non flighted submission.

In the newly created definition create two envoriments. One for the flighted submission and one for the non flighted one.

In both envoriments add the task "Publish to the Windows Store" and add the following configuration: 1. Selected the service endpoint you created earlier 2. Fill in your appid. You get find this in dev center. 3. For the fligthed envoriment fill in the name of the flight. for the non flighted version leave this field empty 4. in appxupload you can fill in /*/.appxupload 5. I recommended to leave wait for release unchecked. If you check it the task wont complete before the submission is been released. This potentially can take up to 5 days. For a hosted build server this is not a good idea.

enter image description here

You are now all set!

  •   @MicrosoftHelps fixed it by reinstalling windows but thanks for following up
  •   @JenMsft should have log feedback before resetting windows... but was soo annoyed my pen was not working
  •   @JenMsft surface book with perf base. i reinstalled windows and problem is gone. nasty thing if multi touch doesnt… https://t.co/0vxuKMC6vv
  •   @JenMsft after i installed the FCU multitouch doesnt work. when uninstall driver and reboot it works till next reboot. heared it before?
  •   RT @ruudj: https://t.co/WWSQcFP45k
  •   @maarten_goet @we_are_inspark Nice congrats
  •   nice app showing all windows controls https://t.co/kogun2ws2P
  •   RT @windowsblog: New Map Control features in Windows 10 Fall Creators Update https://t.co/gTLqVAX8HO https://t.co/wuGGF6Yi3Q
  •   RT @LocalJoost: Rather loud explosion sounds at @davesmits #techdaysnl presentation. Who ever was asleep is definitely awake again now 😀
  •   RT @we_are_inspark: 'A Shared HoloLens experience' door @davesmits op @TechDaysNL. Volg zijn sessie over 30 min. in zaal G104-105. https://…