This sample application can be used as a static website on Azure Storage to list the contents of a Blob container (anonymously). The project was bootstrapped with Create React App. The sample assumes your blob container is made public, however it can be modified to use Azure Active Directory authentication. The file browser also allows downloading each file with a single click.
Try the app here: https://staticwebsitedemo.z20.web.core.windows.net/
Follow the following steps to deploy the sample on your Azure Storage account. Once deployed, the sample app will provide you a file browser view of your $web container. If you desire so, you can change the container in the index.js
to any other public container.
git clone https://github.com/seguler/static-website-blob-browser
npm install -g create-react-app
in 'static-website-blob-browser' folderFile>Open Folder
menunpm install
and then npm run build
to build the React appbuild
folder in VSCode, and click Deploy to Static Website
Once you have deployed, configure the container as public, and set the CORS settings to allow access from the static website endpoint.
...
next to the desired blob container (in the sample, $web is used)Access Policy
and configure Public Access for the Container
. This is required for anonymously listing blobs using the SDK.