Virto Commerce Azure Deployment connection attempt failed - azure

I'm trying to deploy a custom version of VirtoCommerce to the Azure cloud and I'm having some trouble with it.
When I try to load the website i run into a
Server Error in '/' Application.
A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond <ip>:9200
These are the last few lines of the SchedulerConsole log
[03/16/2015 17:45:23 > 62130d: INFO] VirtoCommerce.ScheduleService.Trace Error: 0 : VirtoCommerce.Scheduling.Jobs.GenerateSearchIndexWork#3e32cbe9-b912-4901-bedb-7604a4ab0616 Trace VirtoCommerce.Search.Providers.Elastic.ElasticSearchException: Failed to remove indexes. URL:xpmarket-search.cloudapp.net:9200 ---> PlainElastic.Net.OperationException: Unable to connect to the remote server ---> System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 137.117.213.124:9200
[03/16/2015 17:45:23 > 62130d: INFO] at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
[03/16/2015 17:45:23 > 62130d: INFO] at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Exception& exception)
[03/16/2015 17:45:23 > 62130d: INFO] --- End of inner exception stack trace ---
[03/16/2015 17:45:23 > 62130d: INFO] at System.Net.HttpWebRequest.GetResponse()
[03/16/2015 17:45:23 > 62130d: INFO] at PlainElastic.Net.ElasticConnection.ExecuteRequest(String method, String command, String jsonData)
[03/16/2015 17:45:23 > 62130d: INFO] --- End of inner exception stack trace ---
[03/16/2015 17:45:23 > 62130d: INFO] at PlainElastic.Net.ElasticConnection.ExecuteRequest(String method, String command, String jsonData)
[03/16/2015 17:45:23 > 62130d: INFO] at PlainElastic.Net.ElasticConnection.Delete(String command, String jsonData)
[03/16/2015 17:45:23 > 62130d: INFO] at VirtoCommerce.Search.Providers.Elastic.ElasticClient`1.Delete(DeleteCommand deleteCommand) in c:\Users\Tiago\Documents\xpmarketplace\src\Extensions\Search\ElasticSearchProvider\ElasticClient.cs:line 129
[03/16/2015 17:45:23 > 62130d: INFO] at VirtoCommerce.Search.Providers.Elastic.ElasticSearchProvider.RemoveAll(String scope, String documentType) in c:\Users\Tiago\Documents\xpmarketplace\src\Extensions\Search\ElasticSearchProvider\ElasticSearchProvider.cs:line 477
[03/16/2015 17:45:23 > 62130d: INFO] --- End of inner exception stack trace ---
[03/16/2015 17:45:23 > 62130d: INFO] at VirtoCommerce.Search.Providers.Elastic.ElasticSearchProvider.ThrowException(String message, Exception innerException) in c:\Users\Tiago\Documents\xpmarketplace\src\Extensions\Search\ElasticSearchProvider\ElasticSearchProvider.cs:line 562
[03/16/2015 17:45:23 > 62130d: INFO] at VirtoCommerce.Search.Providers.Elastic.ElasticSearchProvider.RemoveAll(String scope, String documentType) in c:\Users\Tiago\Documents\xpmarketplace\src\Extensions\Search\ElasticSearchProvider\ElasticSearchProvider.cs:line 490
[03/16/2015 17:45:23 > 62130d: INFO] at VirtoCommerce.Foundation.Search.SearchIndexController.Prepare(String scope, String documentType, Boolean rebuild) in c:\Users\Tiago\Documents\xpmarketplace\src\Core\CommerceFoundation\Search\SearchIndexController.cs:line 91
[03/16/2015 17:45:23 > 62130d: INFO] at VirtoCommerce.Scheduling.Jobs.GenerateSearchIndexWork.Execute(IJobContext context) in c:\Users\Tiago\Documents\xpmarketplace\src\Extensions\Jobs\VirtoCommerceJobs\GenerateSearchIndexWork.cs:line 17
[03/16/2015 17:45:23 > 62130d: INFO] at VirtoCommerce.Scheduling.JobActivityTool.ControlledExecution(IJobActivity activity, TraceContext traceContext, Action`1 audit, IDictionary`2 parameters) in c:\Users\Tiago\Documents\xpmarketplace\src\Extensions\Jobs\SchedulingLib\JobActivityTool.cs:line 32
[03/16/2015 17:45:23 > 62130d: INFO] VirtoCommerce.ScheduleService.Trace Stop: 0 : VirtoCommerce.Scheduling.Jobs.GenerateSearchIndexWork#3e32cbe9-b912-4901-bedb-7604a4ab0616 Finished with Error! Duration=0m. 21s. 66
[03/16/2015 17:45:27 > 62130d: INFO] VirtoCommerce.ScheduleService.Trace Verbose: 0 : TRACE|3/16/2015 5:45:27 PM|JobScheduler|SchedulerProcess-ApartmentIteration|||Iterating 5 Jobs

Looks like your Elastic Search Server is not running, can't open "137.117.213.124:9200". Which version of VC are you trying to deploy?
We had a small issue with not enough space allocated by default when elastic search was created. Here is the fix: https://github.com/VirtoCommerce/vc-community/commit/213de23cc023cc8da8983daba188d08c2de3c2a6
Basically make sue that size is set to the new value and redeploy elastic search.

Related

Publish Angular-CLI 6 ASP.Core application to Azure

First of All here some Info
Project Angular-CLI ASP.Net Core 2.1
Publish from Visual Studio to Azure WebService
So what i have tried.
I have a running SPA in visual studio it runs fine without any error or warning.
Now i want to publish it to Azure over the build in publish via Visual Studio.
The publish Job show every thing is ok, then i go to the site where it should be hosted.
Now i get the following error:
so there is no complete error message why it was crashed i have found some logfile of the starting of the application:
2018-07-10 16:55:17.799 +00:00 [Information] Starting web host
2018-07-10 16:55:20.691 +00:00 [Information] Azure Web Sites environment detected. Using '"D:\home\ASP.NET\DataProtection-Keys"' as key repository; keys will not be encrypted at rest.
2018-07-10 16:55:22.456 +00:00 [Information] Starting #angular/cli on port 50808...
2018-07-10 16:55:25.208 +00:00 [Error] npm ERR! Error: ENOENT, open 'D:\home\site\wwwroot\ClientApp\dist\node_modules\start\package.json'
2018-07-10 16:55:25.716 +00:00 [Information] Request starting HTTP/1.1 GET http://localhost/
2018-07-10 16:55:28.285 +00:00 [Warning] Failed to determine the https port for redirect.
2018-07-10 16:55:28.301 +00:00 [Error] npm ERR! { [Error: ENOENT, open 'D:\home\site\wwwroot\ClientApp\dist\node_modules\start\package.json']
2018-07-10 16:55:28.575 +00:00 [Error] An unhandled exception has occurred while executing the request.
System.AggregateException: One or more errors occurred. (One or more errors occurred. (The NPM script 'start' exited without indicating that the Angular CLI was listening for requests. The error output was: )) ---> System.AggregateException: One or more errors occurred. (The NPM script 'start' exited without indicating that the Angular CLI was listening for requests. The error output was: ) ---> System.InvalidOperationException: The NPM script 'start' exited without indicating that the Angular CLI was listening for requests. The error output was: ---> System.IO.EndOfStreamException: Attempted to read past the end of the stream.
at Microsoft.AspNetCore.SpaServices.AngularCli.AngularCliMiddleware.StartAngularCliServerAsync(String sourcePath, String npmScriptName, ILogger logger)
--- End of inner exception stack trace ---
at Microsoft.AspNetCore.SpaServices.AngularCli.AngularCliMiddleware.StartAngularCliServerAsync(String sourcePath, String npmScriptName, ILogger logger)
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task1.GetResultCore(Boolean waitCompletionNotification)
at System.Threading.Tasks.Task1.get_Result()
at Microsoft.AspNetCore.SpaServices.AngularCli.AngularCliMiddleware.<>c.b__2_0(Task1 task)
at System.Threading.Tasks.ContinuationResultTaskFromResultTask2.InnerInvoke()
at System.Threading.Tasks.Task.<>c.<.cctor>b__278_1(Object obj)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location where exception was thrown ---
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot)
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task1.GetResultCore(Boolean waitCompletionNotification)
at System.Threading.Tasks.Task1.get_Result()
at Microsoft.AspNetCore.SpaServices.Extensions.Util.TaskTimeoutExtensions.WithTimeout[T](Task1 task, TimeSpan timeoutDelay, String message)
at Microsoft.AspNetCore.SpaServices.Extensions.Proxy.SpaProxy.PerformProxyRequest(HttpContext context, HttpClient httpClient, Task1 baseUriTask, CancellationToken applicationStoppingToken, Boolean proxy404s)
at Microsoft.AspNetCore.Builder.SpaProxyingExtensions.<>c__DisplayClass2_0.<b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.AspNetCore.Builder.RouterMiddleware.Invoke(HttpContext httpContext)
at Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)
---> (Inner Exception #0) System.AggregateException: One or more errors occurred. (The NPM script 'start' exited without indicating that the Angular CLI was listening for requests. The error output was: ) ---> System.InvalidOperationException: The NPM script 'start' exited without indicating that the Angular CLI was listening for requests. The error output was: ---> System.IO.EndOfStreamException: Attempted to read past the end of the stream.
at Microsoft.AspNetCore.SpaServices.AngularCli.AngularCliMiddleware.StartAngularCliServerAsync(String sourcePath, String npmScriptName, ILogger logger)
--- End of inner exception stack trace ---
at Microsoft.AspNetCore.SpaServices.AngularCli.AngularCliMiddleware.StartAngularCliServerAsync(String sourcePath, String npmScriptName, ILogger logger)
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task1.GetResultCore(Boolean waitCompletionNotification)
at System.Threading.Tasks.Task1.get_Result()
at Microsoft.AspNetCore.SpaServices.AngularCli.AngularCliMiddleware.<>c.b__2_0(Task1 task)
at System.Threading.Tasks.ContinuationResultTaskFromResultTask2.InnerInvoke()
at System.Threading.Tasks.Task.<>c.<.cctor>b__278_1(Object obj)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location where exception was thrown ---
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot)
---> (Inner Exception #0) System.InvalidOperationException: The NPM script 'start' exited without indicating that the Angular CLI was listening for requests. The error output was: ---> System.IO.EndOfStreamException: Attempted to read past the end of the stream.
at Microsoft.AspNetCore.SpaServices.AngularCli.AngularCliMiddleware.StartAngularCliServerAsync(String sourcePath, String npmScriptName, ILogger logger)
--- End of inner exception stack trace ---
at Microsoft.AspNetCore.SpaServices.AngularCli.AngularCliMiddleware.StartAngularCliServerAsync(String sourcePath, String npmScriptName, ILogger logger)<---
<---
2018-07-10 16:55:28.974 +00:00 [Information] Request finished in 3267.6338ms 500 text/html; charset=utf-8
2018-07-10 16:55:41.654 +00:00 [Information] Request starting HTTP/1.1 GET http://xircuitportal-beta.azurewebsites.net/
2018-07-10 16:55:41.790 +00:00 [Error] An unhandled exception has occurred while executing the request.
System.AggregateException: One or more errors occurred. (One or more errors occurred. (The NPM script 'start' exited without indicating that the Angular CLI was listening for requests. The error output was: )) ---> System.AggregateException: One or more errors occurred. (The NPM script 'start' exited without indicating that the Angular CLI was listening for requests. The error output was: ) ---> System.InvalidOperationException: The NPM script 'start' exited without indicating that the Angular CLI was listening for requests. The error output was: ---> System.IO.EndOfStreamException: Attempted to read past the end of the stream.
at Microsoft.AspNetCore.SpaServices.AngularCli.AngularCliMiddleware.StartAngularCliServerAsync(String sourcePath, String npmScriptName, ILogger logger)
--- End of inner exception stack trace ---
at Microsoft.AspNetCore.SpaServices.AngularCli.AngularCliMiddleware.StartAngularCliServerAsync(String sourcePath, String npmScriptName, ILogger logger)
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task1.GetResultCore(Boolean waitCompletionNotification)
at System.Threading.Tasks.Task1.get_Result()
at Microsoft.AspNetCore.SpaServices.AngularCli.AngularCliMiddleware.<>c.b__2_0(Task1 task)
at System.Threading.Tasks.ContinuationResultTaskFromResultTask2.InnerInvoke()
at System.Threading.Tasks.Task.<>c.<.cctor>b__278_1(Object obj)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location where exception was thrown ---
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot)
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task1.GetResultCore(Boolean waitCompletionNotification)
at System.Threading.Tasks.Task1.get_Result()
at Microsoft.AspNetCore.SpaServices.Extensions.Util.TaskTimeoutExtensions.WithTimeout[T](Task1 task, TimeSpan timeoutDelay, String message)
at Microsoft.AspNetCore.SpaServices.Extensions.Proxy.SpaProxy.PerformProxyRequest(HttpContext context, HttpClient httpClient, Task1 baseUriTask, CancellationToken applicationStoppingToken, Boolean proxy404s)
at Microsoft.AspNetCore.Builder.SpaProxyingExtensions.<>c__DisplayClass2_0.<b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.AspNetCore.Builder.RouterMiddleware.Invoke(HttpContext httpContext)
at Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)
---> (Inner Exception #0) System.AggregateException: One or more errors occurred. (The NPM script 'start' exited without indicating that the Angular CLI was listening for requests. The error output was: ) ---> System.InvalidOperationException: The NPM script 'start' exited without indicating that the Angular CLI was listening for requests. The error output was: ---> System.IO.EndOfStreamException: Attempted to read past the end of the stream.
at Microsoft.AspNetCore.SpaServices.AngularCli.AngularCliMiddleware.StartAngularCliServerAsync(String sourcePath, String npmScriptName, ILogger logger)
--- End of inner exception stack trace ---
at Microsoft.AspNetCore.SpaServices.AngularCli.AngularCliMiddleware.StartAngularCliServerAsync(String sourcePath, String npmScriptName, ILogger logger)
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task1.GetResultCore(Boolean waitCompletionNotification)
at System.Threading.Tasks.Task1.get_Result()
at Microsoft.AspNetCore.SpaServices.AngularCli.AngularCliMiddleware.<>c.b__2_0(Task1 task)
at System.Threading.Tasks.ContinuationResultTaskFromResultTask2.InnerInvoke()
at System.Threading.Tasks.Task.<>c.<.cctor>b__278_1(Object obj)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location where exception was thrown ---
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot)
---> (Inner Exception #0) System.InvalidOperationException: The NPM script 'start' exited without indicating that the Angular CLI was listening for requests. The error output was: ---> System.IO.EndOfStreamException: Attempted to read past the end of the stream.
at Microsoft.AspNetCore.SpaServices.AngularCli.AngularCliMiddleware.StartAngularCliServerAsync(String sourcePath, String npmScriptName, ILogger logger)
--- End of inner exception stack trace ---
at Microsoft.AspNetCore.SpaServices.AngularCli.AngularCliMiddleware.StartAngularCliServerAsync(String sourcePath, String npmScriptName, ILogger logger)<---
<---
2018-07-10 16:55:42.383 +00:00 [Information] Request finished in 728.6751ms 500 text/html; charset=utf-8
The sort of the log: it says that he tried to find the file D:\home\site\wwwroot\ClientApp\dist\node_modules\start\package.json
But the folder doesnt exsist and the package.json is in the ClientApp\dist folder.
All my configuration says that the output of the build is going to ClientApp\dist
So what configureation must i set, that the angular app is running in azure
Here my package.json (the start)
{
"name": "ClientApp",
"version": "0.1.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
"serve": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"run": "ng build",
"e2e": "ng e2e"
},
[...]
}
when your need more info of one file or config write it in the comment i provide it than.
I think you need something like:
services.AddSpaStaticFiles(configuration =>
{
configuration.RootPath = "ClientApp/dist";
});

Azure WebJobs FunctionIndexingException with Microsoft.WindowsAzure.Storage.StorageException 403 Forbidden

When I try to run my WebJob, I get the following failure:
[07/12/2018 18:09:21 > 7351a7: ERR ] Unhandled Exception: Microsoft.Azure.WebJobs.Host.Indexers.FunctionIndexingException: Error indexing method 'Foo.Bar' ---> System.InvalidOperationException: Invalid storage account 'storage'. Please make sure your credentials are correct. ---> Microsoft.WindowsAzure.Storage.StorageException: The remote server returned an error: (403) Forbidden. ---> System.Net.WebException: The remote server returned an error: (403) Forbidden.
[07/12/2018 18:09:21 > 7351a7: ERR ] at Microsoft.WindowsAzure.Storage.Shared.Protocol.HttpResponseParsers.ProcessExpectedStatusCodeNoException[T](HttpStatusCode expectedStatusCode, HttpStatusCode actualStatusCode, T retVal, StorageCommandBase`1 cmd, Exception ex)
[07/12/2018 18:09:21 > 7351a7: ERR ] at Microsoft.WindowsAzure.Storage.Blob.CloudBlobClient.b__19(RESTCommand`1 cmd, HttpWebResponse resp, Exception ex, OperationContext ctx)
[07/12/2018 18:09:21 > 7351a7: ERR ] at Microsoft.WindowsAzure.Storage.Core.Executor.Executor.EndGetResponse[T](IAsyncResult getResponseResult)
[07/12/2018 18:09:21 > 7351a7: ERR ] --- End of inner exception stack trace ---
[07/12/2018 18:09:21 > 7351a7: ERR ] at Microsoft.WindowsAzure.Storage.Core.Executor.Executor.EndExecuteAsync[T](IAsyncResult result)
[07/12/2018 18:09:21 > 7351a7: ERR ] at Microsoft.WindowsAzure.Storage.Core.Util.AsyncExtensions.c__DisplayClass2`1.b__0(IAsyncResult ar)
[07/12/2018 18:09:21 > 7351a7: ERR ] --- End of stack trace from previous location where exception was thrown ---
[07/12/2018 18:09:21 > 7351a7: ERR ] at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
[07/12/2018 18:09:21 > 7351a7: ERR ] at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
[07/12/2018 18:09:21 > 7351a7: ERR ] at Microsoft.Azure.WebJobs.Host.Executors.DefaultStorageCredentialsValidator.d__1.MoveNext()
[07/12/2018 18:09:21 > 7351a7: ERR ] --- End of inner exception stack trace ---
[07/12/2018 18:09:21 > 7351a7: ERR ] at Microsoft.Azure.WebJobs.Host.Executors.DefaultStorageCredentialsValidator.d__1.MoveNext()
[07/12/2018 18:09:21 > 7351a7: ERR ] --- End of stack trace from previous location where exception was thrown ---
[07/12/2018 18:09:21 > 7351a7: ERR ] at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
[07/12/2018 18:09:21 > 7351a7: ERR ] at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
[07/12/2018 18:09:21 > 7351a7: ERR ] at Microsoft.Azure.WebJobs.Host.Executors.DefaultStorageCredentialsValidator.d__0.MoveNext()
[07/12/2018 18:09:21 > 7351a7: ERR ] --- End of stack trace from previous location where exception was thrown ---
[07/12/2018 18:09:21 > 7351a7: ERR ] at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
[07/12/2018 18:09:21 > 7351a7: ERR ] at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
[07/12/2018 18:09:21 > 7351a7: ERR ] at Microsoft.Azure.WebJobs.Host.Executors.DefaultStorageAccountProvider.d__24.MoveNext()
[07/12/2018 18:09:21 > 7351a7: ERR ] --- End of stack trace from previous location where exception was thrown ---
[07/12/2018 18:09:21 > 7351a7: ERR ] at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
[07/12/2018 18:09:21 > 7351a7: ERR ] at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
[07/12/2018 18:09:21 > 7351a7: WARN] Reached maximum allowed output lines for this run, to see all of the job's logs you can enable website application diagnostics
[07/12/2018 18:09:21 > 7351a7: SYS ERR ] Job failed due to exit code -532462766
[07/12/2018 18:09:21 > 7351a7: SYS INFO] Process went down, waiting for 60 seconds
I have 100% validated that my storage account credentials are correct.
When I attempt to manually connect to the storage account and invoke CreateifNotExist, I get:
[07/12/2018 18:11:46 > 7351a7: INFO] Microsoft.WindowsAzure.Storage.StorageException: The remote server returned an error: (403) Forbidden. ---> System.Net.WebException: The remote server returned an error: (403) Forbidden.
[07/12/2018 18:11:46 > 7351a7: INFO] at System.Net.HttpWebRequest.GetResponse()
[07/12/2018 18:11:46 > 7351a7: INFO] at Microsoft.WindowsAzure.Storage.Core.Executor.Executor.ExecuteSync[T](RESTCommand`1 cmd, IRetryPolicy policy, OperationContext operationContext)
[07/12/2018 18:11:46 > 7351a7: INFO] --- End of inner exception stack trace ---
[07/12/2018 18:11:46 > 7351a7: INFO] at Microsoft.WindowsAzure.Storage.Core.Executor.Executor.ExecuteSync[T](RESTCommand`1 cmd, IRetryPolicy policy, OperationContext operationContext)
[07/12/2018 18:11:46 > 7351a7: INFO] at Microsoft.WindowsAzure.Storage.Queue.CloudQueue.CreateIfNotExists(QueueRequestOptions options, OperationContext operationContext)
Upon dumping additional information about the exception from Microsoft.WindowsAzure.Storage.StorageExtendedErrorInformation, I see:
AuthenticationErrorDetail:The MAC signature found in the HTTP request 'CUVqVMvvWecPsnTEynjocGpq6TkBmkpJsVL6hr2jkKQ=' is not the same as any computed signature. Server used following string to sign: 'PUT
See the following GitHub issue where ApplicationInsights may be interferring with your HTTP request to the storage REST APIs:
https://github.com/Azure/azure-storage-net/issues/490
Make sure the following is in your applicationinsights.config file:
<Add Type="Microsoft.ApplicationInsights.DependencyCollector.DependencyTrackingTelemetryModule, Microsoft.AI.DependencyCollector">
<ExcludeComponentCorrelationHttpHeadersOnDomains>
<!--
Requests to the following hostnames will not be modified by adding correlation headers.
Add entries here to exclude additional hostnames.
NOTE: this configuration will be lost upon NuGet upgrade.
-->
<Add>core.windows.net</Add>
<Add>core.chinacloudapi.cn</Add>
<Add>core.cloudapi.de</Add>
<Add>core.usgovcloudapi.net</Add>
<Add>localhost</Add>
<Add>127.0.0.1</Add>
</ExcludeComponentCorrelationHttpHeadersOnDomains>
<IncludeDiagnosticSourceActivities>
<Add>Microsoft.Azure.EventHubs</Add>
<Add>Microsoft.Azure.ServiceBus</Add>
</IncludeDiagnosticSourceActivities>
</Add>

Running webjob in console works but throws exception on Azure: The remote name could not be resolved: 'xxx.queue.core.windows.net'

My webjob deletes documents from my blob storage. If I copy the code to a console app and run it, it runs to completion without error. If I create a new webjob in visual studio (right click my website project and select Add -> New Azure Webjob project), copy the code into the Functions.cs and deploy, Azure throws an exception when running the webjob:
===============================================
[09/09/2016 01:51:44 > fc93a9: ERR ] Unhandled Exception: Microsoft.WindowsAzure.Storage.StorageException: The remote name could not be resolved: 'xxx.queue.core.windows.net' ---> System.Net.WebException: The remote name could not be resolved: 'xxx.queue.core.windows.net'
[09/09/2016 01:51:44 > fc93a9: ERR ] at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
[09/09/2016 01:51:44 > fc93a9: ERR ] at Microsoft.WindowsAzure.Storage.Core.Executor.Executor.EndGetResponse[T](IAsyncResult getResponseResult)
[09/09/2016 01:51:44 > fc93a9: ERR ] --- End of inner exception stack trace ---
[09/09/2016 01:51:44 > fc93a9: ERR ] at Microsoft.WindowsAzure.Storage.Core.Executor.Executor.EndExecuteAsync[T](IAsyncResult result)
[09/09/2016 01:51:44 > fc93a9: ERR ] at Microsoft.WindowsAzure.Storage.Queue.CloudQueue.EndExists(IAsyncResult asyncResult)
[09/09/2016 01:51:44 > fc93a9: ERR ] at Microsoft.WindowsAzure.Storage.Core.Util.AsyncExtensions.<>c__DisplayClass1`1.<CreateCallback>b__0(IAsyncResult ar)
[09/09/2016 01:51:44 > fc93a9: ERR ] --- End of stack trace from previous location where exception was thrown ---
[09/09/2016 01:51:44 > fc93a9: ERR ] at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
[09/09/2016 01:51:44 > fc93a9: ERR ] at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
[09/09/2016 01:51:44 > fc93a9: ERR ] at Microsoft.Azure.WebJobs.Host.Queues.Listeners.QueueListener.<ExecuteAsync>d__4.MoveNext()
[09/09/2016 01:51:44 > fc93a9: ERR ] --- End of stack trace from previous location where exception was thrown ---
[09/09/2016 01:51:44 > fc93a9: ERR ] at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
[09/09/2016 01:51:44 > fc93a9: ERR ] at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
[09/09/2016 01:51:44 > fc93a9: ERR ] at Microsoft.Azure.WebJobs.Host.Timers.TaskSeriesTimer.<RunAsync>d__d.MoveNext()
[09/09/2016 01:51:44 > fc93a9: ERR ] --- End of stack trace from previous location where exception was thrown ---
[09/09/2016 01:51:44 > fc93a9: ERR ] at Microsoft.Azure.WebJobs.Host.Timers.BackgroundExceptionDispatcher.<>c__DisplayClass1.<Throw>b__0()
[09/09/2016 01:51:44 > fc93a9: ERR ] at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
[09/09/2016 01:51:44 > fc93a9: ERR ] at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
[09/09/2016 01:51:44 > fc93a9: ERR ] at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
[09/09/2016 01:51:44 > fc93a9: ERR ] at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
[09/09/2016 01:51:44 > fc93a9: ERR ] at System.Threading.ThreadHelper.ThreadStart()
[09/09/2016 01:51:44 > fc93a9: SYS ERR ] Job failed due to exit code -532462766
=======================================================
I don't have a queue so thats probably where the error is coming from but the weird thing is I do not try to access a queue, I am only accessing my blob storage.
Not sure if this helps but my webjobs Program.cs looks like this:
static void Main()
{
JobHostConfiguration config = new JobHostConfiguration();
config.Tracing.ConsoleLevel = TraceLevel.Verbose;
config.UseTimers();
var host = new JobHost(config);
// The following code ensures that the WebJob will be running continuously
host.RunAndBlock();
}
And this is the only code in the job that uses storage, the rest is database stuff to get lists, etc.
CloudStorageAccount storageAccount = CloudStorageAccount.Parse(CloudConfigurationManager.GetSetting("StorageConnectionString"));
// Create the blob client.
CloudBlobClient blobClient = storageAccount.CreateCloudBlobClient();
// Retrieve reference to a previously created container.
CloudBlobContainer container = blobClient.GetContainerReference("agentdocuments");
foreach (var doc in expiredDocs)
{
if (doc.ContentLength == 1)
{
// Retrieve reference to blob
CloudBlockBlob blockBlob = container.GetBlockBlobReference($"{doc.SubDomain.ToLower()}/{doc.ClientId}/{doc.FileId}");
await blockBlob.DeleteIfExistsAsync();
}
}
EDIT: I should also add that this only started occurring after updating:
Microsoft.Azure.WebJobs from 1.1.1 to 1.1.2
Microsoft.Azure.WebJobs.Core from 1.1.1 to 1.1.2
WindowsAzure.Storage from 5.0.2 to 7.2.0 and
There were also a few code changes and other updates (like Newtonsoft.Json,Microsoft.WindowsAzure.ConfigurationManager,Microsoft.Web.WebJobs.Publish) but no code changes with how I accessed the blob.
UPDATE - My webjob ran over the weekend to completion. It failed at 22:23 with the same error as above, but then ran successfully on the retry at 22:24. But then failed again today with the same error. I'm going to try remove the logging as stated by #FleminAdambukulam but strange how it ran without any code changes but then fails again......
The problem is that the storage account is of the special type that only supports Blobs. Even though you are not using queues, the WebJobs SDK relies on them internally. So in order to use the WebJobs SDK, you need to use a regular Storage account.

Azure WebJob logging is crashing host, what can we do?

We are using Azure to run several WebJobs. One of our WebJob functions has the following signature:
public static Task ProcessFileUploadedMessageAsync(
[QueueTrigger("uploads")] FileUploadedMessage message,
TextWriter logger,
CancellationToken cancellationToken)
This function is monitoring a queue for a message that indicates a file has been uploaded, which then triggers an import of the file's data. Note the use of a TextWriter as the second argument: this is supplied by the WebJobs API infrastructure.
Our import process is kind of slow (can be several hours for a single file import in some cases), so we periodically write messages to the log (via the TextWriter) to track our progress. Unfortunately, our larger files are causing the WebJob hosting process to be terminated due to a logging exception. Here is a sample stack trace from the hosting process log:
[04/02/2016 03:44:59 > 660083: ERR ]
[04/02/2016 03:45:00 > 660083: ERR ] Unhandled Exception: System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
[04/02/2016 03:45:00 > 660083: ERR ] Parameter name: chunkLength
[04/02/2016 03:45:00 > 660083: ERR ] at System.Text.StringBuilder.ToString()
[04/02/2016 03:45:00 > 660083: ERR ] at System.IO.StringWriter.ToString()
[04/02/2016 03:45:00 > 660083: ERR ] at Microsoft.Azure.WebJobs.Host.Loggers.UpdateOutputLogCommand.<UpdateOutputBlob>d__10.MoveNext()
[04/02/2016 03:45:00 > 660083: ERR ] --- End of stack trace from previous location where exception was thrown ---
[04/02/2016 03:45:00 > 660083: ERR ] at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
[04/02/2016 03:45:00 > 660083: ERR ] at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
[04/02/2016 03:45:00 > 660083: ERR ] at Microsoft.Azure.WebJobs.Host.Loggers.UpdateOutputLogCommand.<TryExecuteAsync>d__3.MoveNext()
[04/02/2016 03:45:00 > 660083: ERR ] --- End of stack trace from previous location where exception was thrown ---
[04/02/2016 03:45:00 > 660083: ERR ] at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
[04/02/2016 03:45:00 > 660083: ERR ] at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
[04/02/2016 03:45:00 > 660083: ERR ] at Microsoft.Azure.WebJobs.Host.Timers.RecurrentTaskSeriesCommand.<ExecuteAsync>d__0.MoveNext()
[04/02/2016 03:45:00 > 660083: ERR ] --- End of stack trace from previous location where exception was thrown ---
[04/02/2016 03:45:00 > 660083: ERR ] at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
[04/02/2016 03:45:00 > 660083: ERR ] at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
[04/02/2016 03:45:00 > 660083: ERR ] at Microsoft.Azure.WebJobs.Host.Timers.TaskSeriesTimer.<RunAsync>d__d.MoveNext()
[04/02/2016 03:45:00 > 660083: ERR ] --- End of stack trace from previous location where exception was thrown ---
[04/02/2016 03:45:00 > 660083: ERR ] at Microsoft.Azure.WebJobs.Host.Timers.BackgroundExceptionDispatcher.<>c__DisplayClass1.<Throw>b__0()
[04/02/2016 03:45:00 > 660083: ERR ] at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
[04/02/2016 03:45:00 > 660083: ERR ] at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
[04/02/2016 03:45:00 > 660083: ERR ] at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
[04/02/2016 03:45:00 > 660083: ERR ] at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
[04/02/2016 03:45:00 > 660083: ERR ] at System.Threading.ThreadHelper.ThreadStart()
[04/02/2016 03:45:00 > 660083: SYS ERR ] Job failed due to exit code -532462766
[04/02/2016 03:45:01 > 660083: SYS INFO] Process went down, waiting for 0 seconds
[04/02/2016 03:45:01 > 660083: SYS INFO] Status changed to PendingRestart
The main problem is that this exception is being thrown not by our code but by something in the WebJobs API:
at Microsoft.Azure.WebJobs.Host.Loggers.UpdateOutputLogCommand.<UpdateOutputBlob>d__10.MoveNext()
We tried putting try...catch blocks around our calls to the TextWriter but these had no effect. It would appear that log messages are buffered somewhere and periodically flushed to Azure blob storage by a separate thread. If this is the case, then it would follow that we have no way of trapping the exception.
Has anyone else come across the same problem, or can anyone think of a possible solution or workaround?
For completeness, here is how we are using the TextWriter for logging:
await logger.WriteLineAsync("some text to log");
Nothing more complicated than that.
UPDATE: Seems as though this has been reported as issue #675 on the WebJobs SDK GitHub.
You should add async to method, just like this:
public async static Task ProcessFileUploadedMessageAsync(...)
To get details, you can see this article

Cannot upload VHD to azure failing

I am trying to upload a VHD file to azure. I am using the command line to set the connection and start the upload. WHen it is doing the upload it calculates the HASH and then it starts uploading the file but then it fails and a very long message.
C:\Program Files\Microsoft SDKs\Windows Azure\.NET SDK\2012-10>csupload Add-Pers
istentVMImage -Destination "http://testrli.blob.core.windows.net/test3/EO Testin
g.vhd" -Label "EO Testing.vhd" -LiteralPath "C:\VIRTUALMACHINES\PAT5DB\EO Traini
ng.vhd" -OS Windows
Windows(R) Azure(TM) Upload Tool version 1.8.0.0
for Microsoft(R) .NET Framework 3.5
Copyright (c) Microsoft Corporation. All rights reserved.
Use of http is insecure, can leak data to untrusted viewers and make your contentvulnerable to data tampering by a malicious third party.
Using the saved connection string...
Using image name 'EOTraining.vhd'
Found existing page blob. Resuming upload...
MD5 hash is being calculated for the file 'C:\VIRTUALMACHINES\PAT5DB\EO Training
.vhd'.
MD5 hash calculation is completed.ning Time: 00:00:01; Throughput: 1344.2Mbps
Elapsed time for the operation: 00:12:27
Upload failed with exceptions:
Microsoft.WindowsAzure.StorageClient.StorageServerException: The server encounte
red an unknown failure: The underlying connection was closed: An unexpected erro
r occurred on a receive. ---> System.Net.WebException: The underlying connection
was closed: An unexpected error occurred on a receive. ---> System.IO.IOExcepti
on: Unable to read data from the transport connection: An existing connection wa
s forcibly closed by the remote host. ---> System.Net.Sockets.SocketException: A
n existing connection was forcibly closed by the remote host
at System.Net.Sockets.NetworkStream.EndRead(IAsyncResult asyncResult)
--- End of inner exception stack trace ---
at System.Net.Sockets.NetworkStream.EndRead(IAsyncResult asyncResult)
at System.Net.Connection.ReadCallback(IAsyncResult asyncResult)
--- End of inner exception stack trace ---
at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
at Microsoft.WindowsAzure.StorageClient.EventHelper.ProcessWebResponse(WebReq
uest req, IAsyncResult asyncResult, EventHandler`1 handler, Object sender)
--- End of inner exception stack trace ---
at Microsoft.WindowsAzure.StorageClient.Tasks.Task`1.get_Result()
at Microsoft.WindowsAzure.StorageClient.Tasks.Task`1.ExecuteAndWait()
at Microsoft.WindowsAzure.Sync.Upload.BlobSynchronizer.<>c__DisplayClass4.<Sy
nchronize>b__1(DataWithRange dwr, CloudPageBlob b)
at Microsoft.WindowsAzure.Sync.Threading.Parallel.<>c__DisplayClass7`2.<ForEa
ch>b__1(Object )
Microsoft.WindowsAzure.StorageClient.StorageServerException: The server encounte
red an unknown failure: The underlying connection was closed: An unexpected erro
r occurred on a receive. ---> System.Net.WebException: The underlying connection
was closed: An unexpected error occurred on a receive. ---> System.IO.IOExcepti
on: Unable to read data from the transport connection: An existing connection wa
s forcibly closed by the remote host. ---> System.Net.Sockets.SocketException: A
n existing connection was forcibly closed by the remote host
at System.Net.Sockets.NetworkStream.EndRead(IAsyncResult asyncResult)
--- End of inner exception stack trace ---
at System.Net.Sockets.NetworkStream.EndRead(IAsyncResult asyncResult)
at System.Net.Connection.ReadCallback(IAsyncResult asyncResult)
--- End of inner exception stack trace ---
at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
at Microsoft.WindowsAzure.StorageClient.EventHelper.ProcessWebResponse(WebReq
uest req, IAsyncResult asyncResult, EventHandler`1 handler, Object sender)
--- End of inner exception stack trace ---
at Microsoft.WindowsAzure.StorageClient.Tasks.Task`1.get_Result()
at Microsoft.WindowsAzure.StorageClient.Tasks.Task`1.ExecuteAndWait()
at Microsoft.WindowsAzure.Sync.Upload.BlobSynchronizer.<>c__DisplayClass4.<Sy
nchronize>b__1(DataWithRange dwr, CloudPageBlob b)
at Microsoft.WindowsAzure.Sync.Threading.Parallel.<>c__DisplayClass7`2.<ForEa
ch>b__1(Object )
Microsoft.WindowsAzure.StorageClient.StorageServerException: The server encounte
red an unknown failure: The underlying connection was closed: An unexpected erro
r occurred on a receive. ---> System.Net.WebException: The underlying connection
was closed: An unexpected error occurred on a receive. ---> System.IO.IOExcepti
on: Unable to read data from the transport connection: An existing connection wa
s forcibly closed by the remote host. ---> System.Net.Sockets.SocketException: A
n existing connection was forcibly closed by the remote host
at System.Net.Sockets.NetworkStream.EndRead(IAsyncResult asyncResult)
--- End of inner exception stack trace ---
at System.Net.Sockets.NetworkStream.EndRead(IAsyncResult asyncResult)
at System.Net.Connection.ReadCallback(IAsyncResult asyncResult)
--- End of inner exception stack trace ---
at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
at Microsoft.WindowsAzure.StorageClient.EventHelper.ProcessWebResponse(WebReq
uest req, IAsyncResult asyncResult, EventHandler`1 handler, Object sender)
--- End of inner exception stack trace ---
at Microsoft.WindowsAzure.StorageClient.Tasks.Task`1.get_Result()
at Microsoft.WindowsAzure.StorageClient.Tasks.Task`1.ExecuteAndWait()
at Microsoft.WindowsAzure.Sync.Upload.BlobSynchronizer.<>c__DisplayClass4.<Sy
nchronize>b__1(DataWithRange dwr, CloudPageBlob b)
at Microsoft.WindowsAzure.Sync.Threading.Parallel.<>c__DisplayClass7`2.<ForEa
ch>b__1(Object )
Microsoft.WindowsAzure.StorageClient.StorageServerException: The server encounte
red an unknown failure: The underlying connection was closed: An unexpected erro
r occurred on a receive. ---> System.Net.WebException: The underlying connection
was closed: An unexpected error occurred on a receive. ---> System.IO.IOExcepti
on: Unable to read data from the transport connection: An existing connection wa
s forcibly closed by the remote host. ---> System.Net.Sockets.SocketException: A
n existing connection was forcibly closed by the remote host
at System.Net.Sockets.NetworkStream.EndRead(IAsyncResult asyncResult)
--- End of inner exception stack trace ---
at System.Net.Sockets.NetworkStream.EndRead(IAsyncResult asyncResult)
at System.Net.Connection.ReadCallback(IAsyncResult asyncResult)
--- End of inner exception stack trace ---
at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
at Microsoft.WindowsAzure.StorageClient.EventHelper.ProcessWebResponse(WebReq
uest req, IAsyncResult asyncResult, EventHandler`1 handler, Object sender)
--- End of inner exception stack trace ---
at Microsoft.WindowsAzure.StorageClient.Tasks.Task`1.get_Result()
at Microsoft.WindowsAzure.StorageClient.Tasks.Task`1.ExecuteAndWait()
at Microsoft.WindowsAzure.Sync.Upload.BlobSynchronizer.<>c__DisplayClass4.<Sy
nchronize>b__1(DataWithRange dwr, CloudPageBlob b)
at Microsoft.WindowsAzure.Sync.Threading.Parallel.<>c__DisplayClass7`2.<ForEa
ch>b__1(Object )
Microsoft.WindowsAzure.StorageClient.StorageServerException: The server encounte
red an unknown failure: The underlying connection was closed: An unexpected erro
r occurred on a receive. ---> System.Net.WebException: The underlying connection
was closed: An unexpected error occurred on a receive. ---> System.IO.IOExcepti
on: Unable to read data from the transport connection: An existing connection wa
s forcibly closed by the remote host. ---> System.Net.Sockets.SocketException: A
n existing connection was forcibly closed by the remote host
at System.Net.Sockets.NetworkStream.EndRead(IAsyncResult asyncResult)
--- End of inner exception stack trace ---
at System.Net.Sockets.NetworkStream.EndRead(IAsyncResult asyncResult)
at System.Net.Connection.ReadCallback(IAsyncResult asyncResult)
--- End of inner exception stack trace ---
at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
at Microsoft.WindowsAzure.StorageClient.EventHelper.ProcessWebResponse(WebReq
uest req, IAsyncResult asyncResult, EventHandler`1 handler, Object sender)
--- End of inner exception stack trace ---
at Microsoft.WindowsAzure.StorageClient.Tasks.Task`1.get_Result()
at Microsoft.WindowsAzure.StorageClient.Tasks.Task`1.ExecuteAndWait()
at Microsoft.WindowsAzure.Sync.Upload.BlobSynchronizer.<>c__DisplayClass4.<Sy
nchronize>b__1(DataWithRange dwr, CloudPageBlob b)
at Microsoft.WindowsAzure.Sync.Threading.Parallel.<>c__DisplayClass7`2.<ForEa
ch>b__1(Object )
Microsoft.WindowsAzure.StorageClient.StorageServerException: The server encounte
red an unknown failure: The underlying connection was closed: An unexpected erro
r occurred on a receive. ---> System.Net.WebException: The underlying connection
was closed: An unexpected error occurred on a receive. ---> System.IO.IOExcepti
on: Unable to read data from the transport connection: An existing connection wa
s forcibly closed by the remote host. ---> System.Net.Sockets.SocketException: A
n existing connection was forcibly closed by the remote host
at System.Net.Sockets.NetworkStream.EndRead(IAsyncResult asyncResult)
--- End of inner exception stack trace ---
at System.Net.Sockets.NetworkStream.EndRead(IAsyncResult asyncResult)
at System.Net.Connection.ReadCallback(IAsyncResult asyncResult)
--- End of inner exception stack trace ---
at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
at Microsoft.WindowsAzure.StorageClient.EventHelper.ProcessWebResponse(WebReq
uest req, IAsyncResult asyncResult, EventHandler`1 handler, Object sender)
--- End of inner exception stack trace ---
at Microsoft.WindowsAzure.StorageClient.Tasks.Task`1.get_Result()
at Microsoft.WindowsAzure.StorageClient.Tasks.Task`1.ExecuteAndWait()
at Microsoft.WindowsAzure.Sync.Upload.BlobSynchronizer.<>c__DisplayClass4.<Sy
nchronize>b__1(DataWithRange dwr, CloudPageBlob b)
at Microsoft.WindowsAzure.Sync.Threading.Parallel.<>c__DisplayClass7`2.<ForEa
ch>b__1(Object )
Microsoft.WindowsAzure.StorageClient.StorageServerException: The server encounte
red an unknown failure: The underlying connection was closed: An unexpected erro
r occurred on a receive. ---> System.Net.WebException: The underlying connection
was closed: An unexpected error occurred on a receive. ---> System.IO.IOExcepti
on: Unable to read data from the transport connection: An existing connection wa
s forcibly closed by the remote host. ---> System.Net.Sockets.SocketException: A
n existing connection was forcibly closed by the remote host
at System.Net.Sockets.NetworkStream.EndRead(IAsyncResult asyncResult)
--- End of inner exception stack trace ---
at System.Net.Sockets.NetworkStream.EndRead(IAsyncResult asyncResult)
at System.Net.Connection.ReadCallback(IAsyncResult asyncResult)
--- End of inner exception stack trace ---
at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
at Microsoft.WindowsAzure.StorageClient.EventHelper.ProcessWebResponse(WebReq
uest req, IAsyncResult asyncResult, EventHandler`1 handler, Object sender)
--- End of inner exception stack trace ---
at Microsoft.WindowsAzure.StorageClient.Tasks.Task`1.get_Result()
at Microsoft.WindowsAzure.StorageClient.Tasks.Task`1.ExecuteAndWait()
at Microsoft.WindowsAzure.Sync.Upload.BlobSynchronizer.<>c__DisplayClass4.<Sy
nchronize>b__1(DataWithRange dwr, CloudPageBlob b)
at Microsoft.WindowsAzure.Sync.Threading.Parallel.<>c__DisplayClass7`2.<ForEa
ch>b__1(Object )
Microsoft.WindowsAzure.StorageClient.StorageServerException: The server encounte
red an unknown failure: The underlying connection was closed: An unexpected erro
r occurred on a receive. ---> System.Net.WebException: The underlying connection
was closed: An unexpected error occurred on a receive. ---> System.IO.IOExcepti
on: Unable to read data from the transport connection: An existing connection wa
s forcibly closed by the remote host. ---> System.Net.Sockets.SocketException: A
n existing connection was forcibly closed by the remote host
at System.Net.Sockets.NetworkStream.EndRead(IAsyncResult asyncResult)
--- End of inner exception stack trace ---
at System.Net.Sockets.NetworkStream.EndRead(IAsyncResult asyncResult)
at System.Net.Connection.ReadCallback(IAsyncResult asyncResult)
--- End of inner exception stack trace ---
at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
at Microsoft.WindowsAzure.StorageClient.EventHelper.ProcessWebResponse(WebReq
uest req, IAsyncResult asyncResult, EventHandler`1 handler, Object sender)
--- End of inner exception stack trace ---
at Microsoft.WindowsAzure.StorageClient.Tasks.Task`1.get_Result()
at Microsoft.WindowsAzure.StorageClient.Tasks.Task`1.ExecuteAndWait()
at Microsoft.WindowsAzure.Sync.Upload.BlobSynchronizer.<>c__DisplayClass4.<Sy
nchronize>b__1(DataWithRange dwr, CloudPageBlob b)
at Microsoft.WindowsAzure.Sync.Threading.Parallel.<>c__DisplayClass7`2.<ForEa
ch>b__1(Object )
Elapsed time for upload: 00:02:17
There are couple of things to note here.
You are using http endpoint so please use HTTP to avoid further warnings and complications i.e. https://testrli.blob.core.windows.net/test3/EO
Please update your connection string to use correct certificate
The upload is trying to resume a previous upload and during the upload the connection is closed from server side. Sometime resume upload may spew these error so a fresh upload does help.
Also I would suggest using the Powershell (download latest 0.6.11) and enable $DebugPreference ='Continue' to see the request and response on console this way if you met any problem you will know the probable cause.
Here is PS script to upload a VM to Windows Azure:
http://michaelwasham.com/2013/01/04/migrate-a-virtual-machine-to-windows-azure-with-powershell/
Also report your issues to Windows Azure VM Forums to get 1:1 support from respective team, if problem still persist.

Resources