Restrict public access to Static Website

Andreas H 96 Reputation points
2020-11-03T15:17:18.747+00:00

We have a SPA deployed as Static Website in Azure Blob Storage, behind an Azure Front Door. How can we block direct access to the Static Website URL but allow access only through Front Door's URL?

Azure Front Door
Azure Front Door
An Azure service that provides a cloud content delivery network with threat protection.
576 questions
Azure Storage Accounts
Azure Storage Accounts
Globally unique resources that provide access to data management services and serve as the parent namespace for the services.
2,686 questions
0 comments No comments
{count} votes

Accepted answer
  1. Andreas H 96 Reputation points
    2020-11-04T13:44:16.717+00:00

    We managed to do it actually with the following way

    1. Created a virtual network
    2. Configured storage's firewall to allow access only from the virtual network
    3. Created an application gateway (instead of a front door) on the same virtual network that routes all traffic from a public ip to the url of the static website hosted in the blob storage.

    With this setup we are able to access the Static Website through the public ip of the gateway but we are not able to access the website directly from its own url.


1 additional answer

Sort by: Most helpful
  1. deherman-MSFT 33,306 Reputation points Microsoft Employee
    2020-11-03T20:49:43.1+00:00

    @Andreas H
    Disabling public access on a storage account does not affect static websites that are hosted in that storage account. Additionally, you can modify the public access level of the $web container, but this has no impact on the primary static website endpoint because these files are served through anonymous access requests. That means public (read-only) access to all files. So this is not an option currently when using static website hosting in Azure Storage. If you would like, you can submit a feature request on our feedback forum which will be reviewed by our product teams.

    -------------------------------

    Please don’t forget to "Accept the answer" and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.

    2 people found this answer helpful.
    0 comments No comments