将 EPiserver 媒体 blob 迁移到 Azure 存储帐户

Migrating EPiserver media blobs to Azure Storage Account

我目前正在研究将 EPiServer 11.10.1 媒体 blob 从 Windows DFS 共享迁移到 Azure 存储帐户。

试过的配置如下:

web.config(注:只显示相关部分)

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

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

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

connectionStrings.config(注:只显示相关部分)

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

启动站点时,日志中显示以下错误:

(注:只显示相关部分)

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()
Request Information
RequestID:5e731c27-d01e-00cc-4254
RequestDate:Tue, 19 Feb 2019 13:12:41 GMT
StatusMessage:The specified blob does not exist.

我看不到会导致媒体 blob(图像)不显示的错误。

以下已尝试但无济于事:

如果这有所作为,EpiServer 本身 运行 在专用 VM (IaaS) 上并使用 Azure SQL 作为数据库。

欢迎提出任何可能(或我正在做的)错误的建议。

谢谢。

404 是因为您在没有迁移实际 blob 的情况下更改了 blob 提供程序。因此,当请求现有的 blob(在 Episerver 数据库中引用)时,它不再被找到。

您可能还对这里提到的 blob 转换器包感兴趣:How to move blobs from App_Data folder of episerver cms site to azure blob storage hosted in azure cloud

感谢您提出的答案,泰德,但解决方案更直接。我在 EPiServer 官方论坛发了一个类似的问题:

https://world.episerver.com/forum/developer-forum/-Episerver-75-CMS/Thread-Container/2019/2/migrating-to-azure-storage-accounts-media-blob---image---not-displayed-in-browser/

只需将后缀添加到连接字符串即可:

;EndpointSuffix=core.windows.net

但是,我确实在研究过程中阅读了与您回答的内容类似的建议,因此我认为这对用户使用谷歌搜索类似的问题以便为您的回答投赞成票是有益的。