Orchardcore azure media

From CrestApps/CrestApps.AgentSkills · View interactive version

Orchardcore azure media is an AI agent skill from the GitHub repository CrestApps/CrestApps.AgentSkills. Skill for configuring Azure Blob media storage in Orchard Core. Covers the OrchardCore.Media.Azure.Storage and OrchardCore.Media.Azure.ImageCache features, the OrchardCore Media Azure and Media Azure ImageCache configuration sections, environment variable and Key Vault secret names, connection and c

How to use this skill

Skill file

Orchard Core Azure Media Storage

Module Overview

The OrchardCore.Media.Azure module stores media in Azure Blob Storage instead

of App_Data:

Media is still served by the Orchard Core site: the Media Cache fetches blobs on

demand, which keeps on-the-fly resizing working, and AssetUrl helpers point to

the site (or to Media:CdnBaseUrl). Only one storage provider is active at a

time.

{
  "steps": [
    {
      "name": "Feature",
      "enable": [
        "OrchardCore.Media.Azure.Storage",
        "OrchardCore.Media.Azure.ImageCache"
      ],
      "disable": []
    }
  ]
}

Azure Media Storage (`OrchardCore:Media:Azure`)

| Property | Description | Default |

|---|---|---|

| ConnectionString | Storage account connection string (required). | |

| ContainerName | Container name, a valid lowercase DNS name. Templatable. | |

| BasePath | Optional sub-path inside the container. Templatable. | |

| CreateContainer | Create the container on tenant activation if missing. | true |

| RemoveContainer | Delete the container when the tenant is removed. | false |

| UseHierarchicalNamespace | Force Gen2 (true) or Gen1 (false) behavior. Leave unset to auto-detect. | unset |

{
  "OrchardCore": {
    "Media": {
      "Azure": {
        "ConnectionString": "DefaultEndpointsProtocol=https;AccountName=myaccount;AccountKey=mykey;EndpointSuffix=core.windows.net",
        "ContainerName": "media",
        "BasePath": "Media",
        "CreateContainer": true,
        "RemoveContainer": false
      }
    }
  }
}

Hierarchical namespace (ADLS Gen2)

{
  "OrchardCore": {
    "Media": {
      "Azure": {
        "ConnectionString": "BlobEndpoint=https://myaccount.blob.core.windows.net/;SharedAccessSignature=sv=...",
        "ContainerName": "media",
        "CreateContainer": false,
        "UseHierarchicalNamespace": true
      }
    }
  }
}

Tenant Templating

{
  "OrchardCore": {
    "Media": {
      "Azure": {
        "ConnectionString": "DefaultEndpointsProtocol=https;AccountName=myaccount;AccountKey=mykey;EndpointSuffix=core.windows.net",
        "ContainerName": "{{ ShellSettings.Name }}-media",
        "BasePath": "Media",
        "CreateContainer": true
      }
    }
  }
}

Single container with a folder per tenant:

{
  "OrchardCore": {
    "Media": {
      "Azure": {
        "ConnectionString": "DefaultEndpointsProtocol=https;AccountName=myaccount;AccountKey=mykey;EndpointSuffix=core.windows.net",
        "ContainerName": "sharedmedia",
        "BasePath": "{{ ShellSettings.Name }}/Media",
        "CreateContainer": true
      }
    }
  }
}

Media Cache

Azure Media Image Cache (`OrchardCore:Media:Azure:ImageCache`)

Stores resized images in Blob Storage (AzureBlobResizedImageCache, options

MediaBlobImageCacheOptions). Useful with ephemeral file systems (containers,

clean deployments) and throttled local disks (App Service).

| Property | Description | Default |

|---|---|---|

| ConnectionString | Storage account connection string (required). | |

| ContainerName | Cache container. Templatable. | |

| BasePath | Sub-path inside the container. Templatable. | |

| CreateContainer | Create the container if missing. | true |

| RemoveContainer | Delete the container when the tenant is removed. | false |

| RemoveFilesFromBasePath | Delete files under BasePath on tenant removal when RemoveContainer is false. | false |

{
  "OrchardCore": {
    "Media": {
      "Azure": {
        "ImageCache": {
          "ConnectionString": "DefaultEndpointsProtocol=https;AccountName=myaccount;AccountKey=mykey;EndpointSuffix=core.windows.net",
          "ContainerName": "imagecache",
          "BasePath": "{{ ShellSettings.Name }}",
          "CreateContainer": true,
          "RemoveContainer": false,
          "RemoveFilesFromBasePath": true
        }
      }
    }
  }
}

Resumable Uploads

When OrchardCore.Media.Tus is also enabled, TUS partial uploads are staged as

uncommitted blocks (AzureBlobTusTempStore) under a _tus-uploads prefix of

the media container, so any instance can continue an upload without a shared

temp folder. Without a valid Azure configuration, TUS keeps using the local

temp directory. See orchardcore-media-gallery for TUS, SignalR and

multi-instance guidance.

Upgrading from 3.x

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.