title: Blazor Server Responds with HTML Instead of JSON When Deployed to Azure
body: <p>I have a server hosted Blazor application that works perfectly fine in my development environment.  However, when I deploy the application to Azure the server responds with &quot;text/html&quot; instead of &quot;application/json&quot;.</p>
  <p>To simplify and test this I wrote a very basic &quot;Hello World&quot; end point that simply replies with a json object.  When I navigate directly to this endpoint from my development environment the server responds with &quot;application/json&quot;.</p>
  <p><a href="https://i.stack.imgur.com/5Aujd.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5Aujd.png" alt="enter image description here" /></a></p>
  <p>When I deploy the application to Microsoft Azure and then navigate to the exact same endpoint the server responds with &quot;text/html&quot;.</p>
  <p><a href="https://i.stack.imgur.com/ZNUXR.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ZNUXR.png" alt="enter image description here" /></a></p>
  <p>To reiterate, I'm not changing any code between environments and I'm navigating to the exact same endpoint.  What am I missing?</p>
  <p><strong>EDIT</strong></p>
  <p>As a test I went and created a completely vanilla .NET Core 5 Blazor WASM Application.  This is a server hosted app.  When I run it locally everything works great.  When I deploy it to Azure I get the EXACT SAME ERROR that I'm getting in the application I'm trying to write.  To me, this is more evidence that it is something to do with how Azure Web Apps are configured or some other Azure related issue.</p>
  <p><strong>THIS IS THE APP WHEN I LOAD IT FROM THE SERVER:</strong></p>
  <p><a href="https://i.stack.imgur.com/ikYmB.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ikYmB.png" alt="enter image description here" /></a></p>
  <p><strong>THIS IS THE PREVIEW FROM DEV TOOLS</strong></p>
  <p><a href="https://i.stack.imgur.com/MLVU8.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/MLVU8.png" alt="enter image description here" /></a></p>
  <p><strong>THIS IS THE EXCEPTION FROM THE CONSOLE</strong></p>
  <p><a href="https://i.stack.imgur.com/n3epO.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/n3epO.png" alt="enter image description here" /></a></p>
  <p>Something is clearly going on when I publish this to Azure.</p>