Hi, we are using AST Azure Media Sync in an Umbraco v7 environment. Due to bussiness needs we are running several websites in an Azure Cloud Project and the specific Umbraco website is being run as a VirtualApplication.
If we run the Umbraco website alone it works perfectly, however as a Virtual Application we cannot upload any images to our BlobStorage.it allways returns a 400 Bad Request Error.
Do you have any idea as to what might be causing this problem?
Thanks in advance, and we really appreciate the great work you did in this project.
System.dll!System.Net.ContextAwareResult.Complete(System.IntPtr userToken) Line 463C#
System.dll!System.Net.HttpWebRequest.ProcessResponse() Line 3672C#
System.dll!System.Net.HttpWebRequest.SetResponse(System.Net.CoreResponseData coreResponseData) Line 3613C#
System.dll!System.Net.ConnectionReturnResult.SetResponses(System.Net.ConnectionReturnResult returnResult) Line 181C#
System.dll!System.Net.Connection.ReadComplete(int bytesRead, System.Net.WebExceptionStatus errorStatus) Line 3452C#
System.dll!System.Net.Connection.ReadCallback(System.IAsyncResult asyncResult) Line 3089C#
System.dll!System.Net.LazyAsyncResult.Complete(System.IntPtr userToken) Line 415C#
System.dll!System.Net.Security._SslStream.ProcessFrameBody(int readBytes, byte[] buffer, int offset, int count, System.Net.AsyncProtocolRequest asyncRequest) Line 747C#
System.dll!System.Net.Security._SslStream.ReadFrameCallback(System.Net.AsyncProtocolRequest asyncRequest) Line 919C#
System.dll!System.Net.FixedSizeReader.CheckCompletionBeforeNextRead(int bytes) Line 125C#
System.dll!System.Net.FixedSizeReader.ReadCallback(System.IAsyncResult transportResult) Line 150C#
System.dll!System.Net.LazyAsyncResult.Complete(System.IntPtr userToken) Line 415C#
I have been testing with your source code and I believe that I have found the issue.
Basically when we use a virtual application on Azure, a folder is provided where that virtual application in run. That folder is not on the root of the website.
This was the problem as usually Umbraco is run on the root of the site.
To solve the issue I basically used the properties stripFromPathForContainer and stripFromPathForKey that you already defined on the class AzureFileStorage to remove the "c/" portion of the path.
It would be nice if we could provide this parameters on the <appSettings>
Issue with Azure VirtualApplication
Hi, we are using AST Azure Media Sync in an Umbraco v7 environment. Due to bussiness needs we are running several websites in an Azure Cloud Project and the specific Umbraco website is being run as a VirtualApplication.
If we run the Umbraco website alone it works perfectly, however as a Virtual Application we cannot upload any images to our BlobStorage.it allways returns a 400 Bad Request Error.
Do you have any idea as to what might be causing this problem?
Thanks in advance, and we really appreciate the great work you did in this project.
Hi Carlos
Could you please copy and paste the full Stack Trace so I can investigate it further?
Thanks for using my package.
Cheers
Ali
Hi, I apologise for the delay
When I activate break on "Common Language Runtime Exceptions" this is the first exception that I get:
With this call stack:
>mscorlib.dll!System.RuntimeType.CreateInstanceSlow(bool publicOnly, bool skipCheckThis, bool fillCache, ref System.Threading.StackCrawlMark stackMark)Unknown
mscorlib.dll!System.Activator.CreateInstance(System.Type type, bool nonPublic)Unknown
mscorlib.dll!System.Activator.CreateInstance(System.Type type)Unknown
Umbraco.Core.dll!Umbraco.Core.Models.DeepCloneHelper.DeepCloneRefProperties(Umbraco.Core.Models.IDeepCloneable input, Umbraco.Core.Models.IDeepCloneable output)Unknown
Umbraco.Core.dll!Umbraco.Core.Models.EntityBase.Entity.DeepClone()Unknown
Umbraco.Core.dll!Umbraco.Core.Persistence.Caching.RuntimeCacheProvider.GetById(System.Type type, System.Guid id)Unknown
Umbraco.Core.dll!Umbraco.Core.Persistence.Repositories.RepositoryBase<int,Umbraco.Core.Models.IDataTypeDefinition>.TryGetFromCache(int id)Unknown
Umbraco.Core.dll!Umbraco.Core.Persistence.Repositories.RepositoryBase<int,Umbraco.Core.Models.IDataTypeDefinition>.Get(int id)Unknown
Umbraco.Core.dll!Umbraco.Core.Services.DataTypeService.GetDataTypeDefinitionById(int id)Unknown
umbraco.dll!Umbraco.Web.Models.Mapping.ContentPropertyDtoConverter.ConvertCore(Umbraco.Core.Models.Property originalProperty)Unknown
AutoMapper.dll!AutoMapper.TypeConverter<Umbraco.Core.Models.Property,Umbraco.Web.Models.ContentEditing.ContentPropertyDto>.Convert(AutoMapper.ResolutionContext context)Unknown
AutoMapper.dll!AutoMapper.MappingExpression<Umbraco.Core.Models.Property,Umbraco.Web.Models.ContentEditing.ContentPropertyDto>.ConvertUsing.AnonymousMethod__14(AutoMapper.ResolutionContext context)Unknown
AutoMapper.dll!AutoMapper.Mappers.TypeMapObjectMapperRegistry.CustomMapperStrategy.Map(AutoMapper.ResolutionContext context, AutoMapper.IMappingEngineRunner mapper)Unknown
AutoMapper.dll!AutoMapper.Mappers.TypeMapMapper.Map(AutoMapper.ResolutionContext context, AutoMapper.IMappingEngineRunner mapper)Unknown
AutoMapper.dll!AutoMapper.MappingEngine.AutoMapper.IMappingEngineRunner.Map(AutoMapper.ResolutionContext context)Unknown
AutoMapper.dll!AutoMapper.Mappers.EnumerableMapperBase<System.Collections.IList>.Map(AutoMapper.ResolutionContext context, AutoMapper.IMappingEngineRunner mapper)Unknown
AutoMapper.dll!AutoMapper.MappingEngine.AutoMapper.IMappingEngineRunner.Map(AutoMapper.ResolutionContext context)Unknown
AutoMapper.dll!AutoMapper.Mappers.TypeMapObjectMapperRegistry.PropertyMapMappingStrategy.MapPropertyValue(AutoMapper.ResolutionContext context, AutoMapper.IMappingEngineRunner mapper, object mappedObject, AutoMapper.PropertyMap propertyMap)Unknown
AutoMapper.dll!AutoMapper.Mappers.TypeMapObjectMapperRegistry.PropertyMapMappingStrategy.Map(AutoMapper.ResolutionContext context, AutoMapper.IMappingEngineRunner mapper)Unknown
AutoMapper.dll!AutoMapper.Mappers.TypeMapMapper.Map(AutoMapper.ResolutionContext context, AutoMapper.IMappingEngineRunner mapper)Unknown
AutoMapper.dll!AutoMapper.MappingEngine.AutoMapper.IMappingEngineRunner.Map(AutoMapper.ResolutionContext context)Unknown
AutoMapper.dll!AutoMapper.MappingEngine.Map(object source, System.Type sourceType, System.Type destinationType, System.Action<AutoMapper.IMappingOperationOptions> opts)Unknown
AutoMapper.dll!AutoMapper.MappingEngine.Map<Umbraco.Core.Models.IMedia,Umbraco.Web.Models.ContentEditing.ContentItemDto<Umbraco.Core.Models.IMedia>>(Umbraco.Core.Models.IMedia source)Unknown
AutoMapper.dll!AutoMapper.Mapper.Map<Umbraco.Core.Models.IMedia,Umbraco.Web.Models.ContentEditing.ContentItemDto<Umbraco.Core.Models.IMedia>>(Umbraco.Core.Models.IMedia source)Unknown
umbraco.dll!Umbraco.Web.WebApi.Binders.MediaItemBinder.MapFromPersisted(Umbraco.Web.Models.ContentEditing.MediaItemSave model)Unknown
umbraco.dll!Umbraco.Web.WebApi.Binders.ContentItemBaseBinder<Umbraco.Core.Models.IMedia,Umbraco.Web.Models.ContentEditing.MediaItemSave>.GetModel()Unknown
mscorlib.dll!System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx)Unknown
mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx)Unknown
mscorlib.dll!System.Runtime.CompilerServices.AsyncMethodBuilderCore.MoveNextRunner.Run()Unknown
mscorlib.dll!System.Runtime.CompilerServices.AsyncMethodBuilderCore.OutputAsyncCausalityEvents<System.Runtime.CompilerServices.AsyncTaskMethodBuilder<System.__Canon>>.AnonymousMethod__0()Unknown
mscorlib.dll!System.Runtime.CompilerServices.TaskAwaiter.OutputWaitEtwEvents.AnonymousMethod__0()Unknown
mscorlib.dll!System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(System.Action action, bool allowInlining, ref System.Threading.Tasks.Task currentTask)Unknown
mscorlib.dll!System.Threading.Tasks.Task.FinishContinuations()Unknown
mscorlib.dll!System.Threading.Tasks.Task<System.__Canon>.TrySetResult(System.__Canon result)Unknown
mscorlib.dll!System.Threading.Tasks.TaskCompletionSource<System.__Canon>.TrySetResult(System.__Canon result)Unknown
System.Net.Http.Formatting.dll!System.Threading.Tasks.TaskHelpers.TrySetFromTask<System.Net.Http.MultipartFormDataStreamProvider>(System.Threading.Tasks.TaskCompletionSource<System.Net.Http.MultipartFormDataStreamProvider> tcs, System.Threading.Tasks.Task source)Unknown
System.Net.Http.Formatting.dll!System.Threading.Tasks.TaskHelpersExtensions.FinallyImplContinuation<System.Net.Http.MultipartFormDataStreamProvider>.AnonymousMethod__1c(System.Threading.Tasks.Task innerTask)Unknown
mscorlib.dll!System.Threading.Tasks.Task.Execute()Unknown
mscorlib.dll!System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx)Unknown
mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx)Unknown
mscorlib.dll!System.Threading.Tasks.Task.ExecuteWithThreadLocal(ref System.Threading.Tasks.Task currentTaskSlot)Unknown
mscorlib.dll!System.Threading.Tasks.Task.ExecuteEntry(bool bPreventDoubleExecution)Unknown
mscorlib.dll!System.Threading.Tasks.ThreadPoolTaskScheduler.TryExecuteTaskInline(System.Threading.Tasks.Task task, bool taskWasPreviouslyQueued)Unknown
mscorlib.dll!System.Threading.Tasks.TaskScheduler.TryRunInline(System.Threading.Tasks.Task task, bool taskWasPreviouslyQueued)Unknown
mscorlib.dll!System.Threading.Tasks.TaskContinuation.InlineIfPossibleOrElseQueue(System.Threading.Tasks.Task task, bool needsProtection)Unknown
mscorlib.dll!System.Threading.Tasks.Task.FinishContinuations()Unknown
mscorlib.dll!System.Threading.Tasks.Task<System.__Canon>.TrySetResult(System.__Canon result)Unknown
mscorlib.dll!System.Threading.Tasks.UnwrapPromise<System.Net.Http.MultipartFormDataStreamProvider>.TrySetFromTask(System.Threading.Tasks.Task task, bool lookForOce)Unknown
mscorlib.dll!System.Threading.Tasks.UnwrapPromise<System.__Canon>.ProcessInnerTask(System.Threading.Tasks.Task task)Unknown
mscorlib.dll!System.Threading.Tasks.UnwrapPromise<System.__Canon>.Invoke(System.Threading.Tasks.Task completingTask)Unknown
mscorlib.dll!System.Threading.Tasks.Task.FinishContinuations()Unknown
mscorlib.dll!System.Threading.Tasks.Task<System.__Canon>.TrySetResult(System.__Canon result)Unknown
mscorlib.dll!System.Threading.Tasks.TaskCompletionSource<System.__Canon>.TrySetResult(System.__Canon result)Unknown
System.Net.Http.Formatting.dll!System.Threading.Tasks.TaskHelpersExtensions.ThenImplContinuation<System.Net.Http.MultipartFormDataStreamProvider,System.Threading.Tasks.Task>.AnonymousMethod__43(System.Threading.Tasks.Task innerTask)Unknown
mscorlib.dll!System.Threading.Tasks.Task.Execute()Unknown
mscorlib.dll!System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx)Unknown
mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx)Unknown
mscorlib.dll!System.Threading.Tasks.Task.ExecuteWithThreadLocal(ref System.Threading.Tasks.Task currentTaskSlot)Unknown
mscorlib.dll!System.Threading.Tasks.Task.ExecuteEntry(bool bPreventDoubleExecution)Unknown
mscorlib.dll!System.Threading.ThreadPoolWorkQueue.Dispatch()Unknown
[Native to Managed Transition]
Only after this exception I receive the other exception:
System.Net.WebException occurred
_HResult=-2146233079
_message=The remote server returned an error: (400) Bad Request.
HResult=-2146233079
IsTransient=false
Message=The remote server returned an error: (400) Bad Request.
Source=System
StackTrace:
at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
InnerException:
Hi,
I have been testing with your source code and I believe that I have found the issue.
Basically when we use a virtual application on Azure, a folder is provided where that virtual application in run. That folder is not on the root of the website.
This was the problem as usually Umbraco is run on the root of the site.
With this configuration:
Umbraco is no longer accessed like this
but like this
To solve the issue I basically used the properties stripFromPathForContainer and stripFromPathForKey that you already defined on the class AzureFileStorage to remove the "c/" portion of the path.
It would be nice if we could provide this parameters on the <appSettings>
Thanks for the help.
is working on a reply...