When you buy this book you support this site! - Thank You for your support!

Sep 26

Written by: Michael Washington
9/26/2019 5:18 AM  RssIcon

image

Microsoft Azure is a cloud service provider that allows you to deploy your Blazor application to be used by anyone in the world.

 

image

If you don’t have a Microsoft Azure account, you can sign up for one here:

https://azure.microsoft.com/en-us/free

 

Create The Blazor Application

image

Open Visual Studio.

image

Select Create a new Project.

 

image

Select Blazor App and click Next.

 

image

Give it a name and click Create.

 

image

Select Blazor Server App and click Create.

 

image

The application will open in Visual Studio.

 

Publish To Azure

image

Right-click on the project node and select Publish.

 

image

When the publishing wizard comes up, select Advanced.

 

image

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)

 

image

Back on the publishing wizard, select App Service, Create New, and click the Publish button.

 

image

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)

 

image

The application will start deployment

 

image

The output window will display the progress and indicate when it is done.

 

image

A web browser window will open and display the deployed application.

 

image

Logging into Portal.Azure.com in your web browser, will allow you to administer the application.

 

image

For best performance, you will want to go into the Configuration for your App Service and select Configuration then General Settings

 

image

… 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.

See: Connecting Blazor to Azure SignalR Service (updated to Preview 4)

 

Special Thanks

Special thanks to Anthony Chu for Azure performance guidance.

 

Links

Blazor.net

Deploy ASP.NET Core 3 Previews to Azure App Service

What is Azure

Publish a Web app to Azure App Service using Visual Studio

Connecting Blazor to Azure SignalR Service (updated to Preview 4)

Tags: Blazor
Categories:

2 comment(s) so far...


Gravatar

Re: Deploying A Server Side Blazor Application To Azure

Hi Michael,
I have been trying to publish Blazor Server Side to Azure, with the authentication mode "Work or School Accounts" checked off. But I am having issues with reply URLs and can't get it published. The other forms of authentication seem to work flawlessly for me. Do you know how to get around this issue?

By Kornelis Byng on   8/5/2019 4:14 AM
Gravatar

Re: Deploying A Server Side Blazor Application To Azure

@Kornelis Byng - Sorry I have not tried that.

By Michael Washington on   8/5/2019 4:15 AM

Your name:
Gravatar Preview
Your email:
(Optional) Email used only to show Gravatar.
Your website:
Title:
Comment:
Security Code
CAPTCHA image
Enter the code shown above in the box below
Add Comment   Cancel 
Microsoft Visual Studio is a registered trademark of Microsoft Corporation / LightSwitch is a registered trademark of Microsoft Corporation