Azure storage
Store uploaded files to your Medusa backend on S3.
Features
- Store product images on Azure Storage
- Support for importing and exporting data through CSV files, such as Products or Prices.
- Support for Bucket Policies and User Permissions.
Prerequisites
How to Install
1. Run the following command in the directory of the Medusa backend:
1npm install medusa-file-azure-storage
2. Set the following environment variables in Copy to clipboard
.env
:123AZURE_STORAGE_CONNECTION_STRING=<YOUR_AZURE_STORAGE_CONNECTION_STRING>AZURE_STORAGE_PUBLIC_CONTAINER_NAME=<YOUR_PUBLIC_CONTAINER>AZURE_STORAGE_PROTECTED_CONTAINER_NAME=<YOUR_PROTECTED_CONTAINER>
3. In Copy to clipboard
medusa-config.js
add the following at the end of the Copy to clipboardplugins
array:1234567891011const plugins = [// ...{resolve: `medusa-file-azure-storage`,options: {AZURE_STORAGE_CONNECTION_STRING: process.env.AZURE_STORAGE_CONNECTION_STRING,AZURE_STORAGE_PUBLIC_CONTAINER_NAME: process.env.AZURE_STORAGE_PUBLIC_CONTAINER_NAME,AZURE_STORAGE_PROTECTED_CONTAINER_NAME: process.env.AZURE_STORAGE_PROTECTED_CONTAINER_NAME},},]
Test the Plugin
1. Run the following command in the directory of the Medusa backend to run the backend:
1npm run start
2. Upload an image for a product using the admin dashboard or using the Admin APIs.