Skip to content

ramp4-pcar4/static-website-blob-browser

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

services platforms author
storage
javascript
seguler

Static Website Sample - File Browser app for Blob Storage

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.

Demo

Try the app here: https://staticwebsitedemo.z20.web.core.windows.net/

Pre-requsites

Deploy the sample - step by step

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.

  • Clone the repository to your PC git clone https://github.com/seguler/static-website-blob-browser
  • Launch VS Code. Log on to the Azure Storage extension.
  • Install create-react-app using a terminal (VSCode) npm install -g create-react-app in 'static-website-blob-browser' folder
  • Open the sample in VSCode using File>Open Folder menu
  • On the terminal, run npm install and then npm run build to build the React app
  • Right click build folder in VSCode, and click Deploy to Static Website
  • Choose your storage account to deploy the static website

Once you have deployed, configure the container as public, and set the CORS settings to allow access from the static website endpoint.

  • Go to Azure Portal, select your storage account
  • Click CORS on the menu. And add a new row
  • Go to Blobs menu
  • Click on the ... next to the desired blob container (in the sample, $web is used)
  • Click on Access Policy and configure Public Access for the Container. This is required for anonymously listing blobs using the SDK.

Blob browser - Static website

More information

About

Static Website - File Browser App for Blob Storage

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 89.1%
  • HTML 8.4%
  • CSS 2.5%