This is for my future self and to anyone else out there who could face similar issues.

Deploying Blazor WASM on Azure Static Web Apps works, but you might face errors related to integrity checks and whatnot, depending on the way you deploy.

For example, I’ve used Github Actions to deploy my app and I spent a lot of time debugging and trying to fix errors, similar to these:

So, here is how I fixed these integrity check errors in my Blazor WASM app.

Add a staticwebapp.config.json file with content similar to this

{
  "navigationFallback": {
    "rewrite": "/index.html",
    "exclude": [ "*.{css,scss,js,png,gif,ico,jpg,svg,json,jpeg}" ]
  }
}

Edit service-worker.published.json file

That’s it!

Hope that helps you in your journey, dear friend 🧑🏼‍💻

Categorized in:

Azure, blazor,

Last Update: January 23, 2023