這些圖像可以在本地ENV中加載,也可以在生產ENV中加載。但是,無論如何,暫存環境無法加載這些內容。ImageProcessor/Windows Azure存儲問題,返回403 Forbidden
<package id="ImageProcessor" version="2.2.0.0" targetFramework="net45" />
<package id="ImageProcessor.Web" version="4.2.1.0" targetFramework="net45" />
<package id="ImageProcessor.Web.Config" version="2.2.0.0" targetFramework="net45" />
<package id="ImageProcessor.Web.Plugins.AzureBlobCache" version="1.0.0.0" targetFramework="net45" />
<package id="ImageProcessor.Web.PostProcessor" version="1.0.2.0" targetFramework="net45" />
<package id="UmbracoAzureBlobStorageProvider" version="1.0.10.5" targetFramework="net45" />
<package id="WindowsAzure.Storage" version="4.3.0" targetFramework="net45" />
我使用ImageProcessor並根據需要域列入白名單:
<whitelist>
<add url="http://conceptjp.blob.core.windows.net/"/>
<add url="https://az739977.vo.msecnd.net/"/>
</whitelist>
https://cjp.local/remote.axd?https://az739977.vo.msecnd.net/media/6883/logo-sparitual.png?quality=70(工程,當地環境)
2016-10-04 13:31:11.2393 Logging.TheLogger The remote server returned an error: (403) Forbidden. The remote server returned an error: (403) Forbidden. at Microsoft.WindowsAzure.Storage.Core.Executor.Executor.EndExecuteAsync[T](IAsyncResult result)
at Microsoft.WindowsAzure.Storage.Core.Util.AsyncExtensions.<>c__DisplayClass1`1.<CreateCallback>b__0(IAsyncResult ar)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at ImageProcessor.Web.Plugins.AzureBlobCache.AzureBlobCache.<IsNewOrUpdatedAsync>d__2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at ImageProcessor.Web.HttpModules.ImageProcessingModule.<ProcessImageAsync>d__10.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.TaskAsyncHelper.EndTask(IAsyncResult ar)
at System.Web.HttpApplication.AsyncEventExecutionStep.OnAsyncEventCompletion(IAsyncResult ar)
答案是將服務器上的時鐘設置爲UTC。 http://stackoverflow.com/questions/22828279/403-error-in-production-from-windowsazure-storage –