Git Product home page Git Product logo

cloud-services-dotnet-multiple-websites-in-one-webrole's Introduction

services platforms author
cloud-services
dotnet
msonecode

Host multiple websites within one Azure webrole using Visual Studio 2015

##Introduction This example shows how to host multiple websites within one Azure webrole using Visual Studio 2015. This is a supplement and implement for Azure official video: Multiple Websites in a Web Role. Since that post is dated to 2011, updates for the past years could bring about a better approach. This post will give you the latest version of implementation.

Video guide,
https://channel9.msdn.com/Shows/Cloud+Cover/Cloud-Cover-Episode-37-Multiple-Websites-in-a-Web-Role
Text guide,
http://www.wadewegner.com/2011/02/running-multiple-websites-in-a-windows-azure-web-role/

Prerequisites

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
https://www.visualstudio.com/downloads/

3. ASP.NET MVC 5
The tutorial assumes that 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 have it.

Run the sample

  1. Please first download my test VS solution MultipleWebSite.zip for your reference.
  2. After downloading, please unzip it and open the main “MultiWebsitesOneWebRole” solution as Administrator. Switch to ServiceDefinition.csdef file, replace the physicalDirectory in Site section according to your configuration.

3. Add below info to your host file
``` 127.0.0.1 www.firstsite.com 127.0.0.1 www.secondsite.com 127.0.0.1 www.thirdsite.com ```

4. Open command console and ping to check if the dns name can be used.
`Ping www.firstsite.com`

5. Run the solution, and visit three websites in your web browser.

##Reference
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:
http://blog.smarx.com/posts/custom-domain-names-in-windows-azure

Tips for Publishing Multiple Sites in a Web Role:
https://michaelcollier.wordpress.com/2013/01/14/multiple-sites-in-a-web-role/
https://kellyhpdx.wordpress.com/2012/04/11/deploying-multiple-web-applications-to-a-single-azure-instance-and-applying-web-config-transforms-correctly/
https://www.intertech.com/Blog/windows-azure-multiple-web-sites/
https://blog.bareweb.eu/2011/01/11/azure-running-multiple-web-sites-in-a-single-webrole/
http://www.structuretoobig.com/post/2012/01/17/One-Azure-Web-Role-Multiple-Websites.aspx
http://weblogs.asp.net/gunnarpeipman/deploying-independent-web-applications-to-windows-azure-using-single-web-role
http://stackoverflow.com/questions/21796881/multiple-sites-within-one-azure-webrole

How to configure the Azure Cloud Service Project to compile all the associated webs within a single web role:
http://stackoverflow.com/questions/15536819/azure-web-role-multiple-websites-dont-compile-when-debugger-is-run-in-visual

cloud-services-dotnet-multiple-websites-in-one-webrole's People

Contributors

aliceqin12 avatar dalechen avatar vaanpan avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.