1

How can favicon.ico be served to browsers making requests to a public Blob Storage Container?

For a publicly-accessible Container at blahblah.blob.core.windows.net, a CDN endpoint was created and SSL cert attached so anyone can get to blobs at https://placeiwant.somewhere/bloblocation/etc/etc/mything.jpg. That works fine.

I noticed in the CDN logs that a browser is looking for https://placeiwant.somewhere/favicon.ico. That file does not exist, and if I point my browser to that URI, I get this error message:

<?xml version="1.0" encoding="ISO-8859-1"?>
<Error>
<Code>OutOfRangeInput</Code>
<Message>One of the request inputs is out of range. RequestId:nnnnnnnn-nnnn-nnnn-nnnn-nnnnnnnnnnnn Time:2020-09-10T13:47:48.5273562Z</Message>
</Error>

In addition to Container, I also have a static website set up in $web with CDN layered on top at https://webplaceiwant.somewhere, and a favicon.ico exists there, but I do not see a way to have that favicon.ico served when https://placeiwant.somewhere/ is accessed.

Thanks.

Snowy
  • 5,942
  • 19
  • 65
  • 119
  • Just to confirm your findings in 2021: Azure storage still inserts the Container name into the URL (e.g. `bloblocation`). Only $web, when set up as a Static Website, seems to magically strip the container-name, so you can serve something like `favicon.ico` from the root. – haz Mar 08 '21 at 23:31

1 Answers1

0

Generally, the web server will request the favicon.icofile when loading websites. When the CDN request responds to 400 error. I also could reproduce this error message displays when a browser is looking for https://placeiwant.somewhere/favicon.ico. It looks like it's an expected result.

For the static website set up in $web container with CDN. You can just place this favicon.ico file under the $web container.

enter image description here

When you browse the static website's primary endpoint, you will see the icon.

enter image description here

If this does not work for you. You can try to create a storage account v2 via the Azure portal because I have another storage account created by terraform that also appears this issue even I place the same static websites.

Nancy
  • 26,865
  • 3
  • 18
  • 34
  • CNAME mysite.com points to blob storage, CNAME mysiteweb.com points to $web. I see no way to have browser on mysite.com get favicon from mysiteweb.com, they are two different URIs. – Snowy Sep 15 '20 at 02:39
  • To verify it, Can you access the websites via storage blob primary endpoint(like the format in my reply) instead of the CDN endpoint? – Nancy Sep 15 '20 at 02:44
  • $web Container and blob storage Container are different URIs in Azure Storage just like they are different to the CDN. Navigating to container.web.core.windows.net/mycontainer/myblob.jpg with a browser still shows browser trying to get container.web.core.windows.net/favicon.ico, existence of $web has absolutely no impact, it has a different URI. – Snowy Sep 29 '20 at 14:56
  • Storage logs are filling with 400 errors because web browsers from all over the world are trying to get a favicon.ico that doesn't exist in the root of the Storage Account and there is no way to get one that I see. Maybe just add the feature for Storage Accounts? – Snowy Sep 29 '20 at 14:58