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!

  •   @sandeepchads i needed this last week!
  •   @hrist0ph sorry very busy with work at the moment; but working on a rewrite based on the new sdk but not going as fast as i want
  •   @surface thanks but says i am up to date and want all the goodness of 19H1 on my Surface Go
  •   how often i have to press check for updates to force the may update on my surface go 🐱‍👓? #windowsinsiders
  •   @JenMsft Already available to surface go?
  •   RT @windowsblog: Announcing UI Tests in CI/CD for Desktop App Developers https://t.co/3DK2wzAGlX
  •   RT @mrlacey: I get excited about the simplest (obscure?) things sometimes. Yay, XmlnsDefinitionAttribute is coming to .NET Core 3.0, which…
  •   Why does @slack starts faster on my lightweight mobile device then on my heavy powered Core i7 Laptop?
  •   RT @alexmullans: Azure Artifacts is now priced per GB stored 🥳. No more buying and assigning licenses. Start at https://t.co/JAn6daobLV. F…
  •   @LocalJoost i am the creator :) #sorry