Host Multiple Websites within One Azure WebRole using Visual Studio 2015

One Code tarafından
Son güncelleştirme tarihi: 10.11.2016
Katkıda Bulunanlar:
GitHub üzerinde düzenleyin


An example of how to host multiple websites within one Azure webrole using Visual Studio 2015. This is a supplement and implement of Azure official video: Multiple Websites in a Web Role. Because that post is dated 2011, maybe updates for the past years allows for a more friendly and better approach. This post will give you the latest version of implementation.

Video guide,
Text guide,


1. Azure Account
You need an Azure account. You can open a free Azure account or Activate Visual Studio subscriber benefits.

2. Visual Studio 2015

The tutorial assumes you have worked with ASP.NET MVC and Visual Studio. If you need an introduction, see Getting Started with ASP.NET MVC 5.

4. Azure SDK
The tutorial is written for Visual Studio 2015 with the Azure SDK for .NET 2.9 or later. Download the latest Azure SDK for Visual Studio 2015. The SDK installs Visual Studio 2015 if you don't already have it.

Run the sample

  1. Please first download my test VS solution for your reference.
  2. After you downloaded, please unzip it and open the main “MultiWebsitesOneWebRole” solution as Administrator. Switch to ServiceDefinition.csdef file, replace the highlight parts as your actual path.
  3. Add below info into your host file.
  4. Ping to check if the dns name can be used.
  5. Run the solution, and visit three websites.


Below are some useful links, you will need them before your real action.

[Some notes that you might need to know when you start to deploy your websites]
How to setting up CNAMEs for your domain:

Tips for Publishing Multiple Sites in a Web Role:

How to configure the Azure Cloud Service Project to compile all the associated webs within a single web role: