Description
he code that throws the error:
var database = Client.CreateDatabaseIfNotExistsAsync(DatabaseName).ConfigureAwait(false).GetAwaiter().GetResult().Database;
var containerTasks = ContainerDefinitions.Select(c => database.CreateContainerIfNotExistsAsync(c.Properties));
Task.WhenAll(containerTasks).ConfigureAwait(false).GetAwaiter().GetResult();
The stack trace:
'Type':'System.Threading.Tasks.TaskCanceledException',
'Message':'A task was canceled.','InnerExceptions':[],'StackTrace':[' at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)',' at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)',' at Microsoft.Azure.Cosmos.ClientExtensions.<GetAsync>d__0.MoveNext()','--- End of stack trace from previous location where exception was thrown ---',' at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()',' at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)',' at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)',' at Microsoft.Azure.Cosmos.Routing.GatewayAddressCache.<GetMasterAddressesViaGatewayAsync>d__23.MoveNext()','--- End of stack trace from previous location where exception was thrown ---',' at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()',' at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)',' at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)',' at Microsoft.Azure.Cosmos.Routing.GatewayAddressCache.<ResolveMasterAsync>d__21.MoveNext()','--- End of stack trace from previous location where exception was thrown ---',' at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()',' at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)',' at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)',' at Microsoft.Azure.Cosmos.Routing.GatewayAddressCache.<TryGetAddressesAsync>d__19.MoveNext()','--- End of stack trace from previous location where exception was thrown ---',' at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()',' at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)',' at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)',' at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)',' at Microsoft.Azure.Cosmos.AddressResolver.<ResolveAddressesAndIdentityAsync>d__12.MoveNext()','--- End of stack trace from previous location where exception was thrown ---',' at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()',' at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)',' at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)',' at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)',' at Microsoft.Azure.Cosmos.AddressResolver.<ResolveAsync>d__9.MoveNext()','--- End of stack trace from previous location where exception was thrown ---',' at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()',' at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)',' at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)',' at Microsoft.Azure.Documents.AddressSelector.<ResolveAddressesAsync>d__5.MoveNext()','--- End of stack trace from previous location where exception was thrown ---',' at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()',' at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)',' at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)',' at Microsoft.Azure.Documents.AddressSelector.<ResolveAllUriAsync>d__3.MoveNext()','--- End of stack trace from previous location where exception was thrown ---',' at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()',' at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)',' at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)',' at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)',' at System.Runtime.CompilerServices.TaskAwaiter1.GetResult()',' at Microsoft.Azure.Documents.StoreReader.<ReadMultipleReplicasInternalAsync>d__13.MoveNext()','--- End of stack trace from previous location where exception was thrown ---',' at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()',' at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)',' at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)',' at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)',' at Microsoft.Azure.Documents.StoreReader.<ReadMultipleReplicaAsync>d__11.MoveNext()','--- End of stack trace from previous location where exception was thrown ---',' at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()',' at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)',' at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)',' at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)',' at Microsoft.Azure.Documents.QuorumReader.<ReadQuorumAsync>d__14.MoveNext()','--- End of stack trace from previous location where exception was thrown ---',' at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()',' at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)',' at Microsoft.Azure.Documents.QuorumReader.<ReadStrongAsync>d__12.MoveNext()','--- End of stack trace from previous location where exception was thrown ---',' at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()',' at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)',' at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)',' at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)',' at Microsoft.Azure.Documents.ReplicatedResourceClient.<>c__DisplayClass27_0.<<InvokeAsync>b__0>d.MoveNext()','--- End of stack trace from previous location where exception was thrown ---',' at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()',' at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)',' at Microsoft.Azure.Documents.RequestRetryUtility.<ProcessRequestAsync>d__2
2.MoveNext()','--- End of stack trace from previous location where exception was thrown ---',' at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()',' at Microsoft.Azure.Documents.ShouldRetryResult.ThrowIfDoneTrying(ExceptionDispatchInfo capturedException)',' at Microsoft.Azure.Documents.RequestRetryUtility.<ProcessRequestAsync>d__2`2.MoveNext()','--- End of stack trace from previous location where exception was thrown ---',' at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()',' at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)',' at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)',' at Microsoft.Azure.Documents.StoreClient.<ProcessMessageAsync>d__19.MoveNext()','--- End of stack trace from previous location where exception was thrown ---',' at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()',' at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)',' at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)',' at Microsoft.Azure.Documents.ServerStoreModel.<ProcessMessageAsync>d__15.MoveNext()','--- End of stack trace from previous location where exception was thrown ---',' at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()',' at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)',' at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)',' at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)',' at Microsoft.Azure.Cosmos.Handlers.TransportHandler.<ProcessMessageAsync>d__3.MoveNext()','--- End of stack trace from previous location where exception was thrown ---',' at Syste