Publish Angular-CLI 6 ASP.Core application to Azure - 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";
});

Related

CMake Project not loading on WSL2 via Visual Studio 2022

I am using Visual Studio 2022 preview.
I am trying to Compile and Run Cpprest based Project on WSL2 Debian Distribution.
I have CMake v3.21.2 in Debian installed.
the project builds and runs on bare linux system as there is already Dockerfile present in project directory and tested by me.
while opening project in Visual Studio i get following Error in Cross Platform Logging window and i am not able to build and run the project.
it says file .vs/SecureChatServer/out/build/linux-default/.cmake/api/v1/query/client-MicrosoftVS/query.json in WSL2 Distribution does not exist
15:17:34.6074634 [Info, Thread 86] Microsoft.VisualStudio.Workspace.ExternalBuildFramework.Impl.ParseCache: ClearSingleConfigurationAsync: Clearing cache entry for CMakeLists.txt.
15:17:34.6530612 [Info, Thread 93] Microsoft.VisualStudio.Workspace.ExternalBuildFramework.Impl.Services.BuildProjectScannerService: Starting scan ...
15:17:34.7459086 [Info, Thread 93] Microsoft.VisualStudio.Workspace.ExternalBuildFramework.Impl.Services.BuildProjectScannerService: Scanner Parsing starting: projectfilepath CMakeLists.txt FileScanType: System.Collections.Generic.IReadOnlyDictionary`2[System.Type,System.Object] Config Name:linux-default
15:17:34.8382805 [Info, Thread 84] Microsoft.VisualStudio.Workspace.ExternalBuildFramework.Impl.ParseCache: CacheGenerationStarted root: CMAKELISTS.TXTlinux-default CMakeLists.txt linux-default
15:17:34.8472770 [Info, Thread 84] Microsoft.VisualStudio.CMake.Linux.Project.RemoteCMakeParser: RemoteCMakeParser ctor
15:17:34.8472770 [Info, Thread 84] libcmake.Linux.RemoteCMakeParser: RemoteCMakeParser ctor
15:17:34.8472770 [Info, Thread 84] Microsoft.VisualStudio.CMake.Linux.Project.RemoteCMakeParser: RemoteCMakeParser finished
15:17:34.8482814 [Info, Thread 84] libcmake.Linux.RemoteCMakeUtils: RemoteCMakeCopyFilesStarted Copying source directory 'C:\Users\Tushar\Downloads\Semester 7\MP\SecureChatServer\' to destination directory '/home/tushar/.vs/SecureChatServer' on '' (method=rsync).
15:17:35.1282745 [Info, Thread 11] libcmake.Linux.IO.DirectoryScan: Scan time: 79
15:17:35.1552754 [Info, Thread 11] libcmake.Linux.IO.DirectoryScan: Compare time: 26
15:17:35.1992766 [Info, Thread 11] libcmake.Linux.RemoteCMakeUtils: RemoteCMakeCopyFilesFinished Finished copying files (elapsed time 00h:00m:00s:200ms).
15:17:35.3902747 [Info, Thread 52] libcmake.Linux.RemoteCMakeParser: ParseAsync
15:17:35.3912810 [Info, Thread 52] libcmake.Linux.RemoteCMakeParser: CreateCMakeDaemonAsync
15:17:35.3912810 [Info, Thread 52] libcmake.Linux.RemoteCMakeParameters: Connecting to the remote system
15:17:35.5384620 [Info, Thread 52] libcmake.Linux.RemoteCMakeParameters: Connected to the remote system
15:17:35.6864045 [Info, Thread 14] libcmake.CMakeDaemonDriver: CMake version parsed: True, input string: cmake version 3.21.2, matched version: 3.21.2.0
15:17:35.6883976 [Info, Thread 14] libcmake.Linux.RemoteCMakeParameters: CMake version '3.21.2.0' identified on the remote
15:17:35.8373996 [Info, Thread 9] libcmake.Linux.RemoteCMakeParameters: Found cmake executable at /usr/local/bin/cmake.
15:17:36.0284001 [Info, Thread 14] libcmake.CMakeDaemonDriver: CMake version parsed: True, input string: cmake version 3.21.2, matched version: 3.21.2.0
15:17:36.0304011 [Info, Thread 14] libcmake.Linux.RemoteCMakeParser: CreateCMakeDaemonAsync done
15:17:36.0304011 [Info, Thread 14] libcmake.CMakeListsParser: Parsing without cache
15:17:36.1454044 [Info, Thread 14] libcmake.CMakeDaemonDriver: CMake version parsed: True, input string: cmake version 3.21.2, matched version: 3.21.2.0
15:17:36.1484013 [Info, Thread 14] libcmake.Linux.RemoteFileApiDaemon: CMake version '3.21.2.0' identified on the remote
15:17:36.1854036 [Error, Thread 14] Microsoft.VisualStudio.CMake.Project.ExternalBuildProject.ProjectProvider: liblinux.IO.IOException: Failed to get permissions for file '/home/tushar/.vs/SecureChatServer/out/build/linux-default/.cmake/api/v1/query/client-MicrosoftVS/query.json'. ---> liblinux.IO.IOException: Failed to get permissions for file '/home/tushar/.vs/SecureChatServer/out/build/linux-default/.cmake/api/v1/query/client-MicrosoftVS/query.json'.
at liblinux.Local.IO.WindowsSubsystemFileSystem.StatPath(String remotePath, String format, String error)
at liblinux.Local.IO.WindowsSubsystemFileSystem.GetPermissions(String remotePath)
at liblinux.IO.RemoteFileSystemInfo..ctor(IRemoteFileSystem fs, String remotePath)
at liblinux.Local.IO.WindowsSubsystemFileSystem.UploadFile(String localFileName, String remoteFileName)
--- End of inner exception stack trace ---
at liblinux.Local.IO.WindowsSubsystemFileSystem.UploadFile(String localFileName, String remoteFileName)
at liblinux.Local.IO.WindowsSubsystemFileSystem.UploadFileAsync(String localFileName, String remoteFileName, Int32 bufferSize, CancellationToken cancellationToken)
at libcmake.Linux.RemoteFileApiDaemon.<WriteQueryFileAsync>d__22.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at libcmake.Linux.RemoteFileApiDaemon.<GenerateCacheAsync>d__16.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at libcmake.CMakeListsParser.<ParseImplAsync>d__39.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at libcmake.Linux.RemoteCMakeParser.<ParseAsync>d__7.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.VisualStudio.CMake.Linux.Project.RemoteCMakeParser.<ParseAsync>d__29.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.VisualStudio.CMake.Project.ExternalBuildProject.ProjectProvider.<ParseProjectAsync>d__33.MoveNext()
15:17:36.1854036 [Error, Thread 14] Microsoft.VisualStudio.Workspace.ExternalBuildFramework.Impl.ParseCache: Unknown exception during cache generation: root: CMAKELISTS.TXTlinux-default CMakeLists.txt linux-default
15:17:36.1864019 [Error, Thread 36] Microsoft.VisualStudio.Workspace.ExternalBuildFramework.Impl.ParseCache: liblinux.IO.IOException: Failed to get permissions for file '/home/tushar/.vs/SecureChatServer/out/build/linux-default/.cmake/api/v1/query/client-MicrosoftVS/query.json'. ---> liblinux.IO.IOException: Failed to get permissions for file '/home/tushar/.vs/SecureChatServer/out/build/linux-default/.cmake/api/v1/query/client-MicrosoftVS/query.json'.
at liblinux.Local.IO.WindowsSubsystemFileSystem.StatPath(String remotePath, String format, String error)
at liblinux.Local.IO.WindowsSubsystemFileSystem.GetPermissions(String remotePath)
at liblinux.IO.RemoteFileSystemInfo..ctor(IRemoteFileSystem fs, String remotePath)
at liblinux.Local.IO.WindowsSubsystemFileSystem.UploadFile(String localFileName, String remoteFileName)
--- End of inner exception stack trace ---
at liblinux.Local.IO.WindowsSubsystemFileSystem.UploadFile(String localFileName, String remoteFileName)
at liblinux.Local.IO.WindowsSubsystemFileSystem.UploadFileAsync(String localFileName, String remoteFileName, Int32 bufferSize, CancellationToken cancellationToken)
at libcmake.Linux.RemoteFileApiDaemon.<WriteQueryFileAsync>d__22.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at libcmake.Linux.RemoteFileApiDaemon.<GenerateCacheAsync>d__16.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at libcmake.CMakeListsParser.<ParseImplAsync>d__39.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at libcmake.Linux.RemoteCMakeParser.<ParseAsync>d__7.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.VisualStudio.CMake.Linux.Project.RemoteCMakeParser.<ParseAsync>d__29.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.VisualStudio.CMake.Project.ExternalBuildProject.ProjectProvider.<ParseProjectAsync>d__33.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Microsoft.VisualStudio.CMake.Project.ExternalBuildProject.ProjectProvider.<ParseProjectAsync>d__33.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.VisualStudio.Workspace.ExternalBuildFramework.Impl.ParseCache.<ParseAsyncImpl>d__34.MoveNext()
15:17:36.1904000 [Info, Thread 46] Microsoft.VisualStudio.Workspace.ExternalBuildFramework.Impl.Services.BuildProjectScannerService: Scanner Parsing done: projectfilepath CMakeLists.txt FileScanType: System.Collections.Generic.IReadOnlyDictionary`2[System.Type,System.Object] Config Name:linux-default
15:17:36.1924027 [Info, Thread 53] Microsoft.VisualStudio.Workspace.ExternalBuildFramework.Impl.Services.BuildProjectScannerService: Compute file data values for CMakeLists.txt Config linux-default
15:17:36.1943992 [Error, Thread 113] Microsoft.VisualStudio.Workspace.ExternalBuildFramework.Impl.Services.BuildProjectScannerService: FDV Error for CMakeLists.txt Config linux-default Canceled False AutoGenerateCanceled False
15:17:36.2074002 [Info, Thread 107] Microsoft.VisualStudio.Workspace.ExternalBuildFramework.Impl.Services.BuildProjectScannerService: OnFileScannerCompleted for CMakeLists.txt
15:17:36.2084013 [Info, Thread 107] Microsoft.VisualStudio.Workspace.ExternalBuildFramework.Impl.Services.BuildProjectScannerService: Finishing scan.
The Solution to problem is manually creating the query.json file at location
$HOME/.vs/$PROJECT_NAME/out/build/linux-default/.cmake/api/v1/query/client-MicrosoftVS/query.json
the content of the query.json should be
{
"requests":[
{
"kind":"cache",
"version":2
},
{
"kind":"cmakeFiles",
"version":1
},
{
"kind":"codemodel",
"version":2
}
]
}

Microsoft Dynamics 365 Field Service Web API: Create a work order triggers a "code": "0x80040265", "message": "The Service Account is required.",

HTTP POST to create a new Work Order in Microsoft Dynamics 365 - Field Service (Empty body)
import requests
url = "https://{{my-env_name}}.{{my_region}}.dynamics.com/api/data/v9.0/msdyn_workorders"
payload = "{\n \n}"
headers = {
'Accept': 'application/json',
'OData-MaxVersion': '4.0',
'OData-Version': '4.0',
'If-None-Match': 'null',
'Authorization': 'Bearer eyXXX',
'Content-Type': 'application/json',
}
response = requests.request("POST", url, headers=headers, data = payload)
print(response.text.encode('utf8'))
Error received when the Body of the POST is empty
{
"error": {
"code": "0x80040265",
"message": "The Service Account is required.",
"innererror": {
"message": "The Service Account is required.",
"type": "System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=9.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]",
"stacktrace": " at Microsoft.Crm.Extensibility.OrganizationSdkServiceInternal.CreateInternal(Entity entity, InvocationContext invocationContext, CallerOriginToken callerOriginToken, WebServiceType serviceType, Boolean checkAdminMode, Dictionary`2 optionalParameters)\r\n
at Microsoft.Crm.Extensibility.OData.CrmODataExecutionContext.CreateOrganizationResponse(Entity entity)\r\n
at Microsoft.Crm.Extensibility.OData.CrmODataServiceDataProvider.CreateEdmEntity(CrmODataExecutionContext context, String edmEntityName, EdmEntityObject entityObject, Boolean isUpsert)\r\n
at Microsoft.Crm.Extensibility.OData.EntityController.PostEntitySetImplementation(String& entitySetName, EdmEntityObject entityObject)\r\n
at Microsoft.Crm.Extensibility.OData.CrmODataUtilities.<>c__DisplayClass10_0`2.<InvokeActionAndLogMetric>b__0()\r\n
at Microsoft.PowerApps.CoreFramework.ActivityLoggerExtensions.Execute[TResult](ILogger logger, EventId eventId, ActivityType activityType, Func`1 func, IEnumerable`1 additionalCustomProperties)\r\n
at Microsoft.Xrm.Telemetry.XrmTelemetryExtensions.Execute[TResult](ILogger logger, XrmTelemetryActivityType activityType, Func`1 func)\r\n
at lambda_method(Closure , Object , Object[] )\r\n
at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass10.<GetExecutor>b__9(Object instance, Object[] methodParameters)\r\n
at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext, IDictionary`2 arguments, CancellationToken cancellationToken)\r\n
--- End of stack trace from previous location where exception was thrown ---\r\n
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n
at System.Web.Http.Controllers.ApiControllerActionInvoker.<InvokeActionAsyncCore>d__0.MoveNext()\r\n
--- End of stack trace from previous location where exception was thrown ---\r\n
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d__2.MoveNext()\r\n
--- End of stack trace from previous location where exception was thrown ---\r\n
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Dispatcher.HttpControllerDispatcher.<SendAsync>d__1.MoveNext()"
}
}
}
I add the Service Account into the body of the POST
Look at the model of a Work Order : https://learn.microsoft.com/en-us/dynamics365/customer-engagement/web-api/msdyn_workorder?view=dynamics-ce-odata-9
{
"msdyn_serviceaccount": "{{an existing account id}}"
}
Error received when the Body of the POST contains the msdyn_serviceaccount field
{
"error": {
"code": "0x0",
"message": "An error occurred while validating input parameters: Microsoft.OData.ODataException: A 'PrimitiveValue' node with non-null value was found when trying to read the value of the property 'msdyn_serviceaccount'; however, a 'StartArray' node, a 'StartObject' node, or a 'PrimitiveValue' node with null value was expected.\r\n
at Microsoft.OData.JsonLight.ODataJsonLightPropertyAndValueDeserializer.ValidateExpandedNestedResourceInfoPropertyValue(IJsonReader jsonReader, Nullable`1 isCollection, String propertyName)\r\n
at Microsoft.OData.JsonLight.ODataJsonLightResourceDeserializer.ReadPropertyWithValue(IODataJsonLightReaderResourceState resourceState, String propertyName, Boolean isDeltaResourceSet)\r\n
at Microsoft.OData.JsonLight.ODataJsonLightResourceDeserializer.<>c__DisplayClass9_0.<ReadResourceContent>b__0(PropertyParsingResult propertyParsingResult, String propertyName)\r\n
at Microsoft.OData.JsonLight.ODataJsonLightDeserializer.ProcessProperty(PropertyAndAnnotationCollector propertyAndAnnotationCollector, Func`2 readPropertyAnnotationValue, Action`2 handleProperty)\r\n
at Microsoft.OData.JsonLight.ODataJsonLightResourceDeserializer.ReadResourceContent(IODataJsonLightReaderResourceState resourceState)\r\n
at Microsoft.OData.JsonLight.ODataJsonLightReader.StartReadingResource()\r\n
at Microsoft.OData.JsonLight.ODataJsonLightReader.ReadResourceSetItemStart(PropertyAndAnnotationCollector propertyAndAnnotationCollector, SelectedPropertiesNode selectedProperties)\r\n at
Microsoft.OData.JsonLight.ODataJsonLightReader.ReadAtStartImplementationSynchronously(PropertyAndAnnotationCollector propertyAndAnnotationCollector)\r\n
at Microsoft.OData.ODataReaderCore.ReadImplementation()\r\n
at Microsoft.OData.ODataReaderCore.InterceptException[T](Func`1 action)\r\n
at System.Web.OData.Formatter.Deserialization.ODataReaderExtensions.ReadResourceOrResourceSet(ODataReader reader)\r\n
at System.Web.OData.Formatter.Deserialization.ODataResourceDeserializer.Read(ODataMessageReader messageReader, Type type, ODataDeserializerContext readContext)\r\n
at System.Web.OData.Formatter.ODataMediaTypeFormatter.ReadFromStream(Type type, Stream readStream, HttpContent content, IFormatterLogger formatterLogger)",
"innererror": {
"message": "An error occurred while validating input parameters: Microsoft.OData.ODataException: A 'PrimitiveValue' node with non-null value was found when trying to read the value of the property 'msdyn_serviceaccount'; however, a 'StartArray' node, a 'StartObject' node, or a 'PrimitiveValue' node with null value was expected.\r\n
at Microsoft.OData.JsonLight.ODataJsonLightPropertyAndValueDeserializer.ValidateExpandedNestedResourceInfoPropertyValue(IJsonReader jsonReader, Nullable`1 isCollection, String propertyName)\r\n
at Microsoft.OData.JsonLight.ODataJsonLightResourceDeserializer.ReadPropertyWithValue(IODataJsonLightReaderResourceState resourceState, String propertyName, Boolean isDeltaResourceSet)\r\n
at Microsoft.OData.JsonLight.ODataJsonLightResourceDeserializer.<>c__DisplayClass9_0.<ReadResourceContent>b__0(PropertyParsingResult propertyParsingResult, String propertyName)\r\n
at Microsoft.OData.JsonLight.ODataJsonLightDeserializer.ProcessProperty(PropertyAndAnnotationCollector propertyAndAnnotationCollector, Func`2 readPropertyAnnotationValue, Action`2 handleProperty)\r\n
at Microsoft.OData.JsonLight.ODataJsonLightResourceDeserializer.ReadResourceContent(IODataJsonLightReaderResourceState resourceState)\r\n
at Microsoft.OData.JsonLight.ODataJsonLightReader.StartReadingResource()\r\n
at Microsoft.OData.JsonLight.ODataJsonLightReader.ReadResourceSetItemStart(PropertyAndAnnotationCollector propertyAndAnnotationCollector, SelectedPropertiesNode selectedProperties)\r\n
at Microsoft.OData.JsonLight.ODataJsonLightReader.ReadAtStartImplementationSynchronously(PropertyAndAnnotationCollector propertyAndAnnotationCollector)\r\n
at Microsoft.OData.ODataReaderCore.ReadImplementation()\r\n
at Microsoft.OData.ODataReaderCore.InterceptException[T](Func`1 action)\r\n
at System.Web.OData.Formatter.Deserialization.ODataReaderExtensions.ReadResourceOrResourceSet(ODataReader reader)\r\n
at System.Web.OData.Formatter.Deserialization.ODataResourceDeserializer.Read(ODataMessageReader messageReader, Type type, ODataDeserializerContext readContext)\r\n
at System.Web.OData.Formatter.ODataMediaTypeFormatter.ReadFromStream(Type type, Stream readStream, HttpContent content, IFormatterLogger formatterLogger)",
"type": "Microsoft.Crm.CrmHttpException",
"stacktrace": " at Microsoft.Crm.Extensibility.OData.CrmODataUtilities.ValidateInputParameters(ModelStateDictionary controllerModelState)\r\n
at Microsoft.Crm.Extensibility.OData.EntityController.PostEntitySetImplementation(String& entitySetName, EdmEntityObject entityObject)\r\n
at Microsoft.Crm.Extensibility.OData.CrmODataUtilities.<>c__DisplayClass10_0`2.<InvokeActionAndLogMetric>b__0()\r\n
at Microsoft.PowerApps.CoreFramework.ActivityLoggerExtensions.Execute[TResult](ILogger logger, EventId eventId, ActivityType activityType, Func`1 func, IEnumerable`1 additionalCustomProperties)\r\n
at Microsoft.Xrm.Telemetry.XrmTelemetryExtensions.Execute[TResult](ILogger logger, XrmTelemetryActivityType activityType, Func`1 func)\r\n
at lambda_method(Closure , Object , Object[] )\r\n
at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass10.<GetExecutor>b__9(Object instance, Object[] methodParameters)\r\n
at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext, IDictionary`2 arguments, CancellationToken cancellationToken)\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n
at System.Web.Http.Controllers.ApiControllerActionInvoker.<InvokeActionAsyncCore>d__0.MoveNext()\r\n
--- End of stack trace from previous location where exception was thrown ---\r\n
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n
at System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d__2.MoveNext()\r\n
--- End of stack trace from previous location where exception was thrown ---\r\n
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n
at System.Web.Http.Dispatcher.HttpControllerDispatcher.<SendAsync>d__1.MoveNext()"
}
}
}
QUESTION: What is the expected JSON body by the Web API of Microsoft Dynamics 365 Field Service?
You should use this, to put in a lookup (aka Entity reference, navigation property):
{
"msdyn_serviceaccount#odata.bind": "/accounts(guid)"
}
The basic payload with required fields to create work order is below:
{
"msdyn_serviceaccount#odata.bind": "/accounts(account_entity_guid_you_want_to_bind)",
"msdyn_pricelist#odata.bind": "/pricelevels(pricelevel_entity_guid_you_want_to_bind)",
"msdyn_systemstatus": "690970000",
}
Reference

EventProcessorHost using in webjob with multiple instances - giving exception Microsoft.ServiceBus.Messaging.LeaseLostException

I am using EventProcessorHost in webjob with multiple instances - giving exception Microsoft.ServiceBus.Messaging.LeaseLostException. Perticularly only one instance is giving this exception.
It is not giving any exception when I am running it as single instances
Microsoft.ServiceBus.Messaging.LeaseLostException: Exception of type 'Microsoft.ServiceBus.Messaging.LeaseLostException' was thrown. ---> Microsoft.WindowsAzure.Storage.StorageException: The remote server returned an error: (409) Conflict. ---> System.Net.WebException: The remote server returned an error: (409) Conflict.
at Microsoft.WindowsAzure.Storage.Shared.Protocol.HttpResponseParsers.ProcessExpectedStatusCodeNoException[T](HttpStatusCode expectedStatusCode, HttpStatusCode actualStatusCode, T retVal, StorageCommandBase1 cmd, Exception ex) in c:\Program Files (x86)\Jenkins\workspace\release_dotnet_master\Lib\Common\Shared\Protocol\HttpResponseParsers.Common.cs:line 50
at Microsoft.WindowsAzure.Storage.Blob.CloudBlob.<>c__DisplayClass33.<RenewLeaseImpl>b__32(RESTCommand1 cmd, HttpWebResponse resp, Exception ex, OperationContext ctx) in c:\Program Files (x86)\Jenkins\workspace\release_dotnet_master\Lib\ClassLibraryCommon\Blob\CloudBlob.cs:line 3186
at Microsoft.WindowsAzure.Storage.Core.Executor.Executor.EndGetResponse[T](IAsyncResult getResponseResult) in c:\Program Files (x86)\Jenkins\workspace\release_dotnet_master\Lib\ClassLibraryCommon\Core\Executor\Executor.cs:line 299
--- End of inner exception stack trace ---
at Microsoft.WindowsAzure.Storage.Core.Executor.Executor.EndExecuteAsync[T](IAsyncResult result) in c:\Program Files (x86)\Jenkins\workspace\release_dotnet_master\Lib\ClassLibraryCommon\Core\Executor\Executor.cs:line 50
at Microsoft.WindowsAzure.Storage.Blob.CloudBlob.EndRenewLease(IAsyncResult asyncResult) in c:\Program Files (x86)\Jenkins\workspace\release_dotnet_master\Lib\ClassLibraryCommon\Blob\CloudBlob.cs:line 1982
at Microsoft.WindowsAzure.Storage.Core.Util.AsyncExtensions.<>c__DisplayClass4.b__3(IAsyncResult ar) in c:\Program Files (x86)\Jenkins\workspace\release_dotnet_master\Lib\ClassLibraryCommon\Core\Util\AsyncExtensions.cs:line 114
--- 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 Microsoft.ServiceBus.Messaging.BlobLeaseManager.d__23.MoveNext()
--- End of inner exception stack trace ---
at Microsoft.ServiceBus.Messaging.BlobLeaseManager.d__23.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 Microsoft.ServiceBus.Messaging.BlobLeaseManager.d__24.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 RoutingServiceWebJob.DataProcessorFactory.EventHubDataProcessor.d__37.MoveNext() in d:\a\1\s\RoutingServiceWebJob\DataProcessorFactory\EventHubDataProcessor.cs:line 163
I am reading messages one at a time. Please suggest.
I was able to avoid this by setting the Host name to be a unique string. For example
var eventProcessorHostName = Guid.NewGuid().ToString();

About Microsoft.ServiceBus.Messaging.LeaseLostException

I got an exception of Microsoft.ServiceBus.Messaging.LeaseLostException, in my EventHub processor.
what does this exception mean? What is the possible root cause of this exception?
Following are stack track:
at Microsoft.ServiceBus.Messaging.BlobLeaseManager.d__24.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n
at Microsoft.ServiceBus.Messaging.BlobLeaseManager.d__25.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n
at MyEventHub.EventProcessor`1.d__6.MoveNext()\r\n\r\nMicrosoft.WindowsAzure.Storage.StorageException : \"The remote server returned an error: (409) Conflict.\":
at Microsoft.WindowsAzure.Storage.Core.Executor.Executor.EndExecuteAsync[T](IAsyncResult result) in c:\Program Files (x86)\Jenkins\workspace\release_dotnet_master\Lib\ClassLibraryCommon\Core\Executor\Executor.cs:line 60\r\n
at Microsoft.WindowsAzure.Storage.Core.Util.AsyncExtensions.<>c__DisplayClass4.b__3(IAsyncResult ar) in c:\Program Files (x86)\Jenkins\workspace\release_dotnet_master\Lib\ClassLibraryCommon\Core\Util\AsyncExtensions.cs:line 115\r\n--- End of stack trace from previous location where exception was thrown ---\r\n
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n
at Microsoft.ServiceBus.Messaging.BlobLeaseManager.d__24.MoveNext()\r\n\r\nSystem.Net.WebException : \"The remote server returned an error: (409) Conflict.\":
at Microsoft.WindowsAzure.Storage.Shared.Protocol.HttpResponseParsers.ProcessExpectedStatusCodeNoException[T](HttpStatusCode expectedStatusCode, HttpStatusCode actualStatusCode, T retVal, StorageCommandBase1 cmd, Exception ex) in c:\\Program Files (x86)\\Jenkins\\workspace\\release_dotnet_master\\Lib\\Common\\Shared\\Protocol\\HttpResponseParsers.Common.cs:line 50\r\n
at Microsoft.WindowsAzure.Storage.Blob.CloudBlob.<>c__DisplayClass33.<RenewLeaseImpl>b__32(RESTCommand1 cmd, HttpWebResponse resp, Exception ex, OperationContext ctx) in c:\Program Files (x86)\Jenkins\workspace\release_dotnet_master\Lib\ClassLibraryCommon\Blob\CloudBlob.cs:line 3186\r\n
at Microsoft.WindowsAzure.Storage.Core.Executor.Executor.EndGetResponse[T](IAsyncResult getResponseResult) in c:\Program Files (x86)\Jenkins\workspace\release_dotnet_master\Lib\ClassLibraryCommon\Core\Executor\Executor.cs:line 306"
And the only internal exception in my own code is:
at MyEventHub.EventProcessor`1.<< CloseAsync >> d__6.MoveNext()\r\n\r\nMicrosoft.WindowsAzure.Storage.StorageException : \"The remote server returned an error: (409) Conflict.\":
...
And here is the code of CloseAsync:
public async Task CloseAsync(PartitionContext context, CloseReason reason)
{
try
{
if (reason == CloseReason.Shutdown)
{
await context.CheckpointAsync();
}
}
catch (Exception ex)
{
this.HandleException(ex);
}
finally
{
this.configuration.DecrementOpenedPartitionCount?.Invoke();
}
}
MyEventHub is hosted in worker role which deployed 2 instance in Azure.
#Youxu , for your EventHub, how many receivers ( EventProcessorHost ) are configured?. As per my knowledge we can have only one active receiver with certain epoch. If we create a EventHub listener ( with default options) while one listener is already listing to a EventHub, newly created listener gets higher epoch and first listener gets disconnected due to LeaseLostException
Check if you are (accidentally) running more than one receiver for same EventHub concurrently.

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