Deploying A Server Side Blazor Application To Azure
Microsoft Azure is a cloud service provider that allows you to deploy your Blazor application to be used by anyone in the world.
If you don’t have a Microsoft Azure account, you can sign up for one here:
Create The Blazor Application
Open Visual Studio.
Select Create a new Project.
Select Blazor App and click Next.
Give it a name and click Create.
Select Blazor Server App and click Create.
The application will open in Visual Studio.
Publish To Azure
Right-click on the project node and select Publish.
When the publishing wizard comes up, select Advanced.
Select Self-Contained for Deployment Mode and win-x86 for Target Runtime and click Save.
(Note: Once .Net Core 3.0 is enabled on Azure, this step will no longer be required)
Back on the publishing wizard, select App Service, Create New, and click the Publish button.
Fill out the information for your App Service, and click Create.
(If you need assistance with the settings see: Publish a Web app to Azure App Service using Visual Studio)
The application will start deployment…
The output window will display the progress and indicate when it is done.
A web browser window will open and display the deployed application.
Logging into Portal.Azure.com in your web browser, will allow you to administer the application.
For best performance, you will want to go into the Configuration for your App Service and select Configuration then General Settings…
… and turn on Web sockets and click Save.
However, you will find that as more users use your Blazor application, the response time will slow.
To handle a large number of users, it is recommended that you use an Azure SignalR server.
Special thanks to Anthony Chu for Azure performance guidance.