Sitecore Blob Storage Authentication Errors

If you’re using the Sitecore Blob Storage module and planning an upgrade to Sitecore 10.4, you may encounter an issue similar to this one. We recently started setting up a new Sitecore 10.4 environment, and didn’t encounter many issues until we went to install the blob storage module to get media storage back online. Once we setup the module and migrated the blob/media content from our old blob storage account to the new one, we started experiencing the error below.

Exception Details: Microsoft.Azure.Storage.StorageException: Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.

Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:
[StorageException: Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.]
Microsoft.Azure.Storage.Core.Executor.<ExecuteAsync>d__1`1.MoveNext() +1280
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() +32
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +62
Microsoft.Azure.Storage.Core.Executor.<>c__DisplayClass0_0`1.<ExecuteSync>b__0() +64
Microsoft.Azure.Storage.Core.Util.CommonUtility.RunWithoutSynchronizationContext(Func`1 actionToRun) +49
Microsoft.Azure.Storage.Core.Executor.Executor.ExecuteSync(RESTCommand`1 cmd, IRetryPolicy policy, OperationContext operationContext) +181
Sitecore.Framework.Data.Blobs.Azure.<>c__DisplayClass24_0.<BlobExists>b__0() +102

When I went searching for any info about this error online, I couldn’t find much guidance. Most posts indicated that something could be wrong with the Shared Access Signature included in the request, but we were using an access key with full read and write permissions for the storage container. We created a ticket with Sitecore, and received a response back that this was a known bug with reference number 528436. The root cause of the error we were experiencing was an old version of Microsoft.ApplicationInsights.dll that was included in the Sitecore installation when the environment was provisioned.

As far as remediating the issue, Sitecore recommended a couple of options:

  1. Disable the “dependency” telemetry events by commenting out the dependency tracking in ApplicationInsights.config
<Add Type="Microsoft.ApplicationInsights.DependencyCollector.DependencyTrackingTelemetryModule, Microsoft.AI.DependencyCollector"/>
  1. If removing the dependency tracking is not acceptable, you can instead update ApplicationInsights to version 2.7.1 on both the ContentManagement and ContentDelivery services. This would also require binding redirects in your web.config.
<dependentAssembly>
<assemblyIdentity name="Microsoft.ApplicationInsights" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.7.1.0" newVersion="2.7.1.0" />
</dependentAssembly>

<dependentAssembly>
<assemblyIdentity name="System.Diagnostics.DiagnosticSource" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
</dependentAssembly>

We opted to just disable the dependency telemetry for now, as we weren’t currently making much use of those telemetry events in our current Sitecore solution. As soon as we made that change, all of our media was visible, and the Sitecore media library was functional again.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *