Install on Azure
Learn how to setup Squidex on Azure WebApp with MongoDB on Azure Container Instance.
The instructions provided help you to get your Squidex installation running on an Azure WebApp with the assets & MongoDB data hosted on Azure Storage and MongoDB running on an Azure Container Instance.
Please note, that Azure also supports Docker Compose files so you can follow the Docker tutorial, especially if it is important for you to be independent from your Cloud provider (avoid vendor lock-in).
This tutorial does not cover the basics of Azure. You should be familiar with them before you begin with the installation instructions. We have attempted to keep the instructions simple enough so they can be followed by anyone.
This tutorial demonstrates running MongoDB as a single container and is recommended for non-production or trial environments. For production environments, it is best to use one of the MongoDB Atlas (or Enterprise) offerings from Azure Marketplace with at least 3 members for High Availability etc.
Requirements
Before you start you have to setup a few things first:
An active Azure subscription
A Resource Group for all your Squidex resources.
An App Service plan (Linux) to host Squidex.
A Standard (General Purpose v2) Storage Account for assets and MongoDB.
An installation of the Azure-CLI on your developer machine (optional).
An installation of a MongoDB tool like MongoDB Compass on your developer machine (optional).
The Microsoft.ContainerInstance provider registered in your Azure subscription.
1. Setup your Storage Account
Execute the following steps in the storage account.
You must have a storage account before continuing. The steps do not cover the process of storage account creation.
Click Containers (1) under Data Storage and then click + Container (2) to load the New container blade.
Create a container named
etc-squidex-assets
(3). Do not make any other modifications, click Create (4).Similarly, select File shares (5), click + File share (6) and create a file share named
etc-squidex-mongodb
(7). Click Create (8).Next, note down the storage account Connection String and one of the Access Keys for use in the subsequent steps. To do so, go to Access Keys (9) and click Show (10) next to Key in key1. Copy this Access Key safely somewhere. Similarly click Show (11) next to Connection string and copy it.
2. Create the MongoDB Instance
To create the MongoDB Azure Container Instance we will use the Azure CLI. Using the browser based Azure Shell is the easiest and quickest way to run the command.
You can also execute them through an installation of Azure CLI on your developer machine. If you are using your own installation of Azure CLI, on the command prompt run az login
first to login to Azure (this step is not required if you are using Azure Shell).
The following creation of the container instance can only be done using the Azure CLI at the moment.
Run the following command to create the MongoDB container instance. You will need the following values noted down from earlier:
[YOUR_RESOURCE_GROUP]
[YOUR_STORAGE_ACCOUNT]
[YOUR_STORAGE_KEY]
This creates a single container instance running MongoDB.
2.1 Create an Admin User
At this point the MongoDB instance is running but requires authentication. But we do not have any users, so we will go ahead and create a user for use with the database.
Connect to your MongoDB container console from Azure:
Go to Container instances (1) and select your container, usually mongodb (2).
Click Containers (3) and then select the Connect tab (4).
Select /bin/bash and click Connect (5) button.
Execute the following steps inside the container to create a MongoDB user.
For security reasons provide your own choice of username and password
Now that the user is created, you can optionally connect to it from a tool like MongoDB Compass and verify connectivity. To connect, you will need the Public IP address of the MongoDB instance. To do so, go to Container instances (1), select your container (2) and from Overview (3) copy the Public IP address (4). Make a note of it as it will be needed again in future steps.
To connect to it from MongoDB Compass, create a connection string that contains the username and password similar to the example below.
mongodb://root:1q2w3e$R@[IP_ADDRESS]
3. Create & Configure the Web App
3.1 Create Web App
Start by creating a new Web App with the following settings. The wizard also lets you create a new App Service Plan (think Hosting Plan) if there isn't any.
Select the existing Resource Group (1) from previous steps
Enter a Web App Name for the FQDN provided by Azure Web App.
This Name should be globally unique.
Select Docker Container (3)
Choose Linux (4) for the Operating System
Set your preferred Region (5), preferably the same region as other resources
The default Sku and size selected is ideal for production environments and costs more. If this is a sandbox, trial or a non-production environment it is best to change this to a lower Sku. Click Change size (6) to do so and change it to F1 or B1.
Click Next: Docker to continue with the next steps.
In the Docker settings tab, configure as following:
Set Options as Single Container (8)
Set Image Source as Docker Hub (9)
Set Access Type to Public (10)
Enter Image and tag value as
squidex/squidex:latest
Click Review + create (12).
In the Review page, click Create.
Once deployment is complete, click Go to resource (14) and continue with the next section on configuring the environment variables.
3.2 Configure Web App
During this step, we will add the configuration values to the Web App and restart the Web App. Before proceeding ensure you have the following info handy, you will need it:
From the previous step you should already be in the Web App page. Click Configuration (1) and then Advanced edit (2).
Copy and paste the following JSON into the code window (DO NOT click OK.)
Replace all placeholders with your values (without additional quotes). It should look similar to the screenshot below. Click OK (3) when done. Configuration values for external authentication providers are empty to turn them off.
Click Save (4).
Click Overview (5) and then click Restart (6). Click Yes (7) when prompted.
You can now access Squidex at the App Service URL and continue with setting up Squidex.
IMPORTANT: It may take a few minutes before Squidex welcome page loads due to background configurations and setup processes by Azure.
If the restart in Step 5 above does not work, stop and start the Web App.
3.3 Turn on Logging
While this is an optional step, logging can make diagnostics easier.
You can then use the Log stream to view all log entries
Next from the left menu scroll down (or search) and click on App Service logs (1). Enable Application logging by clicking on File System (2) and click Save (3).
More issues?
For other issues, it is likely that you have a configuration problem not related to hosting under Azure. Checkout the following documentation:
Last updated