Skip to content

Commit fabfe1b

Browse files
authored
Remove content-type from static website upload command
Running through this quickstart myself, I ran into issues where my Azure static website wasn't properly loading CSS content because my .css files were being served with MIME type text/html instead of text/css. Removing the explicit content-type from the az CLI command caused the tool to properly set the content type for all of my files. It looks like this guide was specifying that to avoid situations where unrecognized filetypes were having unexpected content-types set automatically. That's definitely a valid problem, but I'd imagine your average developer going through this tutorial is going to be primarily uploading HTML/CSS/JS etc files that will be properly picked up by the content-type inference system, and not forcing `text/html` for every single file is going to be the path of least surprise.
1 parent c6a6040 commit fabfe1b

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

articles/storage/blobs/storage-blob-static-website-how-to.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ Upload objects to the *$web* container from a source directory.
154154
This example assumes that you're running commands from Azure Cloud Shell session.
155155

156156
```azurecli-interactive
157-
az storage blob upload-batch -s <source-path> -d \$web --account-name <storage-account-name> --content-type 'text/html; charset=utf-8'
157+
az storage blob upload-batch -s <source-path> -d \$web --account-name <storage-account-name>
158158
```
159159

160160
* Replace the `<storage-account-name>` placeholder value with the name of your storage account.
@@ -173,7 +173,6 @@ Upload objects to the *$web* container from a source directory.
173173
```powershell
174174
# upload a file
175175
set-AzStorageblobcontent -File "<path-to-file>" `
176-
-Properties @{ ContentType = "text/html; charset=utf-8";} `
177176
-Container `$web `
178177
-Blob "<blob-name>" `
179178
-Context $ctx

0 commit comments

Comments
 (0)