How to Publish ASP.NET MVC Web Application to Windows Azure

With this article, I will show every steps you need to complete to deploy an ASP.NET MVC application to a Windows Azure Web Site by using the Publish Web Wizard that exists on Visual Studio 2013.

STEP 1 – Install Windows Azure SDK for .NET

This could be done throw Microsoft Web Plataform Installer

Select the option Add on item Windows Azure SDK for .NET (VS 2013) -2.2, and the component will be installed on your machine.

STEP 2 – Create Azure Account

You need to get an windows azure account. Everyone can open a Windows Azure account for free.

Check the link below for more information.

http://www.windowsazure.com/en-us/pricing/free-trial/ 

STEP 3 – Create ASP.NET MVC Application

Check my wiki article about that on linkhttp://social.technet.microsoft.com/wiki/contents/articles/22208.asp-net-mvc-5-crud-operations-with-entity-framework-6-on-visual-studio-2013.aspx

You also can download the code from my sample on http://code.msdn.microsoft.com/MVC5-Demo-with-Entity-c6bc81df 

STEP 4 – Deploy to Windows Azure

  • In Visual Studio select Solution Explorer and right-click the project
  • Then select Publish option from the context menu.
  • The Publish Wizard window will open. Select the option Import
  • A new Windows will open. On this window we have two choices to import publish settings:
    • Import from a Windows Azure Web Site
    • Import from a publish profile file (I will demonstrate this one).
      • To use this option, we need to create the Web Site on Windows Azure.
  • Access to the web page of Windows Azure Management Portal (https://manage.windowsazure.com/  )
    • On this page we have a lot of options on the left side of the page. In this case we will focus on the Web Site one.
      • Select Web Sites option
      • On the left bottom select the option New
  • A new role of options will appear to select what kind of web site we need to create.
    • We will select the Quick Create option

To create a new site, we need to provide the url and region.
After that, is necessary to check the option Create Web Site, that will be provisiong the new website

  • As we can check the new site was created with success with name mvc5publishdemo

  • The final step on Azure side, is to Download the Publish Profile that we need on Visual Studio. For that we have na option Download the Publish Profile on the Dashboard of our new site.
    • Check that option and download the file to a location on local machine.
  • Select the previous downloaded file and select OK button.
  • A new window will be provided. To finalize the publish select the Publish button.
  • The publish will be made with successed and the web site will be opened in our default browser.

Windows Azure Resources

Some good resources about Windows Azure could be foud here:

Advertisements

About João Sousa
Senior Software Engineer in .Net (Microsoft Certified MTCS and MCPD). .NET Microsoft MVP 2015

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: