Blog

Submitting a PWA to Microsoft Store using PWA Builder

By  
Mikael Sukoinen
Mikael Sukoinen
·
On May 21, 2020 2:15:00 PM
·

This tutorial shows how you build and submit your progressive web application (PWA) to the Microsoft Store. We use the PWA from our Modern Web App tutorial series and package it as an AppX package using the PWA builder by Microsoft. You can find more details about the PWA Builder in their GitHub repository.

You can also use the PWA Builder to turn your existing web app into a PWA.

PREREQUISITES

Microsoft accounts

There is a one-time sign-up fee for a Microsoft Developer account. See the pricing list for details.

A PWA

We’ll be using the PWA Builder to package a PWA for submission to the Microsoft Store. The PWA Builder can be used to transform existing websites into PWAs and also to package them for app store submission.

If you don’t have a PWA, we recommend getting started with Vaadin. Our comprehensive tutorial series, and technical documentation make it easy to build your first PWA!

Alternatively, follow one of our framework-independent basic tutorials to turn your existing web app into a PWA.

Reserve an app name

  1. Log into the Microsoft Dev Center dashboard.

  2. Go to Overview and select Create New App.

  3. Enter the name you want to use and check for its availability. Repeat this step until you find an available name.

  4. Select Reserve Product Name.

Run PWA builder

Build a Windows 10 application

You can skip this step if your PWA already runs as a Windows 10 application.
You can also build your Windows 10 application in Visual Studio.
  1. Go to https://www.pwabuilder.com/ and enter the URL of your PWA:

    PWA Builder dashboard
  2. Wait for PWA Builder to finish processing your application and then select Windows in the menu on the left:

    Windows option in PWA Builder
  3. Select Download to download a Windows 10 application:

    Download or generate AppX package
    You can test your app with the Microsoft App Certification Kit (Windows 10 required). You can find more details on the App Certification Kit download page.

Create an AppX package

Update your app manifest

  1. In the Dev Center Dashboard, go to App management > App Identity.

  2. Navigate to the generated appxmanifest.xml file at windows10/appxmanifest/appxmanifest.xml.

  3. Open appmanifest.xml and replace the following values with the ones assigned in the Dev Center:

    <Identity Name=" Package/Identity/Name
    <Identity Publisher=" Package/Identity/Publisher
    <DisplayName > Name you reserved for your app
    <PublisherDisplayName > Package/Properties/PublisherDisplayName`

    Example appmanifest.xml:

    Package xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10" xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest"xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10" xmlns:build="http://schemas.microsoft.com/developer/appx/2015/build" IgnorableNamespaces="uap mp build">
    <Identity Name="INSERT-YOUR-PACKAGE-IDENTITY-NAME-HERE" Publisher="CN=INSERT-YOUR-PACKAGE-IDENTITY-PUBLISHER-HERE" Version="1.0.0.0" ProcessorArchitecture="neutral"/>
    <mp:PhoneIdentity PhoneProductId="addf1fab-1ee6-18fd-f7fa-8390158a94a3" PhonePublisherId="00000000-0000-0000-0000-000000000000"/>
    <build:Metadata>
    <build:Item Name="GenerationTool" Version="pwabuilder-api"/>
    <build:Item Name="GenerationToolVersion" Version="2.0.1-rc.0"/>
    <build:Item Name="PlatformId" Value="windows10"/>
    <build:Item Name="PlatformPackage" Value="pwabuilder-windows10"/>
    <build:Item Name="PlatformVersion" Version="2.0.4-rc.6"/>
    <build:Item Name="GeneratedFrom" Value="Website Wizard"/>
    <build:Item Name="GenerationDate" Value="2020-09-14 13:18:39 Z"/>
    <build:Item Name="GeneratedURL" Value="https://crm.demo.vaadin.com/manifest.webmanifest"/>
    </build:Metadata>
    <Properties>
    <DisplayName>CRM</DisplayName>
    <PublisherDisplayName>
    INSERT-YOUR-PACKAGE-PROPERTIES-PUBLISHERDISPLAYNAME-HERE
    </PublisherDisplayName>
    <Logo>images\StoreLogo.png</Logo>
    </Properties>
    <Dependencies>
    <TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.10586.0" MaxVersionTested="10.0.16299.0"/>
    </Dependencies>
    <Resources>
    <Resource Language="en-us"/>
    </Resources>
    <Applications>
    <Application Id="CRM" StartPage="https://crm.demo.vaadin.com/">
    <uap:VisualElements DisplayName="CRM" Square150x150Logo="images\Square150x150Logo.png" Square44x44Logo="images\Square44x44Logo.png" Description="Vaadin CRM"BackgroundColor="#F2F2F2">
    <uap:InitialRotationPreference>
    <uap:Rotation Preference="portrait"/>
    </uap:InitialRotationPreference>
    </uap:VisualElements>
    <uap:ApplicationContentUriRules>
    <uap:Rule Type="include" WindowsRuntimeAccess="none" Match="http://*"/>
    <uap:Rule Type="include" WindowsRuntimeAccess="none" Match="https://*"/>
    <uap:Rule Type="include" WindowsRuntimeAccess="all" Match="https://crm.demo.vaadin.com/"/>
    </uap:ApplicationContentUriRules>
    </Application>
    </Applications>
    <Capabilities>
    <Capability Name="internetClient"/>
    </Capabilities>
    </Package>

 

Option 1: Use the PWA Builder website

You can use the PWA Builder online to create the AppX package if you’re running your Windows PWA locally or have it deployed on a server. See Option 2 below, if your Windows app is not deployed yet.

  1. Go to https://www.pwabuilder.com/ and enter the URL of your PWA:

    PWA Builder dashboard
  2. Wait for PWA Builder to finish processing your application and then select Windows in the menu on the left:

    Windows option in PWA Builder
  3. Select Generate to build an AppX PWA package:

    Download or generate AppX package
  4. Enter the details in your Microsoft Developer account and appmanifest.xml file and click Submit:

    Generate App package with PWA Builder

Option 2: Build from your terminal

  1. Install the PWA Builder CLI with the npm install -g pwabuilder command.

  2. Open a terminal window in the downloaded root folder and run the pwabuilder package -p windows10 -l debug command to build an AppX package:

    mikael@MacBook-Pro projects 2 % pwabuilder package -p windows10 -l debug
    [debug] pwabuilder : Available platforms within project: windows10
    [debug] pwabuilder : Packaging the following platforms: windows10
    [debug] pwabuilder : Loading platform module: pwabuilder-windows10
    mikael@MacBook-Pro projects 2 %

    Your .appx file will be located at PWA\Store packages\windows10\package\windows.appx.

Upload your AppX package

  1. Log into the Microsoft Dev Center dashboard.

  2. Go to Submissions > Submission 1.

  3. Upload your AppX package by dragging it into the Upload window or by selecting Browse for files.

You can find a full list of options, services and requirements on the Windows Dev Center documentation page.

>Optional: Prevent Bing from automatically submitting your PWA

Your PWA can be automatically submitted into the Microsoft Store if it meets certain set criteria. You can opt out of this feature by creating a robot.txt file into your PWA’s root folder with the following content:

User-agent: bingbot
Disallow: /manifest.json

Next Steps

Congratulations on submitting your application! If you are looking for more information on PWAs, check out our PWA Handbook. If you are new to progressive web app development, I’d recommend our comprehensive tutorial series that takes you through every step from start to deployment of a complete PWA with Vaadin.

Mikael Sukoinen
Mikael Sukoinen
Mikael has a passion for writing text, code and music. He’s currently utilising his skills to explain difficult concepts in plain language at Vaadin Ltd.
Other posts by Mikael Sukoinen