2

I'm trying to figure out how to have more than one solution for a website, where each solution maps to a subdomain on my Azure site?

For example, I have a site called www.example.com, which a solution for that. I'd like to have another solution which deploys to www.sub1.example.com. And yet another for www.sub2.example.com.

I'd like to keep one site, to reduce the cost - is this achievable?

Edit: This question is along the same lines, however the answer isn't really specific and didn't seem to actually solve the question: How to use subdomain in Windows Azure?

Community
  • 1
  • 1
mariocatch
  • 8,305
  • 8
  • 50
  • 71
  • Yes. In your publish profiles just publish to the locations your web server is giving out as a subdomain. – mason Oct 03 '14 at 14:14
  • What do you mean by "the locations your webserver is giving out as a subdomain"? – mariocatch Oct 03 '14 at 14:16
  • You web server is going to have a directory for each subdomain being served out. Just publish to the correct directory. – mason Oct 03 '14 at 14:21
  • This is running in Azure, so if you have an Azure-specific solution to it that'd be more accurate. – mariocatch Oct 03 '14 at 14:28
  • possible duplicate of [Can you deploy multiple webapps on one Windows Azure instance?](http://stackoverflow.com/questions/3542518/can-you-deploy-multiple-webapps-on-one-windows-azure-instance) – mason Oct 03 '14 at 14:32

1 Answers1

3

If my thinking is right, you are wanting to host (potentially) completely separate (solutions/projects) websites through one hosting package with azure.

We have a system where we use the deployment slots. These are currently in preview with Azure, and easiest managed via the new portal (also in preview), not the main portal. Go to Azure, Click into your website instance, On the website instance dashboard, under the graph, there is a "quick glance" menu - The bottom item is deployment slots. (You may need to be on the standard compute mode for the Deployment Slots ability.)

Deployment slots are supposed to be used for staging/alternative versions of the main site, and can be assigned a custom sub-domain.

Within visual studio, projects can be uploaded to these environments using the standard azure publish method.

Hopefully this can be of some help...

Del
  • 416
  • 2
  • 13
  • So to make sure I understand, you're stating that if I upgrade my site to the Standard mode, I will be able to create "Deployment Slots" for various sub-domains of one actual Azure site instance? Then, I can have separate solutions, each bound to their own deployment instance, and when I publish one of the solutions, it will only affect the deployment instance/sub-domain it is publishing to? – mariocatch Oct 03 '14 at 15:03
  • 1
    I cannot see any reason why not. Something you will want to check is the performance/load allowances on deployment slots, as they are not intended to run production sites on I do not think. However, we have completely separate builds of a website on different deployment slots. (I think you are allowed 5) We use them for different testing environments. They are different code releases, connect to different databases, and use different sub-domains. On that basis, I dont see why you couldnt publish separate sites on each deployment slot. This may go against the terms of use though. – Del Oct 03 '14 at 15:08
  • So the more traditional approach is to purchase a website for each sub-domain then, I assume? – mariocatch Oct 03 '14 at 15:11
  • 1
    Er, I am not too sure actually. I would argue that a subdomain could be part of a larger website, (e.g. public/blog etc) so you should not have to pay for 2 hosting packages. I suppose it would really depend on what you want the subdomains to do, and how Azure would look at it. After all, you do not want them shutting your sites down if they think you are trying to save a few ££. I would need more information to advise properly. So in short, i'd ask Azure about your specific scenario... – Del Oct 03 '14 at 15:15