Best practices for Blazor app re-deployment

Viewed 520

I currently have a Blazor server side application that will be ready to deploy soon and I have been thinking about the best practices for re-deployments for bug fixes or things like single page changes / CSS changes in the future.

However, I am fairly new to the deployment / maintainence side of things so would like some advice (and what better than to ask the SO community) on the best practices/processes I could go through for re-deploying new versions of the app in the future.

For a bit of background I am currently publishing the application to a folder locally from Visual Studio and then uploading this published folder to the web server where the website is hosted on IIS.

My main focus point I would like advice on:

When I have put the application live on the web server and I need to implement a bug fix or for example a change to a web page / css change, my thoughts would be to:

  1. Publish new app version to a local folder
  2. Put the site into maintenance mode
  3. Remove the entire currently live app folder off the web server
  4. Upload my newly published local app folder (from step 1.) in its place containing the changes
  5. Make the website live again

Would this be the correct approach or is there a much better practice/process to follow for re-deployments?

Obviously if this was a conventional website you would just replace the individual html, JS or css files you have changed and you are done, but it is a little different with Blazor Apps as you have to publish the entire app (as far as I am aware).

Forgive me if this question sounds trivial, I just want to be 100% sure I have the correct process as this will become important when the website is fully online and will limit downtime in the future.

1 Answers

A pragmatic, best practices way, easy-to-understand for you. Use

  • Git for version control system.
  • CI server, for example: Jenkins CI, Azure DevOps, etc.

when you need deploy, you push a specific git tag, then Jenkins CI, build, deploy to what you want. Of course, Jenkins CI will help you customize setting parameters according to per environment (development, testing, production).

Use

dotnet clean
dotnet publish

support your deployment, re-deployment process.

Few tutorials is helpful for you: https://www.youtube.com/watch?v=cyzn8v8dcB8

Related