Deploying Dynamicweb to Microsoft Azure

This document describes the process for deploying a Dynamicweb 9 solution to Azure. 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 Wrap. Older databases may require some massaging to work on Azure – the steps required are outside the scope of this guide. Please refer to Microsoft documentation.

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 3.1)
Figure 3.1 Add a resource group
  • Enter name and select a subscription and location (Figure 3.2)
Figure 3.2 Provide the relevant details

Then create an SQL Server and an empty database:

  • Click SQL Databases > Add (Figure 4.1)
Figure 4.1 Add an SQL database
  • Create an SQL server (Figure 4.2)
Figure 4.2 Create an SQL server
  • Create an empty database (Figure 4.3)
Figure 4.3 Configure the empty database

Next create an App Service to host your application:

  • Click App Services > Add (Figure 5.1)
Figure 5.1 Add an app service
  • Select WebApp and pick an appropriate pricing plan (Figure 5.2)
Figure 5.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 6.1)
Figure 6.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 6.2)
Figure 6.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 7.1)
Figure 7.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 7.2)
Figure 7.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 8.1)
Figure 8.1 Locate URL and click it to run the Dynamicweb Installer
  • This launches the Dynamicweb installer (Figure 8.2)
Figure 8.2 Installing DW9 on Azure
  • On step 2 select “Create a new /Files Folder” (Figure 8.3)
Figure 8.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 9.1)
Figure 9.1 Select 'Azure database'
  • Select an appropriate license in step 4 and create your Administrator user in step 5 (Figure 9.2)
  • You can now access the admin interface and start using Dynamicweb 9
Figure 9.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 10.1)
  • Run through the wizard using the server info from SQL databases in Azure portal. 
Figure 10.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 11.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 12.1)
Figure 12.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

Your Microsoft Azure needs to have a scheduler created and configured before it can run scheduled tasks from Dynamicweb.

To set up a scheduler for Dynamicweb scheduled task execution:

  • Log in to your Azure portal
  • Click New
  • Search for scheduler (Figure 14.1)
Figure 14.1 Search for 'scheduler'
  • Select the Microsoft scheduler from the result list and click Create (Figure 14.2)
Figure 14.2 Create a scheduler
  • Give your scheduler a name and select Configure for Action Settings
  • Fill in URL with your website address followed by /admin/Public/TaskExecute.aspx (Figure 14.3)
Figure 14.3 Fill in URL with your website address
  • Go to Configure Schedule (Figure 15.1)
  • Select Recurring and set a proper interval – we suggest 5 minutes
  • Set End to Never
  • Click Create

Your scheduler is now created and configured, and you can start the installation/deployment process .

Once you have deployed you should run the scheduler and verify that the Dynamicweb scheduled tasks on your deplpyed solution have also been run.

Figure 15.1 Configure the schedule