Easy Azure deployment of .Net 4.5 websites, using Visual Studio 2012Last week, Windows Azure started supporting .Net 4.5. Long awaited, most welcome feature! Now we can create and deploy our .Net 4.5 websites straight to Azure, all from within Visual Studio 2012. No add-ons needed.
In your Azure account:
- Sign-in into your Azure account. If you don't have one, you can always sign-up for a free 3-month trial;
- Create a new Azure web host on the Azure server: Click on Web Sites in the left bar, then click on the large + New button at the bottom;
- Select Compute / Website / Quick Create (Note: you may have to sign-up for the Preview program at this point, if not already done so - it's simple, painless and quick);
- Give your new Azure web host a name that you like. The URL for your new site will be of the form: http://yournamechoice.azurewebsites.net;
- In a minute or 2, the host will be set up, and good to go (to receive your actual web content);
- (At this point, if you navigate to the URL, it will show an auto-created default page)
- In the main Azure window, click on the name of your new web host (not its URL), to get to its Dashboard page. Click on Download Publish Profile, and note where the Publish Profile was downloaded into your local machine. This will be used by Visual Studio 2012 in the next step.
In Visual Studio 2012:
- Open up your .Net 4.5 website project, and press Ctrl-F5 to make sure it runs well locally;
- Right-click on the website project, and select the Publish... option;
- You'll get a new Publish Web window. Click the Import... button, to import the Publish Profile (.PublishSettings file) you obtained earlier from your Azure website host;
- You can check everything by using the Next> button, and click Publish when all looks good;
- VS 2012 will take just 2 or 3 minutes to upload everything to your Azure host;
- At the end of the upload, Visual Studio will automatically bring up your new website, in your default browser.
That's it... done! The whole process has been made very direct and clean - even eliminating the need to add the extra "Windows Azure Cloud Service" project (as had to be done with VS 2010 or with .Net 4.0 websites earlier).