Skip to content
This repository has been archived by the owner on May 23, 2024. It is now read-only.

01a. Deploying to Azure App Service from Visual Studio

Nish Anil edited this page Mar 15, 2021 · 2 revisions

To deploy the eShopOnWeb sample application to an Azure App Service (assuming you've already cloned or downloaded it locally, and you have an Azure account), follow these steps from Visual Studio (see here to start from the Azure Portal):

1. Open the eShopOnWeb solution in Visual Studio.

2. Right-click on the Web project in Solution Explorer and choose Publish.

image

3. Choose Microsoft Azure App Service.

Leave the option to Create New selected. Click Publish.

image

4. Choose an App Name, Subscription, Resource Group, and App Service Plan.

Create a new Resource Group, if desired. You can specify a Free App Service Plan, if desired, as shown.

image

5. Click Create.

The Publish profile will be saved and the eShopOnWeb sample will be published to the Azure App Service.

image

Once the publish process has completed, your deployed app will launch in your browser.

image

Learn more about Azure deployment options in the official documentation.

Optional

If you are not seeing data initially in the store, the most likely reason is that the Azure App Service is configured for Production, not Development (Note: This is not the same as Debug vs. Release configuration). The sample data is only seeded in the Development environment. You can configure the App Service to run in Development as follows:

  1. In the Azure Portal, navigate to your Web App.

  2. Click Application settings.

  3. Scroll down to App settings.

  4. Add a new key ASPNETCORE_ENVIRONMENT with value Development.

  5. Click Save.

image

At this point, you should be able to refresh the site and see it loaded with data (if not, publish once more from Visual Studio).

image

Notes

  • You may need to ensure you have the Bundler and Minifier extension installed in Visual Studio, otherwise your CSS may not be minified and referenced correctly in the deployed version of the application. Alternately, you can modify _Layout.cshtml to use app.css instead of app.css.min in Production.
Clone this wiki locally