Another way to restrict access is to use "Networking" settings of your storage resource.
I needed to
- allow access to members of our company's network
- disallow any public access.
In our company, all devices are behind a NAT with a central, outbound IP adress.
I use an Azure "StorageV2" storage to host a static site generated with Vuepress.
(side note for those who come here by searching for static site keywords: you need to activate static site hosting by clicking on "Static website" in the menu of your storage resource to activate it. That seems to be available only for StorageV2 storages, not for Blob storage)
The generated URL [myuniquename].[2chars].web.core.windows.net
is only available within the company by doing the following (by today, March 2021):
Azure's steps when creating a new StorageV2 resource are divided into six steps:
Basics -> Networking -> Data protection -> Advanced -> Tags -> Review + create.
In step two, Networking, within "Connectivity method"
- select "Public endpoint (selected networks)"
- leave "Virtual network" set to "none"
- leave "Routing preference" to "Microsoft network routing (default)"
- leave all other settings with their default (worked for me)
After storage creation, go to your new storage resource (find it via Home button, should be listed under "Recent resources"). From the menu on the left
- select "Networking"
- within "Firewall" click the checkbox "Add your client IP address (should show your IP address)".
Only do this, if you are within your company's network!
- Click "Save". I needed to click save twice, i.e. that save button turned grey only after second save. Whatever that means, just make sure.
Of course that might not work for other company networks. I am not too savvy with network administration.