Publishing Blazor Apps
Publish a Blazor app to Azure
Publish a Blazor App
There are many ways to publish Blazor apps, and software in general.
Publishing using IDE tools is a straightforward way to get the app up and running quickly, especially for solo developers. However, if you’re working on a team, the team may have a deployment process in place, or even a DevOps person or team that creates the procedures and steps around deployment. For teams who are using CI/CD (Continuous Integration/Continuous Delivery), TeamCity is a general-purpose CI/CD solution that allows the most flexibility any kind of workflow.
For the purposes of this tutorial, we’ll look at publishing using the Azure toolkit for Rider.
Additionally, you must consider that structure of the overall solution. You may have multiple projects in a solution which need deployment. You may also have a database to deploy. Databases and Web API projects can be deployed right along with your Blazor projects. For this tutorial, however, we'll assume the database and API have already been deployed. We'll publish just the Blazor app to Azure.
Deploy the Client App
To deploy a Blazor client app to Azure, you must supply the following information:
- Azure sign-in credentials
- The Azure subscription you want to use
- Unique app name
- Resource groups.
- Target OS
- Azure App Service plan.
You may use existing resources or create new ones when you deploy. Tools like Rider provide a nice UX to use the deployment information to publish. Right-click on the project and choose Publish. While we're deploying to Azure, you may deploy to a web host or internally as well through Rider's UI.
This information is needed so the Azure Toolkit can create and configure your app in Azure. You may use existing resources from Azure or create new ones just for your app. Click Run to publish the app to Azure. Once published, you can use the Azure Toolkit or the Azure Portal to manage the settings in Azure.
Rider’s quick-publish strategy works well when a single developer or small team wants to deploy a solution, especially to Azure. Keep in mind there are CI/CD options available for larger teams and those working in an enterprise environment.