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

01b. Deploying to Azure App Service from Visual Studio for Mac

Steve Smith edited this page Sep 20, 2019 · 10 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 for Mac:

1. Open the eShopOnWeb solution in Visual Studio for Mac.

eShopOnWeb in VS for Mac

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

Choose Publish - Publish to Azure...

3. Sign in if necessary, then choose an existing App Service or create a new one.

Choose an App Service

Click New in this case.

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

image

You can choose a free tier just to test things out. Click Next.

5. Configure Docker Container.

If you want, you can deploy the app into a container. To do so, the container will be published to Azure's container registry. Specify the registry details and then click Create. If you don't want to deploy as a container, uncheck the box and then click Create.

Configure Docker Container

6. Continue Working.

Creating the app service may take a few minutes. You're free to continue working in the meantime.

Creating the Azure App Service

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

Troubleshooting

You may see an error page like this one:

Error Page

If so, you need to either use the Development environment in your Azure App Service (which should only be done when testing), or configure an actual SQL Server database for the application to use.

To make this change, log in to the Azure Portal, navigate to your App Service, and go to its Configuration blade. Add a new configuration setting called ASPNETCORE_ENVIRONMENT and give it a value of Development.

Add Configuration in Azure Portal

Don't forget to hit Save, and then refresh your application. It should now load successfully:

eShopOnWeb on Azure

Learn more about Azure deployment options in the official documentation.

Clone this wiki locally