With Static Web App

Creating the Static Web App

Go to Azure and create a new Static Web App using the following settings:

  • Plan Type: Standard (The Cloud App Launcher is too large for the hosting allowed by the Free Plan)

  • Source: Other

Once you log in, select the repository and the branch where you pushed the files and click Review + Create.

Reviewing Static Web Site creation settings

When the deployment completes, go to the Overview page and copy the Deployment token by clicking on the Manage deployment token button.

Installing SWA CLI

Static Web Apps CLI is an all-in-One Local Development Tool For Azure Static Web Apps.

Open a Windows Terminal and run the following command to install the SWA CLI tool globally:

npm install -g @azure/static-web-apps-cli

Please note that you must have Node.js installed on your computer for this command to work. If you don’t currently have it, you can get it here.

Deploying the Cloud App

Go to the location where you generated the Cloud App ZIP and extract the contents of the zip into that location.

Cloud App ZIP Extracted

Create an HTML file inside the salesdemo_cloud_Installer folder and write the following contents:

<html>
   <head>
      <meta http-equiv="refresh" content="5; URL=salesdemo_cloud/" />
    </head>
    <body>
      <p>If you are not redirected in five seconds, <a href="salesdemo_cloud/">click here</a>.</p>
    </body>
</html>

This will, after 5 seconds, redirect the browser to the app's URL if the root URL is accessed.

If you want the redirection to be instantaneous you can use embedded Javascript code:

Please note that this will only work if the client's browser supports Javascript.

<html>
    <head>
        <script>window.location.replace('salesdemo_cloud/')</script>
    </head>
    <body>
      <p>If you are not redirected in five seconds, <a href="salesdemo_cloud/">click here</a>.</p>
    </body>
</html>

In the folder where the ZIP file is, open a Terminal window and run the following command:

swa deploy .\salesdemo_cloud_Installer --env Production -d <deployment token>

The tool will open a web page for you to log in to Azure.

Once you log in it will begin the deployment process.

Note: If you get a Failed to upload build artifacts. error, try again.

Go to the Static Web App’s Overview page and follow the container’s public URL:

Finding the Static Web App’s public-facing URL

You should be redirected to the Cloud App Installer’s page after 5 seconds.