Migrating to Azure Storage Accounts (media blob - image - not displayed in browser)


Good Afternoon

I am currently researching into migrating the EPiServer 11.10.1 media blobs from a Windows DFS Share to an Azure Storage Account.

The configuration tried is as follows:

web.config (Note: only relevant sections are shown)

<assemblyIdentity name="EPiServer.Azure" publicKeyToken="8fe83dea738b45b7" culture="neutral" />
<bindingRedirect oldVersion="" newVersion="" />

<episerver.framework updateDatabaseSchema="false">
<clientResources debug="false" />
<appData basePath="" />
<scanAssembly forceBinFolderScan="true" />

<blob defaultProvider="azureblobs">
<add name="azureblobs" type="EPiServer.Azure.Blobs.AzureBlobProvider,EPiServer.Azure" connectionStringName="EPiServerAzureBlobs" container="mycontainer"/>

connectionStrings.config (Note: only relevant sections are shown)

<clear />
<add name="EPiServerAzureBlobs" connectionString="DefaultEndpointsProtocol=https;AccountName=storage00001;AccountKey=NuJBkcpuCbPKH+lcw65OwELkJ1nptJ7CY2Hn4MqNwqwL4WY4C3caSSSJYgH91J6MH9qZPPOOSbAzFZrNk8eIHt6PA==" />

When starting the site, the following error is shown in the logs:

(Note: only relevant sections are shown)

2019-02-19 13:12:37,236 [1] [(null)] DEBUG EPiServer.Framework.Initialization.InitializationEngine: InitializationState: transition from 'InitializeComplete' to 'Initialized'.
2019-02-19 13:12:41,875 [94] [94a2e50f-06c6-4ddc-a6f7-2d1c43b0735d] ERROR EPiServer.Global: Unhandled exception in ASP.NET
Microsoft.WindowsAzure.Storage.StorageException: The remote server returned an error: (404) Not Found. ---> System.Net.WebException: The remote server returned an error: (404) Not Found.
at System.Net.HttpWebRequest.GetResponse()
at Microsoft.WindowsAzure.Storage.Core.Executor.Executor.ExecuteSync[T](RESTCommand`1 cmd, IRetryPolicy policy, OperationContext operationContext) in \release_dotnet_master\Lib\ClassLibraryCommon\Core\Executor\Executor.cs:line 677
--- End of inner exception stack trace ---
at Microsoft.WindowsAzure.Storage.Core.Executor.Executor.ExecuteSync[T](RESTCommand`1 cmd, IRetryPolicy policy, OperationContext operationContext) in \release_dotnet_master\Lib\ClassLibraryCommon\Core\Executor\Executor.cs:line 604
at Microsoft.WindowsAzure.Storage.Blob.CloudBlob.OpenRead(AccessCondition accessCondition, BlobRequestOptions options, OperationContext operationContext) in \release_dotnet_master\Lib\ClassLibraryCommon\Blob\CloudBlob.cs:line 51
at EPiServer.Web.BlobHttpHandler.ProcessRequestAsyncInternal(HttpContextWrapper context, AsyncCallback cb, Object extraData)
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step)
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
Request Information
RequestDate:Tue, 19 Feb 2019 13:12:41 GMT
StatusMessage:The specified blob does not exist.

I have reviewed this page (https://world.episerver.com/documentation/upgrading/episerver-commerce/8/upgrading-and-deploying-commerce-to-azure) on this site but I am unable to see an error which would be causing the media blob (image) not to be displayed.

The following has been tried already but to no avail:

Permissions: Azure Storage Account - Blobs - Contain (anonymous read access for containers and blobs)
Permissions: The media blob (images) are accessible in a browser independent of the EpiServer platform
Microsoft Support has confirmed there are no known issues affecting the Storage Account
If this makes a difference, EpiServer itself is running on a dedicated VM (IaaS) and using Azure SQL for databases.

Does <appData basePath="" /> need to contain a value to work with an Azure Storage Account?

Any suggestions on what might be (or what I am doing) wrong are welcome.

Thank you.

Edited, Feb 19, 2019 17:37

Good evening George,

You shouldn't need to enter a path for blobs in appData basepath.  that is for local storage only.  As for azure storage, we use it for vm's laas as well as paas.  Both work just fine.  So the permissions for the blobs container is private.  The access key should be all you need for this.  

So in all my settings it is as follows.

this is my setup for VM but exactly the same for PAAS(Web app)

    <blob defaultProvider="azureblobs">
        <add name="azureblobs" type="EPiServer.Azure.Blobs.AzureBlobProvider,EPiServer.Azure" connectionStringName="EPiServerAzureBlobs" container="webassets" />

the connectionstring

    <add name="EPiServerAzureBlobs" connectionString="DefaultEndpointsProtocol=https;AccountName=MYACCOUNTNAME;AccountKey=MYACCOUNTKEY;EndpointSuffix=core.windows.net" />

here is what my blob containers look like
Hope this helps

Feb 22, 2019 3:02

Your EPiServer deployment appears similar to mine. We are using PaaS (CosmoDB), DbaaS (Azure SQL) and IaaS too.

I will try duplicating your settings in my test environment and report back. Thank you.

Feb 22, 2019 10:41

Please do.  Curious why it wouldn't connect.  Make sure you have EPiServer.Azure packages install which it looks like you do.  I have a sneaky suspicion it is security on your container.

Feb 22, 2019 14:44

It started working when I added the following to the EPiServerAzureBlobs connection in the connectionStrings.config file:


Thanks, Joshua!

Feb 22, 2019 14:50

On a slightly related note, where do you store your logs and shared files? I am considering using Azure Files but is there is a better solution?

Feb 22, 2019 14:51

When i comes to logs, i normally store those in application insights.  I have also stored them one level back in a logs folder but not sure if you can do that in DXC.  Application insights works best for our solutions but not sure your situation or setup.  From shared files, i haven't setup any site with a shared file repo but i would image a cdn or something along those lines might solve your situation.

Feb 22, 2019 15:16

Thank you. That is useful information.

Feb 22, 2019 15:17
Feb 22, 2019 16:19

Hi Ram!

I did use your guide (thanks!) but I needed to add the following to the connection string:



Feb 22, 2019 16:27
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.