Deploying Dynamicweb to Microsoft Azure

This document describes the process for deploying a Dynamicweb 9 solution to Azure App Service (Azure Web Apps). We will look at two scenarios:

  • Deploying a new Dynamicweb 9 solution
  • Moving an existing Dynamicweb 9 solution

To follow this how-to you must have:

  • An existing Microsoft Azure subscription
  • A working DW9 website

Databases created by the Dynamicweb 9 installer work on Azure out of the box. The same is true for the Dynamicweb 9 version of Rapido. Older databases created before Dynamicweb 8.3 may require some massaging to work on Azure – the steps required are outside the scope of this guide. Please refer to Microsoft documentation.

Azure alternatives

This page describes how to install Dynamicweb on Azure App Services and Azure SQL. It is also possible to use Azure VM which is a virtual Windows server. These 2 options are very different. If you need to install Dynamicweb on an Azure VM, refer to the normal installation guide of Dynamicweb.

It is also possible to host Dynamicweb on other cloud services like Amazon AWS and Google Cloud. In both scenarios, choose a VM instance of a Windows machine as described under requirements and follow installation steps in the normal installation guide.

This section covers settings and configuration that needs to be taken into consideration when installing on Azure App Services

Recommended instances and configuration options of Azure Web App and Azure SQL

Support

  • For now we are not experts in Azure, but will do our outmost to support you. We support Dynamicweb, but not the hosting environment - but we will take on any improvements to Dynamicweb that is required to support Azure.
  • Dynamicweb staff do not have access to solutions you host in Azure and we do not have the same tools available for debugging, performance optimisations and investigations as in our Cloud. If the need arises to conduct any of these things, it is up to you to take care of that. You should be prepared to provide copies of the website if we need to debug on the solution.
  • Dynamicweb hosted in Azure is considered an external hosted website as defined in the license terms

Azure vs. Cloud

Below compare some differences between Dynamicweb Cloud and the Azure Cloud

 

Azure

Dynamicweb Cloud

Debugging

Partner

Copy solution to Dynamicweb

Dynamicweb Support + Development

We have full access to environment

Dynamicweb Monitoring

N/A

Included

Backup & Restore

Partner

Dynamicweb Support

Upgrades

Partner

Included

SMTP

External service

Included

Email marketing

External service

Drop folder

HTTP2 and PushPromise

NA

Included

There are two scenarios when deploying to Azure:

  • Deploying a new Dynamicweb 9 solution
  • Moving an existing Dynamicweb 9 solution

Both are described below.

Start by creating a resource group:

  • Click Resource Groups > Add (Figure 4.1)
Figure 4.1 Add a resource group
  • Enter a name and select a subscription and location (Figure 4.2)
Figure 4.2 Provide the relevant details

Then create an SQL Server and an empty database:

  • Click SQL Databases > Add (Figure 5.1)
Figure 5.1 Add an SQL database
  • Create an SQL server (Figure 5.2)
Figure 5.2 Create an SQL server
  • Create an empty database (Figure 5.3)
Figure 5.3 Configure the empty database

Next create an App Service to host your application:

  • Click App Services > Add (Figure 6.1)
Figure 6.1 Add an app service
  • Select WebApp and pick an appropriate pricing plan (Figure 6.2)
Figure 6.2 Select WebApp and select a pricing plan

You can now upload your Dynamicweb application:

  • Go to App Services and open your App Service
  • Under overview locate the FTP hostname and username (Figure 7.1)
Figure 7.1 Locate the FTP hostname and username
  • Using whatever ftp client you like connect to your app service storage and upload your DW9 application folder (Figure 7.2)
Figure 7.2 Connect via FTP and upload the application folder

Next you must configure the Dynamicweb application:

  • Go to app services and select your app.
  • Under Application settings set .NET Framework version to 4.6 and Platform to 64 bit (Figure 8.1)
Figure 8.1 Set .NET framework to 4.6 and platform to 64 bit
  • Under Virtual applications and directories edit the root path to point to your application folder (Figure 8.2)
Figure 8.2 Point root path to your application folder

You can now run the Dynamicweb installer:

  • Locate your app in App services and go to Overview
  • Find the URL for your application and access it (Figure 9.1)
Figure 9.1 Locate URL and click it to run the Dynamicweb Installer
  • This launches the Dynamicweb installer (Figure 9.2)
Figure 9.2 Installing DW9 on Azure
  • On step 2 select “Create a new /Files Folder” (Figure 9.3)
Figure 9.3 Select 'Create a new /Files folder'
  • On step 3 select “Azure database” and fill in the connection settings (if you have forgotten you can find them in the Azure portal under SQl databases) (Figure 10.1)
Figure 10.1 Select 'Azure database'
  • Select an appropriate license in step 4 and create your Administrator user in step 5 (Figure 10.2)
  • You can now access the admin interface and start using Dynamicweb 9
Figure 10.2 You're done! Hurrah!

To deploy an existing solution to Azure, create a Resource group, SQL server, App service and App as described above.

You must then migrate your existing database to Azure:

  • Open SQL-Server Management Studio and locate your database. Right click the database, choose tasks, deploy database to SQL Azure (Figure 11.1)
  • Run through the wizard using the server info from SQL databases in Azure portal. 
Figure 11.1 Deploy the database to Azure

If migration fails examine the log and fix whatever issues exist with your database and try again

Next, you must upload the Files folder of your existing solution:

  • Connect to your app service storage via ftp.
  • Navigate to your Application folder and upload Files folder to here
Figure 12.1 Upload the FIles folder to your application folder

You can place the Files folder elsewhere if you want, but in that case you will need to create a virtual folder reference in the Azure App settings interface.

The database just deployed to SQL Azure, needs to be connected to Dynamicweb

  • Connect to the ftp
  • Browse to /site/wwwroot/Files and open GlobalSettings.aspx in an editor
  • Update the database section in GlobalSettings.aspx according to connection properties found on the Azure portal (Figure 13.1)
Figure 13.1 Edit the GlobalSettings file and use the connection properties from Azure

  • When new versions of Dynamicweb are released, copy the new application folder to /site/wwwroot/ and overwrite the files already there.
  • Make sure new settings from the web.config in the Dynamicweb application are copied as well
  • It is recommended to delete everything from /site/wwwroot/bin/ before updating.
    • Do not remove custom dlls

To run tasks from Dynamicweb, Azure must have some sort of scheduler set up. Previously, we recommended using Azure scheduler to accomplish this - but this tool is being phased out.

Azure recommends using Azure Logic Apps to send HTTP requests to taskexecute.exe:

  • Create a blank logic app (Figure 15.1)
Figure 15.1 Create a blank logic app
  • Add an HTTP trigger (Figure 15.2)
Figure 15.2 Add an HTTP trigger
  • Configure the trigger (Figure 15.3):
    • Method: Post
    • Url: yoururl.com/Admin/public/taskexecute.aspx
    • Interval: 5
    • Frequency: Minute
Figure 15.3 Configuring the trigger