This project contains a web-based Azure Storage Explorer with a Python Flask backend, and a separate React frontend.
Note: The backend has been updated to an Azure Storage Explorer and is no longer directly integrated with the initial React frontend. The backend serves its own HTML templates. The frontend can be run independently, but it will not communicate with the new backend without further modifications.
The backend is a Flask application that allows you to connect to an Azure Storage account and perform the following actions:
- List containers
- Browse folders within containers
- Upload and download blobs
- Delete blobs
- Create folders
- Preview certain file types (JSON, CSV, Parquet)
The frontend is a basic React application created with create-react-app.
- Python 3.x
- A Python virtual environment (
venv) is highly recommended. - The packages listed in
backend/requirements.txt.
- Node.js and npm (or yarn)
- The packages listed in
frontend/package.json.
The application's backend requires credentials to connect to your Azure Storage Account. You can use a connection string or an Account URL and a SAS Token. Here’s how to get the Account URL and SAS Token from the Azure Portal.
-
Sign in to the Azure Portal.
-
Navigate to your Storage Account.
-
In the left-hand menu, scroll down to the Settings section and click on Endpoints.
-
Locate the Blob service endpoint.
-
Copy the URL. This is the value you will use for the
Account URLfield.Example:
https://yourstorageaccount.blob.core.windows.net/
- While in your Storage Account, navigate to the Security + networking section in the left-hand menu and click on Shared access signature.
- Configure the permissions for the token. For this application to have full functionality, use the following settings:
- Allowed services: Ensure Blob is checked.
- Allowed resource types: Check Service, Container, and Object.
- Allowed permissions: To enable all features (view, upload, delete), it is recommended to check Read, Write, Delete, List, Add, and Create. At a minimum, you need
ReadandListto browse and download.
- Set an expiry date for the token. Be mindful that after this date, the token will no longer work.
- Click the Generate SAS and connection string button at the bottom of the page.
- A new set of fields will appear. Copy the value from the SAS token field. It should start with
?sv=.... This is the value you will use for theCredential (SAS Token)field.
-
Clone the repository (or download the files).
-
Set up the Backend:
a. Create and activate a Python virtual environment: Open a terminal in the project's root directory and run: * For Windows:
bash python -m venv venv .\venv\Scripts\activate* For macOS/Linux:bash python3 -m venv venv source venv/bin/activateb. Install backend dependencies: With the virtual environment activated, install the required Python packages:
bash pip install -r backend/requirements.txt -
Set up the Frontend:
a. Navigate to the frontend directory:
bash cd frontendb. Install frontend dependencies (creates node_modules): This command reads the
package.jsonfile and installs the required libraries into thenode_modulesdirectory.bash npm installc. Build the React application (optional): This command bundles the app into static files for production. The new backend does not serve these files, but you can build them to test the frontend build process.
bash npm run buildd. Navigate back to the root directory:
bash cd ..
-
Activate the virtual environment (if not already active): From the root directory, run:
- For Windows:
.\venv\Scripts\activate - For macOS/Linux:
source venv/bin/activate
- For Windows:
-
Start the Flask server:
python backend/app.py
-
Access the application: Open your web browser and go to http://localhost:5000. You will see the Azure Storage Explorer interface.
You can run the original React frontend separately using its own development server.
- Navigate to the frontend directory:
cd frontend - Start the development server:
npm start
- Access the application:
Open your web browser and go to http://localhost:3000 (or the address provided by the
npm startcommand). You will see the basic React app.