🚀 Welcome to MDriven Learn –  MDriven is now on Discord!  Don’t miss the latest Release Notes.
Hosting turnkey on my own Azure account
This page was created by Hans.karlsen on 2020-07-17. Last edited by Wikiadmin on 2026-07-29.

You can host an MDriven Turnkey application in your own Microsoft Azure account when you want Azure to provide the web hosting while you retain control of the Azure resources.

What you will create

A Turnkey site consists of MDriven Designer, MDrivenServer, and MDriven Turnkey working together. In Azure, you can host these components either as two Azure Web Apps or in one Azure Web App.

Deployment layout Azure Web Apps Where the components run Use when
Separate applications Two One app runs MDrivenServer; the other runs MDriven Turnkey. You want the components deployed as separate Azure applications.
One application One Turnkey runs at the web root and MDrivenServer runs as the /__MDrivenServer virtual application. You want both components hosted in one Azure Web App.

For example, if your Azure app domain is https://example.azurewebsites.net, a one-app installation exposes MDrivenServer at https://example.azurewebsites.net/__MDrivenServer/ and serves Turnkey from https://example.azurewebsites.net/.

Before you start

You need:

  • An Azure account that can create a Web App and an App Service Plan.
  • Access to the Azure portal.
  • An MDriven account for MDriven Portal.
  • The current MDriven Turnkey and MDrivenServer application files from MDriven downloads.
  • A unique Azure Web App name. Azure app names must be globally unique, so prepare an alternative name if your first choice is unavailable.

If you do not want to administer Azure hosting, start with Documentation:Set up new Turnkey site instead.

Create the Azure Web App

  1. Sign in to the Azure portal.
  2. Create a new Web App.
  3. Enter a unique application name.
  4. Create or select an existing App Service Plan. The plan determines the Azure resources assigned to the app.
  5. Wait for Azure to finish creating the Web App.
  6. Open the Web App's Overview page and select Get publish profile. Keep the downloaded publish profile available; you use it when registering the site in MDriven Portal.

You may create two Web Apps at this stage if you are using the separate-applications layout. Create one app for MDrivenServer and one for Turnkey.

Choose and configure the hosting layout

Follow the complete installation procedure in HowTos:Install MDriven Server and Turnkey on Microsoft Azure. The essential file locations differ by layout.

Host Turnkey and MDrivenServer in separate Azure Web Apps

  1. Upload the MDriven Turnkey application files to site\wwwroot in the Turnkey Web App.
  2. Upload the MDrivenServer application files to site\wwwroot in the MDrivenServer Web App.
  3. Configure Turnkey to connect to the URL of the separate MDrivenServer app through its MDrivenServer override file.

Host Turnkey and MDrivenServer in one Azure Web App

  1. Upload the MDriven Turnkey application files to site\wwwroot.
  2. Upload the MDrivenServer application files to site\wwwroot\__MDrivenServer.
  3. In the Azure Web App, open Settings > Configuration > Path mappings.
  4. Create a virtual application with the following values:
Setting Value
Virtual path /__MDrivenServer
Physical path site\wwwroot\__MDrivenServer
Type Application
  1. Do not select the checklist options for that virtual application.
  2. Configure Turnkey to use the MDrivenServer URL at /__MDrivenServer/.

Configure the installed applications

Both MDrivenServer and Turnkey require an App_Data/CommandLineOverride.xml file. This is required for .NET Core applications running under IIS. Create the file in each application's own App_Data directory and use the configuration described in HowTos:Install MDriven Server and Turnkey on Microsoft Azure.

Turnkey also needs an App_Data/MDrivenServerOverride.xml file that specifies the MDrivenServer URL. In a one-app deployment, this URL uses the /__MDrivenServer/ virtual path. In a two-app deployment, use the URL of the MDrivenServer Web App.

You can place Turnkey-specific settings in App_Data/TurnkeySetttingsOverride.xml. After you have verified that Turnkey connects to MDrivenServer, set debug information to False.

Reset the initial MDrivenServer password

MDrivenServer initially uses the user name a. To set its password:

  1. Create App_Data/PwdReset.txt within the MDrivenServer application files.
  2. Put the new password in the file.
  3. Deploy the updated files to Azure.
  4. Sign in to MDrivenServer with user name a and the new password to verify the change.
  5. Delete PwdReset.txt after the password has been tested.

Do not leave the password-reset file deployed after you have completed the reset.

Enable WebSockets

Enable WebSockets for the Azure Web App. Turnkey and MDrivenServer require WebSockets to communicate correctly.

Register and deploy the site from MDriven Portal

Use MDriven Portal for the first deployment. This initial deployment sets a strong password and updates the installation's initialization files.

  1. Open MDriven Portal and sign in.
  2. Select Views > Show my Turnkey Sites.
  3. Select Register a New Site.
  4. Enter the application name.
  5. Upload the Azure publish profile that you downloaded from the Web App's Overview page.
  6. Select Create Turnkey Site and then Save.
  7. Return to Show my Turnkey Sites, select the registered site, and choose Manage Turnkey Site.
  8. Select Request Deploy and save the page.
  9. Wait for the deployment status to change to Deployed. Deployment normally takes no more than five minutes.
  10. Select Send Settings and Restart and save.

You can then open the Azure Web App URL and verify that the Turnkey application starts. The first request can take longer while the site starts.

Start modeling

Each Turnkey application must have an Index ViewModel. A ViewModel defines the data and user interface behavior presented by the application. For example, an empty application still needs an Index ViewModel so Turnkey has a starting view to open.

After deployment, open MDriven Portal and start MDriven Designer to model the application and upload the model to MDrivenServer using the credentials you configured.

Operate the site

After the initial Portal deployment, you can deploy updated Turnkey and MDrivenServer code by other Azure-supported methods, including the OneDrive approach described in Deploy Turnkey on your own Azure with OneDrive. Keep the required application structure and override files in place when you update deployed files.

Your Azure App Service Plan controls the resources allocated to the site. Review the plan and its costs in Azure as you add users, applications, or demo sites. For scale-out guidance, see Documentation:Scaling out Turnkey on Azure.

To protect an existing Turnkey web app with your organization's Azure Active Directory, see Documentation:Openid AzureAD.

Troubleshooting checklist

Symptom Check
Turnkey cannot communicate with MDrivenServer Verify that WebSockets are enabled and that MDrivenServerOverride.xml contains the correct MDrivenServer URL.
MDrivenServer does not open in a one-app deployment Verify the /__MDrivenServer virtual path, physical path, and that its type is Application.
The first deployment does not complete correctly Register the site with its Azure publish profile and perform the initial deployment through MDriven Portal.
The site opens but has no starting application view Ensure that the uploaded model contains an Index ViewModel.
You cannot sign in to MDrivenServer Reset the password with App_Data/PwdReset.txt, verify the new password, and then remove the file.

See also