From 39fb77d0baf4f79b41efc52d05e81df5ec8a00bd Mon Sep 17 00:00:00 2001 From: Luke Latham <1622880+guardrex@users.noreply.github.com> Date: Thu, 28 May 2020 07:44:13 -0500 Subject: [PATCH] MIME types for Blazor Azure Storage deployments (#18507) --- aspnetcore/host-and-deploy/blazor/webassembly.md | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/aspnetcore/host-and-deploy/blazor/webassembly.md b/aspnetcore/host-and-deploy/blazor/webassembly.md index 31228863b5..eede5b9b1c 100644 --- a/aspnetcore/host-and-deploy/blazor/webassembly.md +++ b/aspnetcore/host-and-deploy/blazor/webassembly.md @@ -5,7 +5,7 @@ description: Learn how to host and deploy a Blazor app using ASP.NET Core, Conte monikerRange: '>= aspnetcore-3.1' ms.author: riande ms.custom: mvc -ms.date: 05/19/2020 +ms.date: 05/27/2020 no-loc: [Blazor, "Identity", "Let's Encrypt", Razor, SignalR] uid: host-and-deploy/blazor/webassembly --- @@ -165,6 +165,16 @@ When the blob service is enabled for static website hosting on a storage account * Set the **Index document name** to `index.html`. * Set the **Error document path** to `index.html`. Razor components and other non-file endpoints don't reside at physical paths in the static content stored by the blob service. When a request for one of these resources is received that the Blazor router should handle, the *404 - Not Found* error generated by the blob service routes the request to the **Error document path**. The *index.html* blob is returned, and the Blazor router loads and processes the path. +If files aren't loaded at runtime due to inappropriate MIME types in the files' `Content-Type` headers, take either of the following actions: + +* Configure your tooling to set the correct MIME types (`Content-Type` headers) when the files are deployed. +* Change the MIME types (`Content-Type` headers) for the files after the app is deployed. + + In Storage Explorer (Azure portal) for each file: + + 1. Right-click the file and select **Properties**. + 1. Set the **ContentType** and select the **Save** button. + For more information, see [Static website hosting in Azure Storage](/azure/storage/blobs/storage-blob-static-website). ### Nginx @@ -468,4 +478,4 @@ In the project file, the script is run after publishing the app: ``` To provide feedback, visit [aspnetcore/issues #5477](https://github.com/dotnet/aspnetcore/issues/5477). - \ No newline at end of file +