Skip to main content

Azure hosting

PingCastle Pro runs in an Azure App Service. To host it in Azure, you create a web app and a database, deploy the PingCastle Pro files to the web app, and copy the application settings into the web app's Configuration page.

Create the App Service​

  1. In the Azure portal, create an App Service.

    Azure App Service creation interface

    You can use an Azure template to create the web app and the database together.

    Azure template selection for web app and database

    Azure template configuration details

  2. If you create the web app as a Docker container, set the application settings on the server in the next section. Azure doesn't copy the settings from appsettings.Production.json into the image. It shows them as environment variables instead.

Deploy the files​

  1. Install the Azure CLI.

  2. Run the following command to deploy the PingCastle Pro zip package to the web app:

    az webapp deploy --resource-group <group-name> --name <app-name> --src-path <zip-package-path>
  3. Run az webapp commands to view the web app you created. For deployment options, see Deploy files to App Service.

note

Your Azure configuration may require additional steps.

Set the application settings​

In the web app, select Configuration, then add the following settings. These replace the values you set in appsettings.Production.json for an on-premises installation. See Custom installation.

Azure App Service Configuration page showing the database and license application settings and the DefaultConnection connection string

WhereNameValue
Application settingsdatabasesqlserver or postgres
Application settingslicenseThe license key
Connection stringsDefaultConnectionThe database connection string. For Azure SQL, set Type to SQLAzure.

To send email notifications, add the email settings as application settings. Azure uses a double underscore (__) for each level of a nested setting:

NameValue
Email__EmailThe address PingCastle Pro sends email from
Email__HostThe SMTP server address
Email__PortThe SMTP server port
Email__LoginThe SMTP user name. Optional.
Email__PasswordThe SMTP password. Optional.

Select Save, then restart the web app.

Debug startup issues​

If the web app doesn't start, turn on App Service logs and read the log stream.

  1. In the web app, enable App Service Logs.

    Enabling App Service Logs in Azure

  2. Open the log stream.

    App Service log stream view

A common cause is a missing connection string. In the following example, the application couldn't find the connection string because Docker doesn't forward it. Add DefaultConnection in Configuration before the application can start.

Connection string error displayed in log stream