Installing Visual Studio Express 2012 for Web

You can install Microsoft Visual Studio Express 2012 for Web or another "Express" version using the Microsoft Web Platform Installer. The following instructions guide you through the steps required to install Visual studio Express 2012 for Web using Microsoft Web Platform Installer.
  1. Go to [https://go.microsoft.com/?linkid=9810169](https://go.microsoft.com/?linkid=9810169). Alternatively, if you already have installed Web Platform Installer, you can open it and search for the product "Visual Studio Express 2012 for Web with Azure SDK".
  2. Click on Install Now. If you do not have Web Platform Installer you will be redirected to download and install it first.
  3. Once Web Platform Installer is open, click Install to start the setup.
    Install Visual Studio Express
    Install Visual Studio Express
  4. Read all the products' licenses and terms and click I Accept to continue.
    Accepting the license terms
    Accepting the license terms
  5. Wait until the downloading and installation process completes.
    Installation progress
    Installation progress
  6. When the installation completes, click Finish.
    Installation completed
    Installation completed
  7. Click Exit to close Web Platform Installer.
  8. To open Visual Studio Express for Web, go to the Start screen and start writing "VS Express", then click on the VS Express for Web tile.
    VS Express for Web tile
    VS Express for Web tile

Appendix C: Publishing an ASP.NET MVC 4 Application using Web Deploy

This appendix will show you how to create a new web site from the Azure Portal and publish the application you obtained by following the lab, taking advantage of the Web Deploy publishing feature provided by Azure.

Task 1 - Creating a New Web Site from the Azure Portal

  1. Go to the Azure Management Portal and sign in using the Microsoft credentials associated with your subscription.
    Note
    With Azure you can host 10 ASP.NET Web Sites for free and then scale as your traffic grows. You can sign up here.
    Log on to Windows Azure portal
    Log on to Portal
  2. Click New on the command bar.
    Creating a new Web Site
    Creating a new Web Site
  3. Click Compute | Web Site. Then select Quick Create option. Provide an available URL for the new web site and click Create Web Site.
    Note
    Azure is the host for a web application running in the cloud that you can control and manage. The Quick Create option allows you to deploy a completed web application to the Azure from outside the portal. It does not include steps for setting up a database.
    Creating a new Web Site using Quick Create
    Creating a new Web Site using Quick Create
  4. Wait until the new Web Site is created.
  5. Once the Web Site is created click the link under the URL column. Check that the new Web Site is working.
    Browsing to the new web site
    Browsing to the new web site
    Web site running
    Web site running
  6. Go back to the portal and click the name of the web site under the Name column to display the management pages.
    Opening the web site management pages
    Opening the Web Site management pages
  7. In the Dashboard page, under the quick glance section, click the Download publish profile link.
    Note
    The publish profile contains all of the information required to publish a web application to a Azure for each enabled publication method. The publish profile contains the URLs, user credentials and database strings required to connect to and authenticate against each of the endpoints for which a publication method is enabled. Microsoft WebMatrix 2Microsoft Visual Studio Express for Web and Microsoft Visual Studio 2012 support reading publish profiles to automate configuration of these programs for publishing web applications to Azure.
    Downloading the web site publish profile
    Downloading the Web Site publish profile
  8. Download the publish profile file to a known location. Further in this exercise you will see how to use this file to publish a web application to Azure from Visual Studio.
    Saving the publish profile file
    Saving the publish profile file

Task 2 - Configuring the Database Server

If your application makes use of SQL Server databases you will need to create a SQL Database server. If you want to deploy a simple application that does not use SQL Server you might skip this task.
  1. You will need a SQL Database server for storing the application database. You can view the SQL Database servers from your subscription in the Azure Management portal at Sql Databases | Servers | Server's Dashboard. If you do not have a server created, you can create one using the Add button on the command bar. Take note of the server name and URL, administrator login name and password, as you will use them in the next tasks. Do not create the database yet, as it will be created in a later stage.
    SQL Database Server Dashboard
    SQL Database Server Dashboard
  2. In the next task you will test the database connection from Visual Studio, for that reason you need to include your local IP address in the server's list of Allowed IP Addresses. To do that, click Configure, select the IP address from Current Client IP Address and paste it on the Start IP Address and End IP Address text boxes and click the add-client-ip-address-ok-button button.
    Adding Client IP Address
    Adding Client IP Address
  3. Once the Client IP Address is added to the allowed IP addresses list, click on Save to confirm the changes.
    Confirm Changes
    Confirm Changes

Task 3 - Publishing an ASP.NET MVC 4 Application using Web Deploy

  1. Go back to the ASP.NET MVC 4 solution. In the Solution Explorer, right-click the web site project and select Publish.
    Publishing the Application
    Publishing the web site
  2. Import the publish profile you saved in the first task.
    Importing the publish profile
    Importing publish profile
  3. Click Validate Connection. Once Validation is complete click Next.
    Note
    Validation is complete once you see a green checkmark appear next to the Validate Connection button.
    Validating connection
    Validating connection
  4. In the Settings page, under the Databases section, click the button next to your database connection's textbox (i.e. DefaultConnection).
    Web deploy configuration
    Web deploy configuration
  5. Configure the database connection as follows:
    • In the Server name type your SQL Database server URL using the tcp: prefix.
    • In User name type your server administrator login name.
    • In Password type your server administrator login password.
    • Type a new database name, for example: MVC4SampleDB.
      Configuring destination connection string
      Configuring destination connection string
  6. Then click OK. When prompted to create the database click Yes.
    Creating the database
    Creating the database
  7. The connection string you will use to connect to SQL Database in Windows Azure is shown within Default Connection textbox. Then click Next.
    Connection string pointing to SQL Database
    Connection string pointing to SQL Database
  8. In the Preview page, click Publish.
    Publishing the web application
    Publishing the web application
  9. Once the publishing process finishes, your default browser will open the published web site.
    Application published to Windows Azure