TypeScript icon, indicating that this package has built-in type declarations

3.1.2 • Public • Published

Strapi Provider Upload Azure Storage

Plugin enabling image uploading to azure storage from strapi.

NpmVersion NpmDownloads

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.


  • strapi@4.0.0+


Inside your strapi project run the following

yarn add strapi-provider-upload-azure-storage

# or

npm install strapi-provider-upload-azure-storage


To enable the provider, create or edit the file at ./config/plugins.js.

This is an example plugins.js file for Azure storage:

module.exports = ({ env }) => ({
  upload: {
    config: {
      provider: "strapi-provider-upload-azure-storage",
      providerOptions: {
        account: env("STORAGE_ACCOUNT"),
        accountKey: env("STORAGE_ACCOUNT_KEY"),
        serviceBaseURL: env("STORAGE_URL"), // optional
        containerName: env("STORAGE_CONTAINER_NAME"),
        defaultPath: "assets",
        cdnBaseURL: env("STORAGE_CDN_URL"), // optional
Property Required Description
account true Azure account name
accountKey true Secret access key
serviceBaseURL false Base service URL to be used, optional. Defaults to https://${account}
containerName true Container name
defaultPath true The path to use when there is none being specified. Defaults to assets
cdnBaseURL false CDN base url

Security Middleware Configuration

Due to the default settings in the Strapi Security Middleware you will need to modify the contentSecurityPolicy settings to properly see thumbnail previews in the Media Library. You should replace strapi::security string with the object bellow instead as explained in the middleware configuration documentation.

To allow the azure storage content to be displayed, edit the file at ./config/middlewares.js. You should replace the strapi::security string with the object below instead, see the Middlewares configuration documentation for more details.


module.exports = [
  // ...
    name: "strapi::security",
    config: {
      contentSecurityPolicy: {
        useDefaults: true,
        directives: {
          "connect-src": ["'self'", "https:"],
          "img-src": [
             * Note: If using a STORAGE_URL replace `https://${process.env.STORAGE_ACCOUNT}` w/ process.env.STORAGE_URL
             * If using a CDN URL make sure to include that url in the CSP headers process.env.STORAGE_CDN_URL
          "media-src": [
             * Note: If using a STORAGE_URL replace `https://${process.env.STORAGE_ACCOUNT}` w/ process.env.STORAGE_URL
             * If using a CDN URL make sure to include that url in the CSP headers process.env.STORAGE_CDN_URL

          upgradeInsecureRequests: null,
  // ...

serviceBaseURL is optional, it is useful when connecting to Azure Storage API compatible services, like the official emulator Azurite. serviceBaseURL would then look like http://localhost:10000/your-storage-account-key.
When serviceBaseURL is not provided, default https://${account} will be used.

cdnBaseURL is optional, it is useful when using CDN in front of your storage account. Images will be returned with the CDN URL instead of the storage account URL.


Contributions are welcome


We use SemVer for versioning. For the versions available, see the tags on this repository.



This project is licensed under the MIT License - see the file for details


  • Azure



Package Sidebar


npm i strapi-provider-upload-azure-storage2


Weekly Downloads






Unpacked Size

18.1 kB

Total Files


Last publish


  • devendratumu