Uyen Nguyen Team : Senior Developer

Migrate Umbraco Images from File System Provider to Azure Blob Provider

Uyen Nguyen Team : Senior Developer

If you're looking for a way to migrate images in Umbraco from File system to Azure blob, then this blog will show you step by step how to do so.

  • Step 2: Create Azure blob container
    Log into In the Dashboard, select the storage account. Select Blob service and create a container you need.

  • Step 3: Configure FileSystemProviders section in Web.config, and related configs for different environment
        <Provider alias="media" type=",">
            <add key="containerName" value="media" />
            <add key="rootUrl" value="[yourAzureAccountName]" />
            <add key="connectionString" value="DefaultEndpointsProtocol=https;AccountName=[yourAzureAccountName];AccountKey=[yourAzureAccountKey]"/>
            <add key="mimetypes" value="" />
            <add key="cacheControl" value="*|public, max-age=31536000;js|no-cache" />
    In the configuration above, value=" media " should match with the name of your Azure blob container and for connection string, the information can be found in Azure Portal.

After step 3, you should be able to upload new images to Umbraco and once they’re saved, you'll find these images uploaded to the Azure blob container you configured above. The following steps will show you how to upload existing images and how to update references of the existing images in Umbraco.

  • Step 4: Install CloudBerry to upload existing images
    Download the media folder from your production site to your local machine. Install CloudBerry Explorer: on your local machine to upload all the current images in production to Azure blob.

  • Step 5: Update images references in Umbraco to point to Azure blob container
    update cmsPropertyData 
    set dataNvarchar = cast(replace(cast(dataNvarchar as nvarchar(max)), '/media/', 'http://[yourAzureAccount]') as nvarchar(max)) 
    where dataNvarchar like '%/media/%' 
    update cmsPropertyData 
    set dataNtext = cast(replace(cast(dataNtext as nvarchar(max)), '/media/', 'http://[yourAzureAccount]') as nvarchar(max)) 
    where dataNtext like '%/media/%' 
    update cmsContentXml 
    set xml = cast(replace(cast(xml as nvarchar(max)), '/media/', 'http://[yourAzureAccount]') as ntext) 
    where xml like '<Image%' or xml like '<File%'