Pages

Monday, October 29, 2012

Azure .Net 4.5 projects through VS 2012

Easy Azure deployment of .Net 4.5 websites, using Visual Studio 2012

Last 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:


  1. Sign-in into your Azure account. If you don't have one, you can always sign-up for a free 3-month trial;
  2. 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;
  3. 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);
  4. 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;
  5. In a minute or 2, the host will be set up, and good to go (to receive your actual web content);
  6. (At this point, if you navigate to the URL, it will show an auto-created default page)
  7. 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:

  1. Open up your .Net 4.5 website project, and press Ctrl-F5 to make sure it runs well locally;
  2. Right-click on the website project, and select the Publish... option;
  3. 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;
  4. You can check everything by using the Next> button, and click Publish when all looks good;
  5. VS 2012 will take just 2 or 3 minutes to upload everything to your Azure host;
  6. 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).

Happy coding!

No comments:

Post a Comment