Proof of Concept - Azure Blob media content optimization
This project is a proof of concept to demonstrate how to optimize media content stored in Azure Blob Storage.
There are several workflows available:
- download: will download the files from the source container to a local folder using parallel requests and avoiding big files like videos. This criteria can be changed in the config file. This workflow will also create a
metadata.json
file that can be used to explorer the blob files - resize: will alert you from using huge images based on a threshold that can be modified in the config file.
- optimize: will optimize the files in a subfolder. It will print a report with the comparison between the original and the optimized files.
- upload: will upload the optimized files to a destination container. It will overwrite the previous files.
- Clone this repository
- Create a
.env
file and include the following variables:
AZURE_STORAGE_ACCOUNT_NAME=your-storage-account-name
AZURE_STORAGE_CONTAINER_NAME=yout-storage-container-name
AZURE_STORAGE_SAS_TOKEN=yout-storage-sas-token
- Use the correct version of Node.js (check the
.nvmrc
file)nvm use
- Install the dependencies
npm install
- Run the workflows in order:
npm run wf:download
npm run wf:resize
npm run wf:optimize
npm run wf:upload