Windows Azure & ASP.NET MVC site deployed on it? - asp.net-mvc

is it possible to deploy asp.net MVC site on windows AZURE platform? I understand we can deploy a WCF service, but what about full site? Will it work? Will it scale (i.e. load balance)?
We're having a project to develop - a donation site, which will be advertised a lot and will receive a lot of traffic. I do want to try AZURE, but is it possible for AZURE to run the full asp.net mvc site?

Yes - you just need to make sure that MVC dlls are copied to bin folder and MVC project is added as a web role.
Here's a tutorial.
Also take a look here:
MVCCloudService
PS. Remember about Azure prices.

As others mentioned, MVC2 sites are totally OK for Azure. Your second question: will it scale (auto-balance) needs more explanation:
If you have more then one compute instance (VM) allocated to your application, MVC2 site will auto-balance provided you haven't made any mistakes with keeping session-information inside the URLs.
However, if you want to automatically adjust the number of compute instances per load on the site, you will either have to write the scaling logic yourself (check this site to get started http://convective.wordpress.com/2010/10/12/autoscaling-in-windows-azure/ ) or use a third-party scaling engine like # http://www.paraleap.com/
HTH

Related

Umbraco Site Deployment

I've an umbraco site which is currently on my localhost IIS..
I've see several hosting and it's have different price plan between umbraco hosting and the asp mvc site hosting..
To make my site live, are I need to choose the umbraco hosting plan, because my logic thing on local my umbraco site work normally in IIS without additional IIS plugin or setup.. So I can just choose the general asp mvc site hosting
I'm new to umbraco and this is my first time deploy an umbraco site..
Any idea guys? Thanks
Umbraco will run on any standard IIS based hosting that supports .Net and SQL Server. If you're using a SQL CE database rather than full SQL Server (or MySQL), you'll need to make sure that your host supports that too.
Also, ensure your hosting provider supports Medium trust and generally not Shared Server, although I have heard users getting this going.
If its within your budget buying a VM Server and handling the hosting provides total control over the environment.
Have you looked at Umbraco Cloud?

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

Web Services in ASP.NET MVC 4 Application

I've a web site developed using MVC 4 ASP.net application. I'm new to .net platform & I want to add web service which would return me operating system name of users device based on certain input.
Assuming I've logic to capture OS information using inputted data, how do I go forward in building this web service?
Do I need to have a complete separate solution file which will have a web service or in existing MVC 4 asp.net application itself, should I create a new project which would be of type "WCF Service Application"? Again I don't know much about WCF service either, if I use it, how would the URL be accessible, etc?
Can anyone give me some insights?
Note: I've also a separate REST web service which is a completely separate solution with separate projects but deployed on same IIS.
Thanks in Advance!
You don't need to create a WebAPI project just for what you described (i'm assuming one or a few end points).
Simply use MVC controllers that return JSON for example, this way you deal with a single framework.
Reasons to move to Web API is if you need support for CORS, need content negotiation for results etc. From what you are describing it's completely fine to stay with MVC.

How to run Wordpress with MVC app as virtual on Azure

I'm wondering how to run a Wordpress and virtual MVC application under the WP on Azure. I found a lot of articles about this but it is not working and Azure SDK is changing all the time, there is no actual informations.
Am I able to connect to the Azure Web Role IIS server remotely?
If you have any questions, please ask before answering.
Update by Jim O'Neil comment
Yes I mean ASP.NET MVC. "Not working" means taht WP on Azure by this and ASP.NET MVC app works separatelly but together doeasn't. When I try add ASP .NET MVC as VirtualApplication by this tutrial VM on Azure is always in Busy state.
I need have an WP deployed on my domain example.com and ASP.NET MVC app at example.com/mvcapp. This should work on the Azure platform and could be reached by Virtual application feature of IIS. Then I hope that the Azure Web role is usable for this.
Do you have any idea?
If you really want to run wordpress website as www.example.com and ASP.NET MVC app as www.example.com/mvcapp then you could need to be little more creative to get it working. It is a doable task but need good understanding of Windows Azure platform, how Web Role works as well as PHP/WordPress knowledge.
I can point out some ideas on how you could do it but you would need to venture out to try and test. What you really need to create a ASP.NET Web Role with PHP support and have Wordpress configured to it. This could be done at runtime or you can put together worldpress along with the PHP itself so when you deploy your application whole wordpress is configured as package. Now in the same web role you add virtual diurectory and have MVC app running as application there.
Keep in mind that whole web role will have one single web.config so you would need to make it work with both ASP.NET PHP application and then MVC application. Tough task to handle these two and will take time to put together.
The other easier option is to have PHP running inside a ASP.NET MVC application and in the PHP folder setup your Wordpress application. This setup is easily configurable but it will change the location for wordpress and MVC app other way around.
Overall I really think you should rethink what you really want at the last because your objective just does not match with a need to have wordpress and ASP.NET MVC running together. If you just want to try for experiment, it sure is a great project and make you learn a lot.
This question is asked earlier # SO also but had same response i.e why?
I am not sure about on azure, but on IIS7 we have WP and the URL Rewriter setup as the default website and then deploy asp.net and ASP apps to virtual directories and turn off the URL Rewriter in those subdirectories. Works beautifully. Downside is that PHP runs like a dog on IIS compared to ASP/ASP.net. We are switching to using WP on LAMP and then continuing to run our ASP/.net apps on IIS7. Downside is that the WP after switch over may effect our SEO a little. IIS is www and WP will be ww3.
You might check your URL Rewrite rules if any.
You can create a website in Azure using a wordpress template VM.
You can also use http://wordpress.brandoo.pl/project/ which has an image available in Azure, this means you can use a SQL database rather than a MYSQL database which may help.
You can have one VM being your MVC app pointing to www.mydomain.com and you could have the worpress in a separate VM with say blog.mydomain.com
This would make maintenance easier I think

Is it possible to host an ASP.NET MVC2 website from a windows service?

I have a .NET 4 application that runs as a windows service. It runs periodic tasks and provides WCF restful webservices. It already hosts a silverlight web page (via WCF) that allows a user to configure the service.
Now I have a requirement to provide information on HTML/java script pages (e.g. for browsers and platforms that don't support Silverlight). I can serve simple HTML and javascript pages through WCF but that becomes laborious very quickly. I'd like to use MVC2.
Is it possible to provide MVC2 web pages from within a windows service? Or at least use some of the functionality provided by MVC like routing and the view engine?
Or is it more trouble than it's worth and should I head down the path of a separate app hosted on IIS?
You can host the ASP.NET runtime in any type of application including a Windows Service using the CreateApplicationHost method. Although note that by doing this you lose the robustness, security, logging, etc... that a real web server such as IIS provides.
Since you're asking the question about what route to take, I'd host an MVC2 application in IIS. Why recreate a web server using WCF when IIS is already there - and since you're asking, it sounds like that's a viable option.
I agree with Darin's answer that you can host ASP.NET MVC2 in any application, but I think you're going to end up recreating a lot of plumbing that's already in place with IIS.
On the upside, if you go with serving up ASP.NET MVC2 resources in a WCF service application, it may end up rocking and you could have a nice application you can sell on the side. :)

Resources