Reputation: 2156
There are two ways of making a blob container accessible via CDN.
The first way is to point the CDN directly to the blob container, documented here: https://learn.microsoft.com/nl-nl/azure/cdn/cdn-create-a-storage-account-with-cdn
Origin type: Storage
Origin hostname: NAME.blob.core.windows.net.
Origin host header: NAME.blob.core.windows.net.
Origin path: /www (container name)
The second way is to map the $web blob container "static website" url to your CDN, documented here: https://learn.microsoft.com/nl-nl/azure/storage/blobs/static-website-content-delivery-network
In this scenario you need to enable the "static website" option on your storage account. Example configuration of a CDN endpoint:
Origin type: Custom Origin
Origin hostname: NAME.z6.web.core.windows.net (static website public url)
Origin host header: NAME.z6.blob.core.windows.net (static website public url)
Origin path: (empty)
Both methods map a blob container to the CDN endpoint. But the 2nd option has an additional, possibly unneeded, static website endpoint.
Can somebody explain the use-cases? It seems like the static website method is less flexible as you need to use the $web container specifically.
Upvotes: 2
Views: 1829
Reputation: 136146
It seems like the static website method is less flexible as you need to use the $web container specifically.
There are two distinct advantages you get out of hosting static website in Azure Storage:
NAME.z6.web.core.windows.net
to serve the default document otherwise you will have to specify the full path like NAME.blob.core.windows.net/container/index.html
, and$web
container otherwise you get standard 404 error message if a blob is not available in the blob container.These things are not available when you host a static website in any other blob container.
Upvotes: 3