From 834b0f9ddf74ab6152cef79f59d5b80d95482188 Mon Sep 17 00:00:00 2001 From: Christopher Scott Date: Wed, 21 Oct 2020 11:15:54 -0500 Subject: [PATCH] Improve batch error handling (#16121) * Improve batch error handling --- .../api/Azure.Data.Tables.netstandard2.0.cs | 2 +- .../Azure.Data.Tables/src/TableRestClient.cs | 64 ++++++- .../src/TableTransactionalBatch.cs | 80 +++++--- .../BatchError.json | 152 +++++++++++++++ .../BatchErrorAsync.json | 152 +++++++++++++++ .../BatchError.json | 180 ++++++++++++++++++ .../BatchErrorAsync.json | 180 ++++++++++++++++++ .../tests/TableClientLiveTests.cs | 31 +++ .../test-resources.json | 0 9 files changed, 807 insertions(+), 34 deletions(-) create mode 100644 sdk/tables/Azure.Data.Tables/tests/SessionRecords/TableClientLiveTests(CosmosTable)/BatchError.json create mode 100644 sdk/tables/Azure.Data.Tables/tests/SessionRecords/TableClientLiveTests(CosmosTable)/BatchErrorAsync.json create mode 100644 sdk/tables/Azure.Data.Tables/tests/SessionRecords/TableClientLiveTests(Storage)/BatchError.json create mode 100644 sdk/tables/Azure.Data.Tables/tests/SessionRecords/TableClientLiveTests(Storage)/BatchErrorAsync.json rename sdk/tables/{Azure.Data.Tables => }/test-resources.json (100%) diff --git a/sdk/tables/Azure.Data.Tables/api/Azure.Data.Tables.netstandard2.0.cs b/sdk/tables/Azure.Data.Tables/api/Azure.Data.Tables.netstandard2.0.cs index e308b5c32011a..4ba0ff7c3f10e 100644 --- a/sdk/tables/Azure.Data.Tables/api/Azure.Data.Tables.netstandard2.0.cs +++ b/sdk/tables/Azure.Data.Tables/api/Azure.Data.Tables.netstandard2.0.cs @@ -129,8 +129,8 @@ protected TableTransactionalBatch() { } public virtual void AddEntities(System.Collections.Generic.IEnumerable entities) where T : class, Azure.Data.Tables.ITableEntity, new() { } public virtual void AddEntity(T entity) where T : class, Azure.Data.Tables.ITableEntity, new() { } public virtual void DeleteEntity(string partitionKey, string rowKey, Azure.ETag ifMatch = default(Azure.ETag)) { } + public virtual Azure.Response SubmitBatch(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> SubmitBatchAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response SubmitBatch(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual void UpdateEntity(T entity, Azure.ETag ifMatch, Azure.Data.Tables.TableUpdateMode mode = Azure.Data.Tables.TableUpdateMode.Merge) where T : class, Azure.Data.Tables.ITableEntity, new() { } } public enum TableUpdateMode diff --git a/sdk/tables/Azure.Data.Tables/src/TableRestClient.cs b/sdk/tables/Azure.Data.Tables/src/TableRestClient.cs index 62a2b5bf92764..a21014bd6350f 100644 --- a/sdk/tables/Azure.Data.Tables/src/TableRestClient.cs +++ b/sdk/tables/Azure.Data.Tables/src/TableRestClient.cs @@ -4,8 +4,13 @@ #nullable disable using System; +using System.Collections.Concurrent; using System.Collections.Generic; +using System.IO; using System.Linq; +using System.Text; +using System.Text.Json; +using System.Text.RegularExpressions; using System.Threading; using System.Threading.Tasks; using Azure.Core; @@ -19,6 +24,7 @@ internal partial class TableRestClient internal ClientDiagnostics clientDiagnostics => _clientDiagnostics; internal string endpoint => url; internal string clientVersion => version; + private static readonly Regex s_entityIndexRegex = new Regex(@"""value"":""(?[\d]+):", RegexOptions.Compiled); internal HttpMessage CreateBatchRequest(MultipartContent content, string requestId, ResponseFormat? responsePreference) { @@ -51,11 +57,12 @@ internal static MultipartContent CreateBatchContent(Guid batchGuid) return new MultipartContent("mixed", $"batch_{guid}"); } - /// Insert entity in a table. - /// + /// Submits a batch operation to a table. + /// The message to send. + /// TRhe ordered list of messages and entities. /// The cancellation token to use. /// is null. - public async Task>> SendBatchRequestAsync(HttpMessage message, CancellationToken cancellationToken = default) + public async Task>> SendBatchRequestAsync(HttpMessage message, List<(ITableEntity Entity, HttpMessage HttpMessage)> messageList, CancellationToken cancellationToken = default) { if (message == null) { @@ -76,7 +83,24 @@ public async Task>> SendBatchRequestAsync(HttpMessage me if (responses.Length == 1 && responses.Any(r => r.Status >= 400)) { - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(responses[0]).ConfigureAwait(false); + // Batch error messages should be formatted as follows: + // "0:" + // where the number prefix is the index of the sub request that failed. + var ex = await _clientDiagnostics.CreateRequestFailedExceptionAsync(responses[0]).ConfigureAwait(false); + + //Get the failed index + var match = s_entityIndexRegex.Match(ex.Message); + + if (match.Success && int.TryParse(match.Groups["index"].Value, out int failedEntityIndex)) + { + // create a new exception with the additional info populated. + var appendedMessage = AppendEntityInfoToMessage(ex.Message, messageList[failedEntityIndex].Entity); + throw new RequestFailedException(ex.Status, appendedMessage, ex.ErrorCode, ex.InnerException); + } + else + { + throw ex; + } } return Response.FromValue(responses.ToList(), message.Response); @@ -86,11 +110,12 @@ public async Task>> SendBatchRequestAsync(HttpMessage me } } - /// Insert entity in a table. - /// + /// Submits a batch operation to a table. + /// The message to send. + /// TRhe ordered list of messages and entities. /// The cancellation token to use. /// is null. - public Response> SendBatchRequest(HttpMessage message, CancellationToken cancellationToken = default) + public Response> SendBatchRequest(HttpMessage message, List<(ITableEntity Entity, HttpMessage HttpMessage)> messageList, CancellationToken cancellationToken = default) { if (message == null) { @@ -111,7 +136,25 @@ public Response> SendBatchRequest(HttpMessage message, Cancellati if (responses.Length == 1 && responses.Any(r => r.Status >= 400)) { - throw _clientDiagnostics.CreateRequestFailedException(responses[0]); + // Batch error messages should be formatted as follows: + // "0:" + // where the number prefix is the index of the sub request that failed. + var ex = _clientDiagnostics.CreateRequestFailedException(responses[0]); + + //Get the failed index + var match = s_entityIndexRegex.Match(ex.Message); + + if (match.Success && int.TryParse(match.Groups["index"].Value, out int failedEntityIndex)) + { + // create a new exception with the additional info populated. + // reset the response stream position so we can read it again + var appendedMessage = AppendEntityInfoToMessage(ex.Message, messageList[failedEntityIndex].Entity); + throw new RequestFailedException(ex.Status, appendedMessage, ex.ErrorCode, ex.InnerException); + } + else + { + throw ex; + } } return Response.FromValue(responses.ToList(), message.Response); @@ -120,5 +163,10 @@ public Response> SendBatchRequest(HttpMessage message, Cancellati throw _clientDiagnostics.CreateRequestFailedException(message.Response); } } + + private static string AppendEntityInfoToMessage(string messsage, ITableEntity entity) + { + return messsage += $"\n\nRowKey={entity.RowKey}"; + } } } diff --git a/sdk/tables/Azure.Data.Tables/src/TableTransactionalBatch.cs b/sdk/tables/Azure.Data.Tables/src/TableTransactionalBatch.cs index 396ed102fd2f2..edb7f3844e515 100644 --- a/sdk/tables/Azure.Data.Tables/src/TableTransactionalBatch.cs +++ b/sdk/tables/Azure.Data.Tables/src/TableTransactionalBatch.cs @@ -26,7 +26,7 @@ public partial class TableTransactionalBatch internal Guid _batchGuid = default; internal Guid _changesetGuid = default; internal ConcurrentDictionary _requestLookup = new ConcurrentDictionary(); - internal ConcurrentQueue<(string RowKey, HttpMessage HttpMessage)> _requestMessages = new ConcurrentQueue<(string RowKey, HttpMessage HttpMessage)>(); + internal ConcurrentQueue<(ITableEntity Entity, HttpMessage HttpMessage)> _requestMessages = new ConcurrentQueue<(ITableEntity Entity, HttpMessage HttpMessage)>(); /// /// Initializes a new instance of the class. @@ -78,10 +78,10 @@ internal void SetBatchGuids(Guid batchGuid, Guid changesetGuid) } /// - /// Add an AddEntity requests to the batch. + /// Adds a Table Entity of type to the batch. /// - /// - /// + /// A custom model type that implements or an instance of . + /// The entity to add. public virtual void AddEntity(T entity) where T : class, ITableEntity, new() { var message = _batchOperations.CreateInsertEntityRequest( @@ -92,13 +92,26 @@ internal void SetBatchGuids(Guid batchGuid, Guid changesetGuid) tableEntityProperties: entity.ToOdataAnnotatedDictionary(), queryOptions: new QueryOptions() { Format = _format }); - AddMessage(entity.RowKey, message, RequestType.Create); + AddMessage(entity, message, RequestType.Create); } /// - /// Add an UpdateEntity request to the batch. + /// Adds an UpdateEntity request to the batch which + /// updates the specified table entity of type , if it exists. + /// If the is , the entity will be replaced. + /// If the is , the property values present in the will be merged with the existing entity. /// - /// + /// + /// See for more information about the behavior of the . + /// + /// A custom model type that implements or an instance of . + /// The entity to update. + /// + /// The If-Match value to be used for optimistic concurrency. + /// If is specified, the operation will be executed unconditionally. + /// If the value is specified, the operation will fail with a status of 412 (Precondition Failed) if the value of the entity in the table does not match. + /// + /// Determines the behavior of the Update operation. public virtual void UpdateEntity(T entity, ETag ifMatch, TableUpdateMode mode = TableUpdateMode.Merge) where T : class, ITableEntity, new() { var message = _batchOperations.CreateUpdateEntityRequest( @@ -111,15 +124,20 @@ internal void SetBatchGuids(Guid batchGuid, Guid changesetGuid) tableEntityProperties: entity.ToOdataAnnotatedDictionary(), queryOptions: new QueryOptions() { Format = _format }); - AddMessage(entity.RowKey, message, RequestType.Update); + AddMessage(entity, message, RequestType.Update); } /// /// Add a DeleteEntity request to the batch. /// - /// - /// - /// + /// The partition key of the entity to delete. + /// The row key of the entity to delete. + /// + /// The If-Match value to be used for optimistic concurrency. + /// If is specified, the operation will be executed unconditionally. + /// If the value is specified, the operation will fail with a status of 412 (Precondition Failed) if the value of the entity in the table does not match. + /// The default is to delete unconditionally. + /// public virtual void DeleteEntity(string partitionKey, string rowKey, ETag ifMatch = default) { var message = _batchOperations.CreateDeleteEntityRequest( @@ -131,14 +149,16 @@ public virtual void DeleteEntity(string partitionKey, string rowKey, ETag ifMatc null, queryOptions: new QueryOptions() { Format = _format }); - AddMessage(rowKey, message, RequestType.Delete); + AddMessage(new TableEntity(partitionKey, rowKey) { ETag = ifMatch }, message, RequestType.Delete); } /// - /// Placeholder for batch operations. This is just being used for testing. + /// Submits the batch transaction to the service for execution. + /// The sub-operations contained in the batch will either succeed or fail together as a transaction. /// - /// - /// + /// A controlling the request lifetime. + /// containing a . + /// if the batch transaction fails./> public virtual async Task> SubmitBatchAsync(CancellationToken cancellationToken = default) { var messageList = BuildOrderedBatchRequests(); @@ -148,7 +168,7 @@ public virtual async Task> SubmitBatchAsync(Cancell try { var request = _tableOperations.CreateBatchRequest(_batch, null, null); - var response = await _tableOperations.SendBatchRequestAsync(request, cancellationToken).ConfigureAwait(false); + var response = await _tableOperations.SendBatchRequestAsync(request, messageList, cancellationToken).ConfigureAwait(false); for (int i = 0; i < response.Value.Count; i++) { @@ -165,11 +185,13 @@ public virtual async Task> SubmitBatchAsync(Cancell } /// - /// Placeholder for batch operations. This is just being used for testing. + /// Submits the batch transaction to the service for execution. + /// The sub-operations contained in the batch will either succeed or fail together as a transaction. /// - /// - /// - public virtual Response SubmitBatch(CancellationToken cancellationToken = default) + /// A controlling the request lifetime. + /// containing a . + /// if the batch transaction fails./> + public virtual Response SubmitBatch(CancellationToken cancellationToken = default) { var messageList = BuildOrderedBatchRequests(); @@ -178,7 +200,7 @@ public virtual Response SubmitBatch(CancellationToken can try { var request = _tableOperations.CreateBatchRequest(_batch, null, null); - var response = _tableOperations.SendBatchRequest(request, cancellationToken); + var response = _tableOperations.SendBatchRequest(request, messageList, cancellationToken); for (int i = 0; i < response.Value.Count; i++) { @@ -194,17 +216,25 @@ public virtual Response SubmitBatch(CancellationToken can } } - private bool AddMessage(string rowKey, HttpMessage message, RequestType requestType) + /// + /// Adds a message to the batch to preserve sub-request ordering. + /// + /// trueif the add succeeded, else false. + private bool AddMessage(ITableEntity entity, HttpMessage message, RequestType requestType) { - if (_requestLookup.TryAdd(rowKey, (message, requestType))) + if (_requestLookup.TryAdd(entity.RowKey, (message, requestType))) { - _requestMessages.Enqueue((rowKey, message)); + _requestMessages.Enqueue((entity, message)); return true; } throw new InvalidOperationException("Each entity can only be represented once per batch."); } - private List<(string RowKey, HttpMessage HttpMessage)> BuildOrderedBatchRequests() + /// + /// Builds an ordered list of s containing the batch sub-requests. + /// + /// + private List<(ITableEntity entity, HttpMessage HttpMessage)> BuildOrderedBatchRequests() { var orderedList = _requestMessages.ToList(); foreach (var item in orderedList) diff --git a/sdk/tables/Azure.Data.Tables/tests/SessionRecords/TableClientLiveTests(CosmosTable)/BatchError.json b/sdk/tables/Azure.Data.Tables/tests/SessionRecords/TableClientLiveTests(CosmosTable)/BatchError.json new file mode 100644 index 0000000000000..a7d915194953f --- /dev/null +++ b/sdk/tables/Azure.Data.Tables/tests/SessionRecords/TableClientLiveTests(CosmosTable)/BatchError.json @@ -0,0 +1,152 @@ +{ + "Entries": [ + { + "RequestUri": "https://chrisstablesprim.table.cosmos.azure.com/Tables?$format=application%2Fjson%3Bodata%3Dminimalmetadata", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "Content-Length": "33", + "Content-Type": "application/json; odata=nometadata", + "DataServiceVersion": "3.0", + "traceparent": "00-7233885455f0cd47a91adeb741a2a48d-eb5e982b7f0fb944-00", + "User-Agent": [ + "azsdk-net-Data.Tables/3.0.0-alpha.20201020.1", + "(.NET Core 4.6.29321.03; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "8c17903bbdf868d08f540e7dab2be7ea", + "x-ms-date": "Tue, 20 Oct 2020 18:46:10 GMT", + "x-ms-return-client-request-id": "true", + "x-ms-version": "2019-02-02" + }, + "RequestBody": { + "TableName": "testtablewjbiz3ho" + }, + "StatusCode": 201, + "ResponseHeaders": { + "Content-Type": "application/json", + "Date": "Tue, 20 Oct 2020 18:46:11 GMT", + "ETag": "W/\u0022datetime\u00272020-10-20T18%3A46%3A10.6333192Z\u0027\u0022", + "Location": "https://chrisstablesprim.table.cosmos.azure.com/Tables(\u0027testtablewjbiz3ho\u0027)", + "Server": "Microsoft-HTTPAPI/2.0", + "Transfer-Encoding": "chunked", + "x-ms-request-id": "8c17903b-bdf8-68d0-8f54-0e7dab2be7ea" + }, + "ResponseBody": { + "TableName": "testtablewjbiz3ho", + "odata.metadata": "https://chrisstablesprim.table.cosmos.azure.com/$metadata#Tables/@Element" + } + }, + { + "RequestUri": "https://chrisstablesprim.table.cosmos.azure.com/testtablewjbiz3ho?$format=application%2Fjson%3Bodata%3Dminimalmetadata", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "Content-Length": "665", + "Content-Type": "application/json; odata=nometadata", + "DataServiceVersion": "3.0", + "Prefer": "return-no-content", + "traceparent": "00-330a173eb7d82b498198bc47500ea5b7-53c14588c573a94c-00", + "User-Agent": [ + "azsdk-net-Data.Tables/3.0.0-alpha.20201020.1", + "(.NET Core 4.6.29321.03; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "b75d7e20a795df2e7a2d45fb9d35f15c", + "x-ms-date": "Tue, 20 Oct 2020 18:46:12 GMT", + "x-ms-return-client-request-id": "true", + "x-ms-version": "2019-02-02" + }, + "RequestBody": { + "StringTypeProperty": "This is table entity number 04", + "DatetimeTypeProperty": "2020-01-01T01:05:00.0000000Z", + "DatetimeTypeProperty@odata.type": "Edm.DateTime", + "DatetimeOffsetTypeProperty": "2020-01-01T01:05:00.0000000Z", + "DatetimeOffsetTypeProperty@odata.type": "Edm.DateTime", + "GuidTypeProperty": "0d391d16-97f1-4b9a-be68-4cc871f90004", + "GuidTypeProperty@odata.type": "Edm.Guid", + "BinaryTypeProperty": "AQIDBAU=", + "BinaryTypeProperty@odata.type": "Edm.Binary", + "Int64TypeProperty": "4", + "Int64TypeProperty@odata.type": "Edm.Int64", + "DoubleTypeProperty": 4, + "DoubleTypeProperty@odata.type": "Edm.Double", + "IntTypeProperty": 4, + "PartitionKey": "somPartition", + "RowKey": "04", + "Timestamp": null + }, + "StatusCode": 204, + "ResponseHeaders": { + "Content-Length": "0", + "Date": "Tue, 20 Oct 2020 18:46:11 GMT", + "ETag": "W/\u0022datetime\u00272020-10-20T18%3A46%3A11.2435208Z\u0027\u0022", + "Location": "https://chrisstablesprim.table.cosmos.azure.com/testtablewjbiz3ho(PartitionKey=\u0027somPartition\u0027,RowKey=\u002704\u0027)", + "Preference-Applied": "return-no-content", + "Server": "Microsoft-HTTPAPI/2.0", + "x-ms-request-id": "b75d7e20-a795-df2e-7a2d-45fb9d35f15c" + }, + "ResponseBody": [] + }, + { + "RequestUri": "https://chrisstablesprim.table.cosmos.azure.com/$batch", + "RequestMethod": "POST", + "RequestHeaders": { + "Authorization": "Sanitized", + "Content-Length": "4726", + "Content-Type": "multipart/mixed; boundary=batch_4b8818df-5b37-e915-46fc-209b7732c99f", + "DataServiceVersion": "3.0", + "User-Agent": [ + "azsdk-net-Data.Tables/3.0.0-alpha.20201020.1", + "(.NET Core 4.6.29321.03; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "6c646e8a37312f10db8235d8ee02e977", + "x-ms-date": "Tue, 20 Oct 2020 18:46:12 GMT", + "x-ms-return-client-request-id": "true", + "x-ms-version": "2019-02-02" + }, + "RequestBody": "LS1iYXRjaF80Yjg4MThkZi01YjM3LWU5MTUtNDZmYy0yMDliNzczMmM5OWYNCkNvbnRlbnQtVHlwZTogbXVsdGlwYXJ0L21peGVkOyBib3VuZGFyeT1jaGFuZ2VzZXRfYjBmYTNmMTktYWZkOS0wNjNkLTE2NWYtNmMxMmZmY2UzZWE4DQoNCi0tY2hhbmdlc2V0X2IwZmEzZjE5LWFmZDktMDYzZC0xNjVmLTZjMTJmZmNlM2VhOA0KQ29udGVudC1UeXBlOiBhcHBsaWNhdGlvbi9odHRwDQpDb250ZW50LVRyYW5zZmVyLUVuY29kaW5nOiBiaW5hcnkNCg0KUE9TVCBodHRwczovL2Nocmlzc3RhYmxlc3ByaW0udGFibGUuY29zbW9zLmF6dXJlLmNvbS90ZXN0dGFibGV3amJpejNobz8kZm9ybWF0PWFwcGxpY2F0aW9uJTJGanNvbiUzQm9kYXRhJTNEbWluaW1hbG1ldGFkYXRhIEhUVFAvMS4xDQpIb3N0OiBjaHJpc3N0YWJsZXNwcmltLnRhYmxlLmNvc21vcy5henVyZS5jb20NCngtbXMtdmVyc2lvbjogMjAxOS0wMi0wMg0KRGF0YVNlcnZpY2VWZXJzaW9uOiAzLjANClByZWZlcjogcmV0dXJuLW5vLWNvbnRlbnQNCkFjY2VwdDogYXBwbGljYXRpb24vanNvbg0KQ29udGVudC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IiwiSW50VHlwZVByb3BlcnR5Ijo0LCJQYXJ0aXRpb25LZXkiOiJzb21QYXJ0aXRpb24iLCJSb3dLZXkiOiIwNCIsIlRpbWVzdGFtcCI6bnVsbH0NCi0tY2hhbmdlc2V0X2IwZmEzZjE5LWFmZDktMDYzZC0xNjVmLTZjMTJmZmNlM2VhOC0tDQoNCi0tYmF0Y2hfNGI4ODE4ZGYtNWIzNy1lOTE1LTQ2ZmMtMjA5Yjc3MzJjOTlmLS0NCg==", + "StatusCode": 202, + "ResponseHeaders": { + "Content-Type": "multipart/mixed; boundary=batchresponse_639788fd-fcf3-4b11-8f4f-9399277d3463", + "Date": "Tue, 20 Oct 2020 18:46:11 GMT", + "Server": "Microsoft-HTTPAPI/2.0", + "Transfer-Encoding": "chunked", + "x-ms-request-id": "6c646e8a-3731-2f10-db82-35d8ee02e977" + }, + "ResponseBody": "LS1iYXRjaHJlc3BvbnNlXzYzOTc4OGZkLWZjZjMtNGIxMS04ZjRmLTkzOTkyNzdkMzQ2MwpDb250ZW50LVR5cGU6IG11bHRpcGFydC9taXhlZDsgYm91bmRhcnk9Y2hhbmdlc2V0cmVzcG9uc2VfMGQwNzcxNDctMmNlMy00YTk0LTg3N2QtZDVkODJkYjUxM2RlDQoNCi0tY2hhbmdlc2V0cmVzcG9uc2VfMGQwNzcxNDctMmNlMy00YTk0LTg3N2QtZDVkODJkYjUxM2RlCkNvbnRlbnQtVHlwZTogYXBwbGljYXRpb24vaHR0cApDb250ZW50LVRyYW5zZmVyLUVuY29kaW5nOiBiaW5hcnkKCkhUVFAvMS4xIDQwOSBDb25mbGljdA0KQ29udGVudC1UeXBlOiBhcHBsaWNhdGlvbi9qc29uO29kYXRhPWZ1bGxtZXRhZGF0YQ0KDQp7Im9kYXRhLmVycm9yIjp7ImNvZGUiOiJFbnRpdHlBbHJlYWR5RXhpc3RzIiwibWVzc2FnZSI6eyJsYW5nIjoiZW4tdXMiLCJ2YWx1ZSI6IjM6VGhlIHNwZWNpZmllZCBlbnRpdHkgYWxyZWFkeSBleGlzdHMuXG5cblJlcXVlc3RJRDo2YzY0NmU4YS0zNzMxLTJmMTAtZGI4Mi0zNWQ4ZWUwMmU5NzdcbiJ9fX0NCi0tY2hhbmdlc2V0cmVzcG9uc2VfMGQwNzcxNDctMmNlMy00YTk0LTg3N2QtZDVkODJkYjUxM2RlLS0KLS1iYXRjaHJlc3BvbnNlXzYzOTc4OGZkLWZjZjMtNGIxMS04ZjRmLTkzOTkyNzdkMzQ2My0tDQo=" + }, + { + "RequestUri": "https://chrisstablesprim.table.cosmos.azure.com/Tables(\u0027testtablewjbiz3ho\u0027)", + "RequestMethod": "DELETE", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "traceparent": "00-5058579520aecb439bd84a86ca3a802a-0b38af39f469bb4c-00", + "User-Agent": [ + "azsdk-net-Data.Tables/3.0.0-alpha.20201020.1", + "(.NET Core 4.6.29321.03; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "f87a77be12d57209101a35ab694168e1", + "x-ms-date": "Tue, 20 Oct 2020 18:46:12 GMT", + "x-ms-return-client-request-id": "true", + "x-ms-version": "2019-02-02" + }, + "RequestBody": null, + "StatusCode": 204, + "ResponseHeaders": { + "Content-Length": "0", + "Date": "Tue, 20 Oct 2020 18:46:11 GMT", + "Server": "Microsoft-HTTPAPI/2.0", + "x-ms-request-id": "f87a77be-12d5-7209-101a-35ab694168e1" + }, + "ResponseBody": [] + } + ], + "Variables": { + "COSMOS_TABLES_ENDPOINT_SUFFIX": null, + "RandomSeed": "527508301", + "TABLES_COSMOS_ACCOUNT_NAME": "chrisstablesprim", + "TABLES_PRIMARY_COSMOS_ACCOUNT_KEY": "Kg==" + } +} \ No newline at end of file diff --git a/sdk/tables/Azure.Data.Tables/tests/SessionRecords/TableClientLiveTests(CosmosTable)/BatchErrorAsync.json b/sdk/tables/Azure.Data.Tables/tests/SessionRecords/TableClientLiveTests(CosmosTable)/BatchErrorAsync.json new file mode 100644 index 0000000000000..7019228ac00e2 --- /dev/null +++ b/sdk/tables/Azure.Data.Tables/tests/SessionRecords/TableClientLiveTests(CosmosTable)/BatchErrorAsync.json @@ -0,0 +1,152 @@ +{ + "Entries": [ + { + "RequestUri": "https://chrisstablesprim.table.cosmos.azure.com/Tables?$format=application%2Fjson%3Bodata%3Dminimalmetadata", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "Content-Length": "33", + "Content-Type": "application/json; odata=nometadata", + "DataServiceVersion": "3.0", + "traceparent": "00-883bd8b785f343449731d8c8e7f93f9f-5060701d30f9d944-00", + "User-Agent": [ + "azsdk-net-Data.Tables/3.0.0-alpha.20201020.1", + "(.NET Core 4.6.29321.03; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "3a7087a3acdad1a1ceaadddf9a781f4f", + "x-ms-date": "Tue, 20 Oct 2020 18:46:14 GMT", + "x-ms-return-client-request-id": "true", + "x-ms-version": "2019-02-02" + }, + "RequestBody": { + "TableName": "testtable4kxrd1j9" + }, + "StatusCode": 201, + "ResponseHeaders": { + "Content-Type": "application/json", + "Date": "Tue, 20 Oct 2020 18:46:13 GMT", + "ETag": "W/\u0022datetime\u00272020-10-20T18%3A46%3A12.9828872Z\u0027\u0022", + "Location": "https://chrisstablesprim.table.cosmos.azure.com/Tables(\u0027testtable4kxrd1j9\u0027)", + "Server": "Microsoft-HTTPAPI/2.0", + "Transfer-Encoding": "chunked", + "x-ms-request-id": "3a7087a3-acda-d1a1-ceaa-dddf9a781f4f" + }, + "ResponseBody": { + "TableName": "testtable4kxrd1j9", + "odata.metadata": "https://chrisstablesprim.table.cosmos.azure.com/$metadata#Tables/@Element" + } + }, + { + "RequestUri": "https://chrisstablesprim.table.cosmos.azure.com/testtable4kxrd1j9?$format=application%2Fjson%3Bodata%3Dminimalmetadata", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "Content-Length": "665", + "Content-Type": "application/json; odata=nometadata", + "DataServiceVersion": "3.0", + "Prefer": "return-no-content", + "traceparent": "00-1d9770fd68ed8e4a805d6e8bac129ed0-b14cbceeb3c95d4f-00", + "User-Agent": [ + "azsdk-net-Data.Tables/3.0.0-alpha.20201020.1", + "(.NET Core 4.6.29321.03; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "d08c3d01b8b49a53ae344bc5ad959511", + "x-ms-date": "Tue, 20 Oct 2020 18:46:14 GMT", + "x-ms-return-client-request-id": "true", + "x-ms-version": "2019-02-02" + }, + "RequestBody": { + "StringTypeProperty": "This is table entity number 04", + "DatetimeTypeProperty": "2020-01-01T01:05:00.0000000Z", + "DatetimeTypeProperty@odata.type": "Edm.DateTime", + "DatetimeOffsetTypeProperty": "2020-01-01T01:05:00.0000000Z", + "DatetimeOffsetTypeProperty@odata.type": "Edm.DateTime", + "GuidTypeProperty": "0d391d16-97f1-4b9a-be68-4cc871f90004", + "GuidTypeProperty@odata.type": "Edm.Guid", + "BinaryTypeProperty": "AQIDBAU=", + "BinaryTypeProperty@odata.type": "Edm.Binary", + "Int64TypeProperty": "4", + "Int64TypeProperty@odata.type": "Edm.Int64", + "DoubleTypeProperty": 4, + "DoubleTypeProperty@odata.type": "Edm.Double", + "IntTypeProperty": 4, + "PartitionKey": "somPartition", + "RowKey": "04", + "Timestamp": null + }, + "StatusCode": 204, + "ResponseHeaders": { + "Content-Length": "0", + "Date": "Tue, 20 Oct 2020 18:46:13 GMT", + "ETag": "W/\u0022datetime\u00272020-10-20T18%3A46%3A13.4793224Z\u0027\u0022", + "Location": "https://chrisstablesprim.table.cosmos.azure.com/testtable4kxrd1j9(PartitionKey=\u0027somPartition\u0027,RowKey=\u002704\u0027)", + "Preference-Applied": "return-no-content", + "Server": "Microsoft-HTTPAPI/2.0", + "x-ms-request-id": "d08c3d01-b8b4-9a53-ae34-4bc5ad959511" + }, + "ResponseBody": [] + }, + { + "RequestUri": "https://chrisstablesprim.table.cosmos.azure.com/$batch", + "RequestMethod": "POST", + "RequestHeaders": { + "Authorization": "Sanitized", + "Content-Length": "4726", + "Content-Type": "multipart/mixed; boundary=batch_e3aea4e0-09f2-3bd9-ef14-ff0c3cbca4bd", + "DataServiceVersion": "3.0", + "User-Agent": [ + "azsdk-net-Data.Tables/3.0.0-alpha.20201020.1", + "(.NET Core 4.6.29321.03; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "029f200688eafa2b070dcd033f620af7", + "x-ms-date": "Tue, 20 Oct 2020 18:46:14 GMT", + "x-ms-return-client-request-id": "true", + "x-ms-version": "2019-02-02" + }, + "RequestBody": "LS1iYXRjaF9lM2FlYTRlMC0wOWYyLTNiZDktZWYxNC1mZjBjM2NiY2E0YmQNCkNvbnRlbnQtVHlwZTogbXVsdGlwYXJ0L21peGVkOyBib3VuZGFyeT1jaGFuZ2VzZXRfOTY4ZTk4NDAtZTYyNC1hMTlkLTE2ZWUtYzk3NzMxZjdmYzBiDQoNCi0tY2hhbmdlc2V0Xzk2OGU5ODQwLWU2MjQtYTE5ZC0xNmVlLWM5NzczMWY3ZmMwYg0KQ29udGVudC1UeXBlOiBhcHBsaWNhdGlvbi9odHRwDQpDb250ZW50LVRyYW5zZmVyLUVuY29kaW5nOiBiaW5hcnkNCg0KUE9TVCBodHRwczovL2Nocmlzc3RhYmxlc3ByaW0udGFibGUuY29zbW9zLmF6dXJlLmNvbS90ZXN0dGFibGU0a3hyZDFqOT8kZm9ybWF0PWFwcGxpY2F0aW9uJTJGanNvbiUzQm9kYXRhJTNEbWluaW1hbG1ldGFkYXRhIEhUVFAvMS4xDQpIb3N0OiBjaHJpc3N0YWJsZXNwcmltLnRhYmxlLmNvc21vcy5henVyZS5jb20NCngtbXMtdmVyc2lvbjogMjAxOS0wMi0wMg0KRGF0YVNlcnZpY2VWZXJzaW9uOiAzLjANClByZWZlcjogcmV0dXJuLW5vLWNvbnRlbnQNCkFjY2VwdDogYXBwbGljYXRpb24vanNvbg0KQ29udGVudC1UeXBlOiB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0uRG91YmxlIiwiSW50VHlwZVByb3BlcnR5Ijo0LCJQYXJ0aXRpb25LZXkiOiJzb21QYXJ0aXRpb24iLCJSb3dLZXkiOiIwNCIsIlRpbWVzdGFtcCI6bnVsbH0NCi0tY2hhbmdlc2V0Xzk2OGU5ODQwLWU2MjQtYTE5ZC0xNmVlLWM5NzczMWY3ZmMwYi0tDQoNCi0tYmF0Y2hfZTNhZWE0ZTAtMDlmMi0zYmQ5LWVmMTQtZmYwYzNjYmNhNGJkLS0NCg==", + "StatusCode": 202, + "ResponseHeaders": { + "Content-Type": "multipart/mixed; boundary=batchresponse_d63e3589-45f6-4a87-a431-defb55095b61", + "Date": "Tue, 20 Oct 2020 18:46:13 GMT", + "Server": "Microsoft-HTTPAPI/2.0", + "Transfer-Encoding": "chunked", + "x-ms-request-id": "029f2006-88ea-fa2b-070d-cd033f620af7" + }, + "ResponseBody": "LS1iYXRjaHJlc3BvbnNlX2Q2M2UzNTg5LTQ1ZjYtNGE4Ny1hNDMxLWRlZmI1NTA5NWI2MQpDb250ZW50LVR5cGU6IG11bHRpcGFydC9taXhlZDsgYm91bmRhcnk9Y2hhbmdlc2V0cmVzcG9uc2VfYjdhODlkZWQtYTA4OS00ZWRmLTgwZjQtYjNhMmU0NDVkZmNhDQoNCi0tY2hhbmdlc2V0cmVzcG9uc2VfYjdhODlkZWQtYTA4OS00ZWRmLTgwZjQtYjNhMmU0NDVkZmNhCkNvbnRlbnQtVHlwZTogYXBwbGljYXRpb24vaHR0cApDb250ZW50LVRyYW5zZmVyLUVuY29kaW5nOiBiaW5hcnkKCkhUVFAvMS4xIDQwOSBDb25mbGljdA0KQ29udGVudC1UeXBlOiBhcHBsaWNhdGlvbi9qc29uO29kYXRhPWZ1bGxtZXRhZGF0YQ0KDQp7Im9kYXRhLmVycm9yIjp7ImNvZGUiOiJFbnRpdHlBbHJlYWR5RXhpc3RzIiwibWVzc2FnZSI6eyJsYW5nIjoiZW4tdXMiLCJ2YWx1ZSI6IjM6VGhlIHNwZWNpZmllZCBlbnRpdHkgYWxyZWFkeSBleGlzdHMuXG5cblJlcXVlc3RJRDowMjlmMjAwNi04OGVhLWZhMmItMDcwZC1jZDAzM2Y2MjBhZjdcbiJ9fX0NCi0tY2hhbmdlc2V0cmVzcG9uc2VfYjdhODlkZWQtYTA4OS00ZWRmLTgwZjQtYjNhMmU0NDVkZmNhLS0KLS1iYXRjaHJlc3BvbnNlX2Q2M2UzNTg5LTQ1ZjYtNGE4Ny1hNDMxLWRlZmI1NTA5NWI2MS0tDQo=" + }, + { + "RequestUri": "https://chrisstablesprim.table.cosmos.azure.com/Tables(\u0027testtable4kxrd1j9\u0027)", + "RequestMethod": "DELETE", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "traceparent": "00-772678d756b1de4b82b353d8a1df39ee-7752c13f68d7164b-00", + "User-Agent": [ + "azsdk-net-Data.Tables/3.0.0-alpha.20201020.1", + "(.NET Core 4.6.29321.03; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "fe0af318d42f870845f4e8f09ad8f380", + "x-ms-date": "Tue, 20 Oct 2020 18:46:14 GMT", + "x-ms-return-client-request-id": "true", + "x-ms-version": "2019-02-02" + }, + "RequestBody": null, + "StatusCode": 204, + "ResponseHeaders": { + "Content-Length": "0", + "Date": "Tue, 20 Oct 2020 18:46:13 GMT", + "Server": "Microsoft-HTTPAPI/2.0", + "x-ms-request-id": "fe0af318-d42f-8708-45f4-e8f09ad8f380" + }, + "ResponseBody": [] + } + ], + "Variables": { + "COSMOS_TABLES_ENDPOINT_SUFFIX": null, + "RandomSeed": "1558064397", + "TABLES_COSMOS_ACCOUNT_NAME": "chrisstablesprim", + "TABLES_PRIMARY_COSMOS_ACCOUNT_KEY": "Kg==" + } +} \ No newline at end of file diff --git a/sdk/tables/Azure.Data.Tables/tests/SessionRecords/TableClientLiveTests(Storage)/BatchError.json b/sdk/tables/Azure.Data.Tables/tests/SessionRecords/TableClientLiveTests(Storage)/BatchError.json new file mode 100644 index 0000000000000..0bc45aef8f069 --- /dev/null +++ b/sdk/tables/Azure.Data.Tables/tests/SessionRecords/TableClientLiveTests(Storage)/BatchError.json @@ -0,0 +1,180 @@ +{ + "Entries": [ + { + "RequestUri": "https://chrisstablesprim.table.core.windows.net/Tables?$format=application%2Fjson%3Bodata%3Dminimalmetadata", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "Content-Length": "33", + "Content-Type": "application/json; odata=nometadata", + "DataServiceVersion": "3.0", + "traceparent": "00-696811e0e93b584293d4f4eb2d5aecfc-f5ad9aa0f801014e-00", + "User-Agent": [ + "azsdk-net-Data.Tables/3.0.0-alpha.20201020.1", + "(.NET Core 4.6.29321.03; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "4b3907fa5e2b86af2546a396f61f7ca6", + "x-ms-date": "Tue, 20 Oct 2020 18:46:13 GMT", + "x-ms-return-client-request-id": "true", + "x-ms-version": "2019-02-02" + }, + "RequestBody": { + "TableName": "testtableoa8b2exg" + }, + "StatusCode": 201, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Type": "application/json; odata=minimalmetadata; streaming=true; charset=utf-8", + "Date": "Tue, 20 Oct 2020 18:46:12 GMT", + "Location": "https://chrisstablesprim.table.core.windows.net/Tables(\u0027testtableoa8b2exg\u0027)", + "Server": [ + "Windows-Azure-Table/1.0", + "Microsoft-HTTPAPI/2.0" + ], + "Transfer-Encoding": "chunked", + "X-Content-Type-Options": "nosniff", + "x-ms-client-request-id": "4b3907fa5e2b86af2546a396f61f7ca6", + "x-ms-request-id": "b5f7ad04-6002-0057-0411-a70d2a000000", + "x-ms-version": "2019-02-02" + }, + "ResponseBody": { + "odata.metadata": "https://chrisstablesprim.table.core.windows.net/$metadata#Tables/@Element", + "TableName": "testtableoa8b2exg" + } + }, + { + "RequestUri": "https://chrisstablesprim.table.core.windows.net/testtableoa8b2exg?$format=application%2Fjson%3Bodata%3Dminimalmetadata", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "Content-Length": "665", + "Content-Type": "application/json; odata=nometadata", + "DataServiceVersion": "3.0", + "Prefer": "return-no-content", + "traceparent": "00-83e3c7aa89999b47a83734b5c0b73e8b-7a7f6d7685db2b4e-00", + "User-Agent": [ + "azsdk-net-Data.Tables/3.0.0-alpha.20201020.1", + "(.NET Core 4.6.29321.03; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "d976551845d062f4744fa8dddd998ede", + "x-ms-date": "Tue, 20 Oct 2020 18:46:13 GMT", + "x-ms-return-client-request-id": "true", + "x-ms-version": "2019-02-02" + }, + "RequestBody": { + "StringTypeProperty": "This is table entity number 04", + "DatetimeTypeProperty": "2020-01-01T01:05:00.0000000Z", + "DatetimeTypeProperty@odata.type": "Edm.DateTime", + "DatetimeOffsetTypeProperty": "2020-01-01T01:05:00.0000000Z", + "DatetimeOffsetTypeProperty@odata.type": "Edm.DateTime", + "GuidTypeProperty": "0d391d16-97f1-4b9a-be68-4cc871f90004", + "GuidTypeProperty@odata.type": "Edm.Guid", + "BinaryTypeProperty": "AQIDBAU=", + "BinaryTypeProperty@odata.type": "Edm.Binary", + "Int64TypeProperty": "4", + "Int64TypeProperty@odata.type": "Edm.Int64", + "DoubleTypeProperty": 4, + "DoubleTypeProperty@odata.type": "Edm.Double", + "IntTypeProperty": 4, + "PartitionKey": "somPartition", + "RowKey": "04", + "Timestamp": null + }, + "StatusCode": 204, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "0", + "DataServiceId": "https://chrisstablesprim.table.core.windows.net/testtableoa8b2exg(PartitionKey=\u0027somPartition\u0027,RowKey=\u002704\u0027)", + "Date": "Tue, 20 Oct 2020 18:46:12 GMT", + "ETag": "W/\u0022datetime\u00272020-10-20T18%3A46%3A12.5562869Z\u0027\u0022", + "Location": "https://chrisstablesprim.table.core.windows.net/testtableoa8b2exg(PartitionKey=\u0027somPartition\u0027,RowKey=\u002704\u0027)", + "Preference-Applied": "return-no-content", + "Server": [ + "Windows-Azure-Table/1.0", + "Microsoft-HTTPAPI/2.0" + ], + "X-Content-Type-Options": "nosniff", + "x-ms-client-request-id": "d976551845d062f4744fa8dddd998ede", + "x-ms-request-id": "b5f7ad08-6002-0057-0611-a70d2a000000", + "x-ms-version": "2019-02-02" + }, + "ResponseBody": [] + }, + { + "RequestUri": "https://chrisstablesprim.table.core.windows.net/$batch", + "RequestMethod": "POST", + "RequestHeaders": { + "Authorization": "Sanitized", + "Content-Length": "4726", + "Content-Type": "multipart/mixed; boundary=batch_96bedb0b-983c-ea92-a34e-8015f8476e69", + "DataServiceVersion": "3.0", + "User-Agent": [ + "azsdk-net-Data.Tables/3.0.0-alpha.20201020.1", + "(.NET Core 4.6.29321.03; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "d9d13ad793c29b6e220fcaf2ae963d6b", + "x-ms-date": "Tue, 20 Oct 2020 18:46:13 GMT", + "x-ms-return-client-request-id": "true", + "x-ms-version": "2019-02-02" + }, + "RequestBody": "LS1iYXRjaF85NmJlZGIwYi05ODNjLWVhOTItYTM0ZS04MDE1Zjg0NzZlNjkNCkNvbnRlbnQtVHlwZTogbXVsdGlwYXJ0L21peGVkOyBib3VuZGFyeT1jaGFuZ2VzZXRfZTg1ZDFkYzQtNzAzOC1hZmI4LWNiNGEtZTlmY2FkMzc2NjFhDQoNCi0tY2hhbmdlc2V0X2U4NWQxZGM0LTcwMzgtYWZiOC1jYjRhLWU5ZmNhZDM3NjYxYQ0KQ29udGVudC1UeXBlOiBhcHBsaWNhdGlvbi9odHRwDQpDb250ZW50LVRyYW5zZmVyLUVuY29kaW5nOiBiaW5hcnkNCg0KUE9TVCBodHRwczovL2Nocmlzc3RhYmxlc3ByaW0udGFibGUuY29yZS53aW5kb3dzLm5ldC90ZXN0dGFibGVvYThiMmV4Zz8kZm9ybWF0PWFwcGxpY2F0aW9uJTJGanNvbiUzQm9kYXRhJTNEbWluaW1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RSURCQVU9IiwiQmluYXJ5VHlwZVByb3BlcnR5QG9kYXRhLnR5cGUiOiJFZG0uQmluYXJ5IiwiSW50NjRUeXBlUHJvcGVydHkiOiI0IiwiSW50NjRUeXBlUHJvcGVydHlAb2RhdGEudHlwZSI6IkVkbS5JbnQ2NCIsIkRvdWJsZVR5cGVQcm9wZXJ0eSI6NCwiRG91YmxlVHlwZVByb3BlcnR5QG9kYXRhLnR5cGUiOiJFZG0uRG91YmxlIiwiSW50VHlwZVByb3BlcnR5Ijo0LCJQYXJ0aXRpb25LZXkiOiJzb21QYXJ0aXRpb24iLCJSb3dLZXkiOiIwNCIsIlRpbWVzdGFtcCI6bnVsbH0NCi0tY2hhbmdlc2V0X2U4NWQxZGM0LTcwMzgtYWZiOC1jYjRhLWU5ZmNhZDM3NjYxYS0tDQoNCi0tYmF0Y2hfOTZiZWRiMGItOTgzYy1lYTkyLWEzNGUtODAxNWY4NDc2ZTY5LS0NCg==", + "StatusCode": 202, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Type": "multipart/mixed; boundary=batchresponse_2826f879-c6ff-485f-b7d1-438415945b42", + "Date": "Tue, 20 Oct 2020 18:46:12 GMT", + "Server": [ + "Windows-Azure-Table/1.0", + "Microsoft-HTTPAPI/2.0" + ], + "Transfer-Encoding": "chunked", + "X-Content-Type-Options": "nosniff", + "x-ms-client-request-id": "d9d13ad793c29b6e220fcaf2ae963d6b", + "x-ms-request-id": "b5f7ad0a-6002-0057-0811-a70d2a000000", + "x-ms-version": "2019-02-02" + }, + "ResponseBody": "LS1iYXRjaHJlc3BvbnNlXzI4MjZmODc5LWM2ZmYtNDg1Zi1iN2QxLTQzODQxNTk0NWI0Mg0KQ29udGVudC1UeXBlOiBtdWx0aXBhcnQvbWl4ZWQ7IGJvdW5kYXJ5PWNoYW5nZXNldHJlc3BvbnNlX2E1ZGE1NTEwLTA2N2EtNGUyNi05ODRkLWNlNjBkNDRhNDljOQ0KDQotLWNoYW5nZXNldHJlc3BvbnNlX2E1ZGE1NTEwLTA2N2EtNGUyNi05ODRkLWNlNjBkNDRhNDljOQ0KQ29udGVudC1UeXBlOiBhcHBsaWNhdGlvbi9odHRwDQpDb250ZW50LVRyYW5zZmVyLUVuY29kaW5nOiBiaW5hcnkNCg0KSFRUUC8xLjEgNDA5IENvbmZsaWN0DQpYLUNvbnRlbnQtVHlwZS1PcHRpb25zOiBub3NuaWZmDQpDYWNoZS1Db250cm9sOiBuby1jYWNoZQ0KUHJlZmVyZW5jZS1BcHBsaWVkOiByZXR1cm4tbm8tY29udGVudA0KRGF0YVNlcnZpY2VWZXJzaW9uOiAzLjA7DQpDb250ZW50LVR5cGU6IGFwcGxpY2F0aW9uL2pzb247b2RhdGE9bWluaW1hbG1ldGFkYXRhO3N0cmVhbWluZz10cnVlO2NoYXJzZXQ9dXRmLTgNCg0KeyJvZGF0YS5lcnJvciI6eyJjb2RlIjoiRW50aXR5QWxyZWFkeUV4aXN0cyIsIm1lc3NhZ2UiOnsibGFuZyI6ImVuLVVTIiwidmFsdWUiOiIzOlRoZSBzcGVjaWZpZWQgZW50aXR5IGFscmVhZHkgZXhpc3RzLlxuUmVxdWVzdElkOmI1ZjdhZDBhLTYwMDItMDA1Ny0wODExLWE3MGQyYTAwMDAwMFxuVGltZToyMDIwLTEwLTIwVDE4OjQ2OjEyLjYyNjMzNjdaIn19fQ0KLS1jaGFuZ2VzZXRyZXNwb25zZV9hNWRhNTUxMC0wNjdhLTRlMjYtOTg0ZC1jZTYwZDQ0YTQ5YzktLQ0KLS1iYXRjaHJlc3BvbnNlXzI4MjZmODc5LWM2ZmYtNDg1Zi1iN2QxLTQzODQxNTk0NWI0Mi0tDQo=" + }, + { + "RequestUri": "https://chrisstablesprim.table.core.windows.net/Tables(\u0027testtableoa8b2exg\u0027)", + "RequestMethod": "DELETE", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "traceparent": "00-1cc264a5122d5c438c79a9d445bd7048-ea798e589e468748-00", + "User-Agent": [ + "azsdk-net-Data.Tables/3.0.0-alpha.20201020.1", + "(.NET Core 4.6.29321.03; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "a3fc66e795d07f9828fb74e9c7dbd131", + "x-ms-date": "Tue, 20 Oct 2020 18:46:13 GMT", + "x-ms-return-client-request-id": "true", + "x-ms-version": "2019-02-02" + }, + "RequestBody": null, + "StatusCode": 204, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "0", + "Date": "Tue, 20 Oct 2020 18:46:12 GMT", + "Server": [ + "Windows-Azure-Table/1.0", + "Microsoft-HTTPAPI/2.0" + ], + "X-Content-Type-Options": "nosniff", + "x-ms-client-request-id": "a3fc66e795d07f9828fb74e9c7dbd131", + "x-ms-request-id": "b5f7ad0d-6002-0057-0a11-a70d2a000000", + "x-ms-version": "2019-02-02" + }, + "ResponseBody": [] + } + ], + "Variables": { + "RandomSeed": "1743747818", + "STORAGE_ENDPOINT_SUFFIX": "core.windows.net", + "TABLES_PRIMARY_STORAGE_ACCOUNT_KEY": "Kg==", + "TABLES_STORAGE_ACCOUNT_NAME": "chrisstablesprim" + } +} \ No newline at end of file diff --git a/sdk/tables/Azure.Data.Tables/tests/SessionRecords/TableClientLiveTests(Storage)/BatchErrorAsync.json b/sdk/tables/Azure.Data.Tables/tests/SessionRecords/TableClientLiveTests(Storage)/BatchErrorAsync.json new file mode 100644 index 0000000000000..f80076441b3eb --- /dev/null +++ b/sdk/tables/Azure.Data.Tables/tests/SessionRecords/TableClientLiveTests(Storage)/BatchErrorAsync.json @@ -0,0 +1,180 @@ +{ + "Entries": [ + { + "RequestUri": "https://chrisstablesprim.table.core.windows.net/Tables?$format=application%2Fjson%3Bodata%3Dminimalmetadata", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "Content-Length": "33", + "Content-Type": "application/json; odata=nometadata", + "DataServiceVersion": "3.0", + "traceparent": "00-558c4462d0a3324a8709daa11e0e05d7-06d19e8825016d44-00", + "User-Agent": [ + "azsdk-net-Data.Tables/3.0.0-alpha.20201020.1", + "(.NET Core 4.6.29321.03; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "11d5e52b4a8cd803424500c03157ac48", + "x-ms-date": "Tue, 20 Oct 2020 18:42:22 GMT", + "x-ms-return-client-request-id": "true", + "x-ms-version": "2019-02-02" + }, + "RequestBody": { + "TableName": "testtableffd8yxl9" + }, + "StatusCode": 201, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Type": "application/json; odata=minimalmetadata; streaming=true; charset=utf-8", + "Date": "Tue, 20 Oct 2020 18:42:20 GMT", + "Location": "https://chrisstablesprim.table.core.windows.net/Tables(\u0027testtableffd8yxl9\u0027)", + "Server": [ + "Windows-Azure-Table/1.0", + "Microsoft-HTTPAPI/2.0" + ], + "Transfer-Encoding": "chunked", + "X-Content-Type-Options": "nosniff", + "x-ms-client-request-id": "11d5e52b4a8cd803424500c03157ac48", + "x-ms-request-id": "db7ae511-e002-0004-4e10-a72e1e000000", + "x-ms-version": "2019-02-02" + }, + "ResponseBody": { + "odata.metadata": "https://chrisstablesprim.table.core.windows.net/$metadata#Tables/@Element", + "TableName": "testtableffd8yxl9" + } + }, + { + "RequestUri": "https://chrisstablesprim.table.core.windows.net/testtableffd8yxl9?$format=application%2Fjson%3Bodata%3Dminimalmetadata", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "Content-Length": "665", + "Content-Type": "application/json; odata=nometadata", + "DataServiceVersion": "3.0", + "Prefer": "return-no-content", + "traceparent": "00-cb4580e5b2df8442bd659e9663a443df-db2d454b32634d4f-00", + "User-Agent": [ + "azsdk-net-Data.Tables/3.0.0-alpha.20201020.1", + "(.NET Core 4.6.29321.03; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "5e2e576d666730663a5aef62dfd2bd00", + "x-ms-date": "Tue, 20 Oct 2020 18:42:22 GMT", + "x-ms-return-client-request-id": "true", + "x-ms-version": "2019-02-02" + }, + "RequestBody": { + "StringTypeProperty": "This is table entity number 04", + "DatetimeTypeProperty": "2020-01-01T01:05:00.0000000Z", + "DatetimeTypeProperty@odata.type": "Edm.DateTime", + "DatetimeOffsetTypeProperty": "2020-01-01T01:05:00.0000000Z", + "DatetimeOffsetTypeProperty@odata.type": "Edm.DateTime", + "GuidTypeProperty": "0d391d16-97f1-4b9a-be68-4cc871f90004", + "GuidTypeProperty@odata.type": "Edm.Guid", + "BinaryTypeProperty": "AQIDBAU=", + "BinaryTypeProperty@odata.type": "Edm.Binary", + "Int64TypeProperty": "4", + "Int64TypeProperty@odata.type": "Edm.Int64", + "DoubleTypeProperty": 4, + "DoubleTypeProperty@odata.type": "Edm.Double", + "IntTypeProperty": 4, + "PartitionKey": "somPartition", + "RowKey": "04", + "Timestamp": null + }, + "StatusCode": 204, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "0", + "DataServiceId": "https://chrisstablesprim.table.core.windows.net/testtableffd8yxl9(PartitionKey=\u0027somPartition\u0027,RowKey=\u002704\u0027)", + "Date": "Tue, 20 Oct 2020 18:42:20 GMT", + "ETag": "W/\u0022datetime\u00272020-10-20T18%3A42%3A21.5509246Z\u0027\u0022", + "Location": "https://chrisstablesprim.table.core.windows.net/testtableffd8yxl9(PartitionKey=\u0027somPartition\u0027,RowKey=\u002704\u0027)", + "Preference-Applied": "return-no-content", + "Server": [ + "Windows-Azure-Table/1.0", + "Microsoft-HTTPAPI/2.0" + ], + "X-Content-Type-Options": "nosniff", + "x-ms-client-request-id": "5e2e576d666730663a5aef62dfd2bd00", + "x-ms-request-id": "db7ae51f-e002-0004-5a10-a72e1e000000", + "x-ms-version": "2019-02-02" + }, + "ResponseBody": [] + }, + { + "RequestUri": "https://chrisstablesprim.table.core.windows.net/$batch", + "RequestMethod": "POST", + "RequestHeaders": { + "Authorization": "Sanitized", + "Content-Length": "4726", + "Content-Type": "multipart/mixed; boundary=batch_c06974a7-fad0-7baa-2229-6a311b416157", + "DataServiceVersion": "3.0", + "User-Agent": [ + "azsdk-net-Data.Tables/3.0.0-alpha.20201020.1", + "(.NET Core 4.6.29321.03; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "24e8a8e4e2bebb21d37596c9351f40a9", + "x-ms-date": "Tue, 20 Oct 2020 18:42:22 GMT", + "x-ms-return-client-request-id": "true", + "x-ms-version": "2019-02-02" + }, + "RequestBody": "LS1iYXRjaF9jMDY5NzRhNy1mYWQwLTdiYWEtMjIyOS02YTMxMWI0MTYxNTcNCkNvbnRlbnQtVHlwZTogbXVsdGlwYXJ0L21peGVkOyBib3VuZGFyeT1jaGFuZ2VzZXRfY2E5OTBkZDctZWMyNi1mNGExLTI5MDctYzQ4YjNhNzhlZWFhDQoNCi0tY2hhbmdlc2V0X2NhOTkwZGQ3LWVjMjYtZjRhMS0yOTA3LWM0OGIzYTc4ZWVhYQ0KQ29udGVudC1UeXBlOiBhcHBsaWNhdGlvbi9odHRwDQpDb250ZW50LVRyYW5zZmVyLUVuY29kaW5nOiBiaW5hcnkNCg0KUE9TVCBodHRwczovL2Nocmlzc3RhYmxlc3ByaW0udGFibGUuY29yZS53aW5kb3dzLm5ldC90ZXN0dGFibGVmZmQ4eXhsOT8kZm9ybWF0PWFwcGxpY2F0aW9uJTJGanNvbiUzQm9kYXRhJTNEbWluaW1hbG1ldGFkYXRhIEhUVFAvMS4xDQpIb3N0OiBjaHJpc3N0YWJsZXNwcmltLnRhYmxlLmNvcmUud2luZG93cy5uZXQNCngtbXMtdmVyc2lvbjogMjAxOS0wMi0wMg0KRGF0YVNlcnZpY2VWZXJzaW9uOiAzLjANClByZWZlcjogcmV0dXJuLW5vLWNvbnRlbnQNCkFjY2VwdDogYXBwbGljYXRpb24vanNvbg0KQ29udGVudC1UeXBlOiBhcHBsaWNhdGlvbi9qc29uO29kYXRhPW5vbWV0YWRhdGENCg0KeyJTdHJpbmdUeXBlUHJvcGVydHkiOiJUaGlzIGlzIHRhYmxlIGV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wNCIsIlRpbWVzdGFtcCI6bnVsbH0NCi0tY2hhbmdlc2V0X2NhOTkwZGQ3LWVjMjYtZjRhMS0yOTA3LWM0OGIzYTc4ZWVhYS0tDQoNCi0tYmF0Y2hfYzA2OTc0YTctZmFkMC03YmFhLTIyMjktNmEzMTFiNDE2MTU3LS0NCg==", + "StatusCode": 202, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Type": "multipart/mixed; boundary=batchresponse_bc611fe6-5a16-4538-bbfd-b0c3783938d9", + "Date": "Tue, 20 Oct 2020 18:42:20 GMT", + "Server": [ + "Windows-Azure-Table/1.0", + "Microsoft-HTTPAPI/2.0" + ], + "Transfer-Encoding": "chunked", + "X-Content-Type-Options": "nosniff", + "x-ms-client-request-id": "24e8a8e4e2bebb21d37596c9351f40a9", + "x-ms-request-id": "db7ae526-e002-0004-6110-a72e1e000000", + "x-ms-version": "2019-02-02" + }, + "ResponseBody": "LS1iYXRjaHJlc3BvbnNlX2JjNjExZmU2LTVhMTYtNDUzOC1iYmZkLWIwYzM3ODM5MzhkOQ0KQ29udGVudC1UeXBlOiBtdWx0aXBhcnQvbWl4ZWQ7IGJvdW5kYXJ5PWNoYW5nZXNldHJlc3BvbnNlX2EyOWI5MWU5LTc3Y2MtNGZlZi05YzMwLWNkNDljZWU5ZTdjOQ0KDQotLWNoYW5nZXNldHJlc3BvbnNlX2EyOWI5MWU5LTc3Y2MtNGZlZi05YzMwLWNkNDljZWU5ZTdjOQ0KQ29udGVudC1UeXBlOiBhcHBsaWNhdGlvbi9odHRwDQpDb250ZW50LVRyYW5zZmVyLUVuY29kaW5nOiBiaW5hcnkNCg0KSFRUUC8xLjEgNDA5IENvbmZsaWN0DQpYLUNvbnRlbnQtVHlwZS1PcHRpb25zOiBub3NuaWZmDQpDYWNoZS1Db250cm9sOiBuby1jYWNoZQ0KUHJlZmVyZW5jZS1BcHBsaWVkOiByZXR1cm4tbm8tY29udGVudA0KRGF0YVNlcnZpY2VWZXJzaW9uOiAzLjA7DQpDb250ZW50LVR5cGU6IGFwcGxpY2F0aW9uL2pzb247b2RhdGE9bWluaW1hbG1ldGFkYXRhO3N0cmVhbWluZz10cnVlO2NoYXJzZXQ9dXRmLTgNCg0KeyJvZGF0YS5lcnJvciI6eyJjb2RlIjoiRW50aXR5QWxyZWFkeUV4aXN0cyIsIm1lc3NhZ2UiOnsibGFuZyI6ImVuLVVTIiwidmFsdWUiOiIzOlRoZSBzcGVjaWZpZWQgZW50aXR5IGFscmVhZHkgZXhpc3RzLlxuUmVxdWVzdElkOmRiN2FlNTI2LWUwMDItMDAwNC02MTEwLWE3MmUxZTAwMDAwMFxuVGltZToyMDIwLTEwLTIwVDE4OjQyOjIxLjYzNTk4NTlaIn19fQ0KLS1jaGFuZ2VzZXRyZXNwb25zZV9hMjliOTFlOS03N2NjLTRmZWYtOWMzMC1jZDQ5Y2VlOWU3YzktLQ0KLS1iYXRjaHJlc3BvbnNlX2JjNjExZmU2LTVhMTYtNDUzOC1iYmZkLWIwYzM3ODM5MzhkOS0tDQo=" + }, + { + "RequestUri": "https://chrisstablesprim.table.core.windows.net/Tables(\u0027testtableffd8yxl9\u0027)", + "RequestMethod": "DELETE", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "traceparent": "00-97144ba581ead049b052ff9aac243fe5-82667f1fe2082843-00", + "User-Agent": [ + "azsdk-net-Data.Tables/3.0.0-alpha.20201020.1", + "(.NET Core 4.6.29321.03; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "c3c3c03b021371f0a6688fccfc3f1457", + "x-ms-date": "Tue, 20 Oct 2020 18:42:22 GMT", + "x-ms-return-client-request-id": "true", + "x-ms-version": "2019-02-02" + }, + "RequestBody": null, + "StatusCode": 204, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "0", + "Date": "Tue, 20 Oct 2020 18:42:20 GMT", + "Server": [ + "Windows-Azure-Table/1.0", + "Microsoft-HTTPAPI/2.0" + ], + "X-Content-Type-Options": "nosniff", + "x-ms-client-request-id": "c3c3c03b021371f0a6688fccfc3f1457", + "x-ms-request-id": "db7ae52a-e002-0004-6510-a72e1e000000", + "x-ms-version": "2019-02-02" + }, + "ResponseBody": [] + } + ], + "Variables": { + "RandomSeed": "2142170519", + "STORAGE_ENDPOINT_SUFFIX": "core.windows.net", + "TABLES_PRIMARY_STORAGE_ACCOUNT_KEY": "Kg==", + "TABLES_STORAGE_ACCOUNT_NAME": "chrisstablesprim" + } +} \ No newline at end of file diff --git a/sdk/tables/Azure.Data.Tables/tests/TableClientLiveTests.cs b/sdk/tables/Azure.Data.Tables/tests/TableClientLiveTests.cs index 59952f2e5b8e6..56fca37f487ed 100644 --- a/sdk/tables/Azure.Data.Tables/tests/TableClientLiveTests.cs +++ b/sdk/tables/Azure.Data.Tables/tests/TableClientLiveTests.cs @@ -1052,5 +1052,36 @@ public async Task BatchInsertAndMergeAndDelete() Assert.That(entityResults.Count, Is.EqualTo(entitiesToCreate.Count - 1), "The entity result count should match the created count minus the deleted count."); Assert.That(entityResults[0].StringTypeProperty, Is.EqualTo(updatedString), "The entity result property should have been updated."); } + + /// + /// Validates the functionality of the TableClient. + /// + [RecordedTest] + public async Task BatchError() + { + var entitiesToCreate = CreateCustomTableEntities(PartitionKeyValue, 4); + + // Create the batch. + var batch = client.CreateTransactionalBatch(entitiesToCreate[0].PartitionKey); + + batch.SetBatchGuids(Recording.Random.NewGuid(), Recording.Random.NewGuid()); + + // Add the last entity to the table prior to adding it as part of the batch to cause a batch failure. + await client.AddEntityAsync(entitiesToCreate.Last()); + + // Add the entities to the batch + batch.AddEntities(entitiesToCreate); + + try + { + TableBatchResponse response = await batch.SubmitBatchAsync().ConfigureAwait(false); + } + catch (RequestFailedException ex) + { + Assert.That(ex.Status == (int)HttpStatusCode.Conflict, $"Status should be {HttpStatusCode.Conflict}"); + Assert.That(ex.Message, Is.Not.Null, "Message should not be null"); + Assert.That(ex.Message.Contains(entitiesToCreate.Last().RowKey), $"Exception message should have contained {entitiesToCreate.Last().RowKey}.\n\n Actual: {ex.Message}"); + } + } } } diff --git a/sdk/tables/Azure.Data.Tables/test-resources.json b/sdk/tables/test-resources.json similarity index 100% rename from sdk/tables/Azure.Data.Tables/test-resources.json rename to sdk/tables/test-resources.json