azure wcf and mvc under same subdomain - asp.net-mvc

i have my project up and running via Azure with two WebRoles. a MVC project and a WCF. I would like to know if it's possible to have both web applications under same subdomain. is that possible? or will i end up with having 2 subdomains (one subdomain for mvc and one subdomain for wcf)?

Idealy you put each of the projects under different cloud services. Two cloud service, two projects (mvc and wcf). They have two different *.cloudapp.net addresses.

Related

Is it possible to integrate two .NET Applications (1 WebForm and 1 MVC) into one domain

I originally programmed two separate. NET applications (1 WebForm and 1 MVC 5) that originally were going to be on separate domains. I'm now trying to integrate both applications on a single portal on a single domain that will likely be a MVC Web Application. Ideally I would like to use subdomains to keep them separate.
I've figured that there's 2 options to make this happen but even then I don't know if #1 is even feasible.
1) Host each application on separate subdomains (ex: WebForm.domain.com and MVC.domain.com) while having the main portal on the default domain (domain.com).
2) Rewrite the WebForm application into a MVC application and just merge the two projects.
I'm open to any and all suggestions

What's the correct way to deploy a Web API and MVC project to Azure?

I have both an ASP.net Web API and MVC project that I am trying to deploy to an Azure Web App. I can deploy either one by themselves, but the one will overwrite the other. I do have the web deploy dialog set to target the same URL when I deploy each one. Obviously I am doing it wrong. How can I deploy both projects to the same Azure web app? Or do I need to create two different web apps in the same resource group? Thanks for your help!
If I am not mistaken, you are trying to deploy essentially 2 projects to the same Azure Wesbite?
1x MVC Website
1x WebAPI
It is indeed possible to deploy an MVC Website and a WebAPI to a single Azure Wesbite, but there's a little bit of work to do around this, using Virtual Directories in the Azure Websites configuration.
This MSDN Blog post outlines all the steps you need to do to make this work. I have used it many times for this exact scenario.
There is no 'correct way'. There are many ways of deploying an asp.net web api and mvc to Azure. One way of doing it is working with staging environments. You basically deploy to a separate deployment slot and if all is oke, swat it with the production slot.
msdn: web-sites-staged-publishing

Do I need separate domain for MVC Web API?

I am facing one problem.
I have 1 Presentation Layer Project using ASP.NET MVC. There is another project for Database interaction for MVC Web API.
Question: Do I need two domains ? One for ASP.NET MVC Project and another for MVC Web API project ?
Two domains? No. However, given that you have two projects you will need two separate deployment locations. That means they'll either need to live at different subdomains (i.e. www.domain.com and api.domain.com) or under different virtual directories of the same domain/subdomain (i.e. domain.com/web and domain.com/api. You could put one of them in the root of the domain (i.e. domain.com for the MVC site and then domain.com/api for the Web Api, but you need to be careful at the point, as the Web.config for your MVC site will apply to any virtual directories under it, i.e. your Web Api.

Two azure websites (webapps) on same domain

I have a webapp running as an Azure website on http://www.example.com
I have controllers for www.example.com/signup and www.example.com/signin - all other stuff is put on subdomains, like username.example.com.
My question: is it possible to have another (azure) website running on http://www.example.com? E.g. with all the marketing pages etc.
Ideally I would like to give access to that second website to an external webdeveloper so that I don't have to worry that the webdeveloper have access to my main app.
Additional question: would that second website have to be asp.net? Could it be PHP? (e.g. a Wordpress site)
You can develop child projects within Azure Websites check here : A single web project hosting both the web pages and API
One web project for the web pages, and another for the API, deployed to different websites on different servers
One web project for the web pages, and another for the API that is deployed to the same servers as an IIS application (/Services). http://blogs.msdn.com/b/tomholl/archive/2014/09/22/deploying-multiple-virtual-directories-to-a-single-azure-website.aspx, not sure if it can use another platform.

Hosting WCF Services in ASP.NET MVC Web Application

I have an ASP.NET MVC 1.0 webapp, which serves as a front-end site for our external API. More specifically, it has a Control Panel for our API clients, documentation, etc.
Now I want to move our actual API (which is a set of WCF services) inside this project, so that, for example, http://api.example.com/controlpanel/dashboard would be served by ASP.NET MVC runtime, wherease http://api.example.com/services/1.0/users.svc would be served by an appropriate WCF service.
Granted, this can be done by adding a services/1.0 virtual folder in IIS, but I really want these two parts to be inside one project.
Is this doable at all? If yes, how do I integrate these two beasts?
Turns out MVC/WCF isn't the issue. Services hosted within the MVC app are activated just fine (I guess IIS bypasses the MVC runtime for .svc requests).
The issue was more to do with services in Areas, and requests for .svc files not going through the route table.
I've asked a more specific question addressing the actual problem here.
Expose WCF services that belong to an Area in MVC app at a routed path

Resources