Publish the App to Azure Azure App Service

Download Completed Project

As the last step, you will publish the application to Azure. In Solution Explorer, right-click the project and select Publish.

Screenshot of the Solution Explorer window with the project right-clicked and the Publish item on the list highlighted in yellow.

Clicking Publish invokes the Publish Web dialog. If you checked Host in Cloud when you first created the project, then the connection and settings are already configured. In that case, just click the Settings tab and check "Execute Code First Migrations". (If you didn't check Host in Cloud at the beginning, then follow the steps in the next section.)

Screenshot of the Publish Web dialog with the Settings tab and the Publish button highlighted in blue.

To deploy the app, click Publish. You can view the publishing progress in the Web Publish Activity window. (From the View menu, select Other Windows, then select Web Publish Activity.)

Screenshot of the Web Publish Activity window showing the overall status bar and displaying a successful publishing message.

When Visual Studio finishes deploying the app, the default browser automatically opens to the URL of the deployed website, and the application that you created is now running in the cloud. The URL in the browser address bar shows that the site is being loaded from the Internet.

Screenshot of the browser window showing the newly deployed Book Service website and a list of books and authors with links to details.

Deploying to a New Website

If you did not check Host in Cloud when you first created the project, you can configure a new web app now. In Solution Explorer, right-click the project and select Publish. Select the Profile tab and click Microsoft Azure Websites. If you aren't currently signed in to Azure, you will be prompted to sign in.

Screenshot of the Publish Web dialog with the Profile button highlighted in blue and the BookService website selected from the dropdown list.

In the Existing Websites dialog, click New.

Screenshot of the Existing Websites dialog showing the Existing Web Sites dropdown list and the New button.

Enter a site name. Select your Azure subscription and the region. Under Database server, select Create New Server, or select an existing server. Click Create.

Screenshot of the Create site on Windows Azure dialog with the Database username and Database password fields highlighted in yellow.

Click the Settings tab and check "Execute Code First Migrations". Then click Publish.