How to Deploy a Blazor Application in Azure App Service
Tags: azure, blazor, csharp, webdev
Published: 2020-12-07 09:26:22

---
title: How to Deploy a Blazor Application in Azure App Service
published: true
date: 2020-11-30 10:00:05 UTC
tags: azure, blazor, csharp, webdev
canonical_url: https://www.syncfusion.com/blogs/post/deploy-blazor-application-in-azure-app-service.aspx
cover_image: https://www.syncfusion.com/blogs/wp-content/uploads/2020/11/How-to-Deploy-a-Blazor-Application-in-Azure-App-Service-672x372.png
---

In this blog, I am going to walk you through deploying a default Blazor server application created in Visual Studio 2019 in Azure App Service. We will see three different ways we can deploy a Blazor application:

- Use an import profile (Web App service profile) in Visual Studio 2019.
- Use the Azure Portal login in Visual Studio 2019.
- Publish in a specific subfolder in Azure.

## Creating a Blazor server application

In this segment, we are going to create a Blazor server application using Visual Studio 2019.

1. Open Visual Studio 2019 and create a new project.  
 ![Open Visual Studio 2019 and create a new project](https://www.syncfusion.com/blogs/wp-content/uploads/2020/11/Open-Visual-Studio-2019-and-create-a-new-project.png)
2. Once **Blazor App** is selected, click **Next** to configure the project name and location.
3. Save the application, and then click **Create**.
4. Select **Blazor Server App** and click **Create** to complete the application creation.  
 ![Select Blazor Server App and click Create to complete the application creation](https://www.syncfusion.com/blogs/wp-content/uploads/2020/11/Select-Blazor-Server-App-and-click-Create-to-complete-the-application-creation.png)

## Deploying in Azure Portal

If you don’t have a login for Azure, [sign up](https://azure.microsoft.com/en-in/free/) to access the Azure Portal.

1. Click **Create a resource** in Azure to create a resource group.  
 ![Click Create a resource in Azure to create a resource group](https://www.syncfusion.com/blogs/wp-content/uploads/2020/11/Click-Create-a-resource-in-Azure-to-create-a-resource-group.png)
2. Select **Web App** Azure application service.  
 ![Select Web App Azure application service](https://www.syncfusion.com/blogs/wp-content/uploads/2020/11/Select-Web-App-Azure-application-service.png)
3. Once Web App is selected, select the following options:
  1. Free Trial selected as the subscription.
  2. Create a resource group name. I have named mine Blazor.
  3. Update the Instance Details:  
Name: blazor-publish. The application hosted will be available in this URL: blazor-publish.azurewebsites.net.  
Select the Code box for Publish.  
Choose the .NET Core 3.1 LTS runtime stack and Windows operating system.  
Select the region in which to publish the app. I am choosing the Central US region for this demo.
  4. The app service plan with the Free F1 option will be selected by default, but this can be modified.
  5. Once this is done, click **Review + create**.

![Create Web App window](https://www.syncfusion.com/blogs/wp-content/uploads/2020/11/Create-Web-App-window.png)

4. After configuring the Web App service, get the publish profile for the Web App service to host the Blazor application. Select the created web app service (blazor-publish). ![Select the created web app service (blazor-publish).](https://www.syncfusion.com/blogs/wp-content/uploads/2020/11/Select-the-created-web-app-service-blazor-publish..png)
5. Navigate to the overview section, click on **Get publish profile** , and save the profile locally.  
 ![Navigate to the overview section, click on Get publish profile, and save the profile locally](https://www.syncfusion.com/blogs/wp-content/uploads/2020/11/Navigate-to-the-overview-section-click-on-Get-publish-profile-and-save-the-profile-locally.png)

### Publish a Blazor server application in Azure

#### Using import-profile option

1. Right-click the project and click **Publish** in the context menu.  
 ![Right-click the project and click Publish in the context menu](https://www.syncfusion.com/blogs/wp-content/uploads/2020/11/Right-click-the-project-and-click-Publish-in-the-context-menu.png)
2. Choose **Import Profile** and click **Next**. Then, locate the downloaded publish profile for the web app service.  
 ![Choose Import Profile and click Next](https://www.syncfusion.com/blogs/wp-content/uploads/2020/11/Choose-Import-Profile-and-click-Next.png)
3. Finally, publish the application by clicking **Publish**. The application will be deployed and will be available in the URL [https://blazor-publish.azurewebsites.net/](https://blazor-publish.azurewebsites.net/).  
 ![Publish the application by clicking Publish](https://www.syncfusion.com/blogs/wp-content/uploads/2020/11/Publish-the-application-by-clicking-Publish.png)

#### Publish using Azure account login

1. Right-click on the project and click **Publish** in the context menu.  
 ![Right-click on the project and click Publish in the context menu](https://www.syncfusion.com/blogs/wp-content/uploads/2020/11/Right-click-on-the-project-and-click-Publish-in-the-context-menu-2.png)
2. Select **Azure** as the target and **Azure App Service (Windows)** as the specific target.  
 ![Select Azure as the target](https://www.syncfusion.com/blogs/wp-content/uploads/2020/11/Select-Azure-as-the-target-and-Azure-App-Service-Windows-as-the-specific-target.png)  
 ![Select Azure App Service (Windows) as the specific target](https://www.syncfusion.com/blogs/wp-content/uploads/2020/11/Select-Azure-App-Service-Windows-as-the-specific-target.png)
3. You need to log into your Azure account and choose the web app service. Then, click **Publish**.  
 ![Login into your Azure account and choose the web app service. Then, click Publish](https://www.syncfusion.com/blogs/wp-content/uploads/2020/11/Login-into-your-Azure-account-and-choose-the-web-app-service.-Then-click-Publish.png)  
 ![Click on Publish](https://www.syncfusion.com/blogs/wp-content/uploads/2020/11/Click-on-Publish.png)

Now, the application will be deployed and will be available in the URL: [https://blazor-publish.azurewebsites.net/](https://blazor-publish.azurewebsites.net/).  
 ![Output](https://www.syncfusion.com/blogs/wp-content/uploads/2020/11/Output-6.png)

#### Publish in a specific subfolder in Azure

If you need to deploy the Blazor application in a specific subfolder in Azure, create the folder using the **Advanced Tools** tab under Development Tools in the app service. Click the **Go** link, choose **CMD** in the debug console, and click on the **+** button to add a new folder. Here I have named the folder blazor-server-publish.  
 ![blazor server publish window](https://www.syncfusion.com/blogs/wp-content/uploads/2020/11/blazor-server-publish-window.png)

1. Configure the path mappings for the created folder blazorserver. Set site \blazorserver as the physical path and /blazorserver as the virtual path.  
 ![Set site \blazorserver as the physical path and/blazorserver as the virtual path.](https://www.syncfusion.com/blogs/wp-content/uploads/2020/11/Set-blazorserver-as-the-physical-path-andblazorserver-as-the-virtual-path.png)
2. Use the import Azure profile option. Locate the downloaded publish profile for the newly created web app service.
3. Edit the publish options to modify the site name and destination folder URL to include /blazorserver/.
4. Click **Save**. Then select **Publish** to launch the application in the specified subfolder.  
 ![Click Save. Then select Publish to launch the application in the specified subfolder](https://www.syncfusion.com/blogs/wp-content/uploads/2020/11/Click-Save.-Then-select-Publish-to-launch-the-application-in-the-specified-subfolder.png)

The application will be launched in the specified subfolder as shown in the following screenshot.  
 ![Output](https://www.syncfusion.com/blogs/wp-content/uploads/2020/11/Output-7.png)

## Summary

In this blog, you have learned the step-by-step procedure to create a Blazor server application, followed by the steps to deploy that application in the Azure Portal. All three methods to deploy the application are done using the publish profile option and Azure Portal login. I hope you found this article helpful.

[Syncfusion Essential Studio for Blazor](https://www.syncfusion.com/blazor-components) offers 65+ high-performance, lightweight, and responsive UI components for the web, including file-format libraries, in a single package. Please take a look at our live demos in our [sample browser](https://blazor.syncfusion.com/) for a hands-on experience.

For existing customers, the latest version is available for download from the [License and Downloads](https://www.syncfusion.com/account/downloads) page. If you are not yet a Syncfusion customer, you can try our 30-day [free trial](https://www.syncfusion.com/downloads) to check out the available features. You can try our samples from this [GitHub](https://github.com/syncfusion) location.

You can also contact us through our [support forums](https://www.syncfusion.com/forums), [Direct-Trac](https://www.syncfusion.com/support/directtrac/incidents), or [feedback portal](https://www.syncfusion.com/feedback/blazor-components). We are always happy to assist you!

If you like this post, we think you will also like the following:

- [MVVM Pattern in Blazor for State Management—A Complete Guide](https://dev.to/syncfusion/mvvm-pattern-in-blazor-for-state-management-a-complete-guide-3cj1) [Blog]
- [CSV Data Sources in Blazor Pivot Table: A Groundbreaking Feature](https://dev.to/syncfusion/csv-data-sources-in-blazor-pivot-table-a-groundbreaking-feature-69) [Blog]
- [10 Steps to Replace REST Services with gRPC-Web in Blazor WebAssembly](https://dev.to/syncfusion/10-steps-to-replace-rest-services-with-grpc-web-in-blazor-webassembly-1ckn) [Blog]
- [_Blazor Succinctly_](https://www.syncfusion.com/ebooks/blazor-succinctly) [Ebook]