Error deploying Blazor WASM to Azure App Service

Michael Lambert 1 Reputation point
2020-08-14T00:17:55.833+00:00

I'm having issues deploying Blazor WASM to Azure App Services. Even if I just take the Blazor default template and try to deploy it, it errors when I go to the Fetch data page with this error: enter image description here
17478-ulo75.png

Probably because the content-type is: text\html and not 'application/json; charset=utf-8' like when I run it from with VS, which runs fine. Any suggestion on what is going on and how to correct this? Thanks
17497-image.png
17498-image.png

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
{count} votes

1 answer

Sort by: Most helpful
  1. Ryan Hill 30,326 Reputation points Microsoft Employee Moderator
    2020-08-21T21:47:09.353+00:00

    @Michael Lambert I wasn't able to replicate your issue. WeatherForecast isn't an accessible route on the default Blazor template.

    19621-image.png

    The error message for the invalid route is handled on the App.razor file which is what you should've gotten. Verify your App.razor and also check for any modified @Anonymous directives.

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.