Deploying the Installable Cloud App

Navigate back one level up:

Cloud App Directory

Delete the salesdemo_cloud_API folder, we don't want to upload that one.

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>

Go back to the folder where the package is (one level up), open a Terminal window and run the following command:

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

The tool might 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.

You might also get the following error:

swa : File C:\Users\Appeon_Support\AppData\Roaming\npm\swa.ps1 cannot be loaded because running scripts is disabled on
this system. For more information, see about_Execution_Policies at https:/go.microsoft.com/fwlink/?LinkID=135170.
At line:1 char:1
+ swa deploy .\salesdemo --env Production -d xxxxxxxxxxxxxxxx ...
+ ~~~
    + CategoryInfo          : SecurityError: (:) [], PSSecurityException
    + FullyQualifiedErrorId : UnauthorizedAccess

This means you need to enable execution of scripts on the PowerShell. To do this you will need to open another PowerShell window with administrator privileges and type the following command:

Set-ExecutionPolicy -ExecutionPolicy RemoteSigned

This will allow the execution of scripts that are signed by a trusted entity (in this case, Microsoft).

Then run the swa deploy command 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’s page after 5 seconds.