diff --git a/sdk/appconfiguration/Azure.ApplicationModel.Configuration/src/ConfigurationClient.cs b/sdk/appconfiguration/Azure.ApplicationModel.Configuration/src/ConfigurationClient.cs index 3fb31c2f01c0a..52585b4376901 100644 --- a/sdk/appconfiguration/Azure.ApplicationModel.Configuration/src/ConfigurationClient.cs +++ b/sdk/appconfiguration/Azure.ApplicationModel.Configuration/src/ConfigurationClient.cs @@ -91,7 +91,7 @@ public virtual Response Add(string key, string value, stri /// A controlling the request lifetime. public virtual async Task> AddAsync(ConfigurationSetting setting, CancellationToken cancellationToken = default) { - using DiagnosticScope scope = _pipeline.Diagnostics.CreateScope("ConfigurationClient.Add"); + using DiagnosticScope scope = _pipeline.Diagnostics.CreateScope("Azure.ApplicationModel.Configuration.ConfigurationClient.Add"); scope.Start(); try @@ -122,7 +122,7 @@ public virtual async Task> AddAsync(Configuration /// A controlling the request lifetime. public virtual Response Add(ConfigurationSetting setting, CancellationToken cancellationToken = default) { - using DiagnosticScope scope = _pipeline.Diagnostics.CreateScope("ConfigurationClient.Add"); + using DiagnosticScope scope = _pipeline.Diagnostics.CreateScope("Azure.ApplicationModel.Configuration.ConfigurationClient.Add"); scope.AddAttribute("key", setting?.Key); scope.Start(); @@ -205,7 +205,7 @@ public virtual Response Set(string key, string value, stri /// A controlling the request lifetime. public virtual async Task> SetAsync(ConfigurationSetting setting, CancellationToken cancellationToken = default) { - using DiagnosticScope scope = _pipeline.Diagnostics.CreateScope("ConfigurationClient.Set"); + using DiagnosticScope scope = _pipeline.Diagnostics.CreateScope("Azure.ApplicationModel.Configuration.ConfigurationClient.Set"); scope.AddAttribute("key", setting?.Key); scope.Start(); @@ -238,7 +238,7 @@ public virtual async Task> SetAsync(Configuration /// A controlling the request lifetime. public virtual Response Set(ConfigurationSetting setting, CancellationToken cancellationToken = default) { - using DiagnosticScope scope = _pipeline.Diagnostics.CreateScope("ConfigurationClient.Set"); + using DiagnosticScope scope = _pipeline.Diagnostics.CreateScope("Azure.ApplicationModel.Configuration.ConfigurationClient.Set"); scope.AddAttribute("key", setting?.Key); scope.Start(); @@ -324,7 +324,7 @@ public virtual Response Update(string key, string value, s /// A controlling the request lifetime. public virtual async Task> UpdateAsync(ConfigurationSetting setting, CancellationToken cancellationToken = default) { - using DiagnosticScope scope = _pipeline.Diagnostics.CreateScope("ConfigurationClient.Update"); + using DiagnosticScope scope = _pipeline.Diagnostics.CreateScope("Azure.ApplicationModel.Configuration.ConfigurationClient.Update"); scope.AddAttribute("key", setting?.Key); scope.Start(); @@ -355,7 +355,7 @@ public virtual async Task> UpdateAsync(Configurat /// A controlling the request lifetime. public virtual Response Update(ConfigurationSetting setting, CancellationToken cancellationToken = default) { - using DiagnosticScope scope = _pipeline.Diagnostics.CreateScope("ConfigurationClient.Update"); + using DiagnosticScope scope = _pipeline.Diagnostics.CreateScope("Azure.ApplicationModel.Configuration.ConfigurationClient.Update"); scope.AddAttribute("key", setting?.Key); scope.Start(); @@ -418,7 +418,7 @@ private Request CreateUpdateRequest(ConfigurationSetting setting) /// A controlling the request lifetime. public virtual async Task DeleteAsync(string key, string label = default, ETag etag = default, CancellationToken cancellationToken = default) { - using DiagnosticScope scope = _pipeline.Diagnostics.CreateScope("ConfigurationClient.Delete"); + using DiagnosticScope scope = _pipeline.Diagnostics.CreateScope("Azure.ApplicationModel.Configuration.ConfigurationClient.Delete"); scope.AddAttribute("key", key); scope.Start(); @@ -454,7 +454,7 @@ public virtual async Task DeleteAsync(string key, string label = defau /// A controlling the request lifetime. public virtual Response Delete(string key, string label = default, ETag etag = default, CancellationToken cancellationToken = default) { - using DiagnosticScope scope = _pipeline.Diagnostics.CreateScope("ConfigurationClient.Set"); + using DiagnosticScope scope = _pipeline.Diagnostics.CreateScope("Azure.ApplicationModel.Configuration.ConfigurationClient.Delete"); scope.AddAttribute("key", key); scope.Start(); @@ -505,7 +505,7 @@ private Request CreateDeleteRequest(string key, string label, ETag etag) /// A controlling the request lifetime. public virtual async Task> GetAsync(string key, string label = default, DateTimeOffset acceptDateTime = default, CancellationToken cancellationToken = default) { - using DiagnosticScope scope = _pipeline.Diagnostics.CreateScope("ConfigurationClient.Get"); + using DiagnosticScope scope = _pipeline.Diagnostics.CreateScope("Azure.ApplicationModel.Configuration.ConfigurationClient.Get"); scope.AddAttribute("key", key); scope.Start(); @@ -538,22 +538,30 @@ public virtual async Task> GetAsync(string key, s /// A controlling the request lifetime. public virtual Response Get(string key, string label = default, DateTimeOffset acceptDateTime = default, CancellationToken cancellationToken = default) { - using DiagnosticScope scope = _pipeline.Diagnostics.CreateScope("ConfigurationClient.Get"); + using DiagnosticScope scope = _pipeline.Diagnostics.CreateScope("Azure.ApplicationModel.Configuration.ConfigurationClient.Get"); scope.AddAttribute(nameof(key), key); scope.Start(); - using (Request request = CreateGetRequest(key, label, acceptDateTime)) + try { - Response response = _pipeline.SendRequest(request, cancellationToken); - - switch (response.Status) + using (Request request = CreateGetRequest(key, label, acceptDateTime)) { - case 200: - return CreateResponse(response); - default: - throw response.CreateRequestFailedException(); + Response response = _pipeline.SendRequest(request, cancellationToken); + + switch (response.Status) + { + case 200: + return CreateResponse(response); + default: + throw response.CreateRequestFailedException(); + } } } + catch (Exception e) + { + scope.Failed(e); + throw; + } } /// @@ -624,7 +632,7 @@ private Request CreateGetRequest(string key, string label, DateTimeOffset accept /// A controlling the request lifetime. private async Task> GetSettingsPageAsync(SettingSelector selector, string pageLink, CancellationToken cancellationToken = default) { - using DiagnosticScope scope = _pipeline.Diagnostics.CreateScope("ConfigurationClient.GetSettingsPage"); + using DiagnosticScope scope = _pipeline.Diagnostics.CreateScope("Azure.ApplicationModel.Configuration.ConfigurationClient.GetSettingsPage"); scope.Start(); try @@ -657,7 +665,7 @@ private async Task> GetSettingsPageAsync(Sett /// A controlling the request lifetime. private PageResponse GetSettingsPage(SettingSelector selector, string pageLink, CancellationToken cancellationToken = default) { - using DiagnosticScope scope = _pipeline.Diagnostics.CreateScope("ConfigurationClient.GetSettingsPage"); + using DiagnosticScope scope = _pipeline.Diagnostics.CreateScope("Azure.ApplicationModel.Configuration.ConfigurationClient.GetSettingsPage"); scope.Start(); try @@ -706,7 +714,7 @@ private Request CreateBatchRequest(SettingSelector selector, string pageLink) /// A controlling the request lifetime. private async Task> GetRevisionsPageAsync(SettingSelector selector, string pageLink, CancellationToken cancellationToken = default) { - using DiagnosticScope scope = _pipeline.Diagnostics.CreateScope("ConfigurationClient.Set"); + using DiagnosticScope scope = _pipeline.Diagnostics.CreateScope("Azure.ApplicationModel.Configuration.ConfigurationClient.GetRevisionsPage"); scope.Start(); try @@ -739,7 +747,7 @@ private async Task> GetRevisionsPageAsync(Set /// A controlling the request lifetime. private PageResponse GetRevisionsPage(SettingSelector selector, string pageLink, CancellationToken cancellationToken = default) { - using DiagnosticScope scope = _pipeline.Diagnostics.CreateScope("ConfigurationClient.Set"); + using DiagnosticScope scope = _pipeline.Diagnostics.CreateScope("Azure.ApplicationModel.Configuration.ConfigurationClient.GetRevisionsPage"); scope.Start(); try diff --git a/sdk/core/Azure.Core/src/Shared/ForwardsClientCallsAttribute.cs b/sdk/core/Azure.Core/src/Shared/ForwardsClientCallsAttribute.cs new file mode 100644 index 0000000000000..8c4ef95c3caf5 --- /dev/null +++ b/sdk/core/Azure.Core/src/Shared/ForwardsClientCallsAttribute.cs @@ -0,0 +1,15 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; + +namespace Azure.Core +{ + /// + /// Marks methods that call methods on other client and don't need their diagnostics verified + /// + [AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = true)] + internal class ForwardsClientCallsAttribute : Attribute + { + } +} diff --git a/sdk/core/Azure.Core/tests/ClientTestBaseTests.cs b/sdk/core/Azure.Core/tests/ClientTestBaseTests.cs index 318656cadf714..7129d5b032b22 100644 --- a/sdk/core/Azure.Core/tests/ClientTestBaseTests.cs +++ b/sdk/core/Azure.Core/tests/ClientTestBaseTests.cs @@ -13,6 +13,7 @@ public class ClientTestBaseTests : ClientTestBase { public ClientTestBaseTests(bool isAsync) : base(isAsync) { + TestDiagnostics = false; } [Test] diff --git a/sdk/core/Azure.Core/tests/TestFramework/ClientTestBase.cs b/sdk/core/Azure.Core/tests/TestFramework/ClientTestBase.cs index 114109c906ccb..1bf14bd995f05 100644 --- a/sdk/core/Azure.Core/tests/TestFramework/ClientTestBase.cs +++ b/sdk/core/Azure.Core/tests/TestFramework/ClientTestBase.cs @@ -2,6 +2,7 @@ // Licensed under the MIT License. using System; +using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using Castle.DynamicProxy; @@ -17,9 +18,12 @@ public class ClientTestBase private static readonly IInterceptor _useSyncInterceptor = new UseSyncMethodsInterceptor(forceSync: true); private static readonly IInterceptor _avoidSyncInterceptor = new UseSyncMethodsInterceptor(forceSync: false); + private static readonly IInterceptor _diagnosticScopeValidatingInterceptor = new DiagnosticScopeValidatingInterceptor(); public bool IsAsync { get; } + public bool TestDiagnostics { get; set; } = true; + public ClientTestBase(bool isAsync) { IsAsync = isAsync; @@ -55,9 +59,16 @@ public virtual TClient InstrumentClient(TClient client) where TClient: throw ClientValidation.ValidationException; } - var interceptor = IsAsync ? _avoidSyncInterceptor : _useSyncInterceptor; + List interceptors = new List(); + + if (TestDiagnostics) + { + interceptors.Add(_diagnosticScopeValidatingInterceptor); + } + + interceptors.Add(IsAsync ? _avoidSyncInterceptor : _useSyncInterceptor); - return _proxyGenerator.CreateClassProxyWithTarget(client, interceptor); + return _proxyGenerator.CreateClassProxyWithTarget(client, interceptors.ToArray()); } diff --git a/sdk/core/Azure.Core/tests/TestFramework/DiagnosticScopeValidatingInterceptor.cs b/sdk/core/Azure.Core/tests/TestFramework/DiagnosticScopeValidatingInterceptor.cs new file mode 100644 index 0000000000000..6f34cffacd8ff --- /dev/null +++ b/sdk/core/Azure.Core/tests/TestFramework/DiagnosticScopeValidatingInterceptor.cs @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Azure.Core.Tests; +using Castle.DynamicProxy; + +namespace Azure.Core.Testing +{ + public class DiagnosticScopeValidatingInterceptor : IInterceptor + { + public void Intercept(IInvocation invocation) + { + var methodName = invocation.Method.Name; + if (methodName.EndsWith("Async")) + { + var expectedEventPrefix = invocation.Method.DeclaringType.FullName + "." + methodName.Substring(0, methodName.Length - 5); + var expectedEvents = new List(); + expectedEvents.Add(expectedEventPrefix + ".Start"); + + TestDiagnosticListener diagnosticListener = new TestDiagnosticListener("Azure.Clients"); + invocation.Proceed(); + + bool strict = !invocation.Method.GetCustomAttributes(true).Any(a => a.GetType().FullName == "Azure.Core.ConvenienceMethodAttribute"); + if (invocation.Method.ReturnType.Name.Contains("AsyncCollection") || + invocation.Method.ReturnType.Name.Contains("IAsyncEnumerable")) + { + return; + } + + var result = (Task)invocation.ReturnValue; + try + { + result.GetAwaiter().GetResult(); + expectedEvents.Add(expectedEventPrefix + ".Stop"); + } + catch (Exception ex) + { + expectedEvents.Add(expectedEventPrefix + ".Exception"); + + if (ex is ArgumentException) + { + // Don't expect scope for argument validation failures + expectedEvents.Clear(); + } + } + finally + { + diagnosticListener.Dispose(); + if (strict) + { + foreach (var expectedEvent in expectedEvents) + { + if (!diagnosticListener.Events.Any(e => e.Key == expectedEvent)) + { + throw new InvalidOperationException($"Expected diagnostic event not fired {expectedEvent} {Environment.NewLine} fired events {string.Join(", ", diagnosticListener.Events)}"); + } + } + } + else + { + if (!diagnosticListener.Events.Any()) + { + throw new InvalidOperationException($"Expected some diagnostic event to fire found none"); + } + } + } + } + else + { + invocation.Proceed(); + } + } + } +} diff --git a/sdk/core/Azure.Core/tests/TestFramework/RecordMatcher.cs b/sdk/core/Azure.Core/tests/TestFramework/RecordMatcher.cs index e258c2caca04e..9a06e192f9f82 100644 --- a/sdk/core/Azure.Core/tests/TestFramework/RecordMatcher.cs +++ b/sdk/core/Azure.Core/tests/TestFramework/RecordMatcher.cs @@ -25,7 +25,8 @@ public RecordMatcher(RecordedTestSanitizer sanitizer) "Date", "x-ms-date", "x-ms-client-request-id", - "User-Agent" + "User-Agent", + "Request-Id" }; public HashSet ExcludeResponseHeaders = new HashSet(StringComparer.OrdinalIgnoreCase) @@ -176,7 +177,7 @@ private int CompareHeaderDictionaries(SortedDictionary headers difference++; } } - else + else if (!ExcludeHeaders.Contains(header.Key)) { difference++; } diff --git a/sdk/core/Azure.Core/tests/TestDiagnosticListener.cs b/sdk/core/Azure.Core/tests/TestFramework/TestDiagnosticListener.cs similarity index 62% rename from sdk/core/Azure.Core/tests/TestDiagnosticListener.cs rename to sdk/core/Azure.Core/tests/TestFramework/TestDiagnosticListener.cs index 1c42a40913db4..a268f615ce62d 100644 --- a/sdk/core/Azure.Core/tests/TestDiagnosticListener.cs +++ b/sdk/core/Azure.Core/tests/TestFramework/TestDiagnosticListener.cs @@ -11,7 +11,7 @@ public class TestDiagnosticListener : IObserver, IObserver _subscriptions = new List(); + private List _subscriptions = new List(); public Queue> Events { get; } = new Queue>(); @@ -33,26 +33,43 @@ public void OnError(Exception error) public void OnNext(KeyValuePair value) { - Events.Enqueue(value); + lock (Events) + { + Events.Enqueue(value); + } } public void OnNext(DiagnosticListener value) { - if (value.Name == _diagnosticSourceName) + List subscriptions = _subscriptions; + if (value.Name == _diagnosticSourceName && subscriptions != null) { - _subscriptions.Add(value.Subscribe(this, IsEnabled)); + lock (subscriptions) + { + subscriptions.Add(value.Subscribe(this, IsEnabled)); + } } } private bool IsEnabled(string arg1, object arg2, object arg3) { - IsEnabledCalls.Enqueue((arg1, arg2, arg3)); + lock (IsEnabledCalls) + { + IsEnabledCalls.Enqueue((arg1, arg2, arg3)); + } return true; } public void Dispose() { - foreach (IDisposable subscription in _subscriptions) + List subscriptions; + lock (_subscriptions) + { + subscriptions = _subscriptions; + _subscriptions = null; + } + + foreach (IDisposable subscription in subscriptions) { subscription.Dispose(); } diff --git a/sdk/keyvault/Azure.Security.KeyVault.Keys/tests/KeyClientLiveTests.cs b/sdk/keyvault/Azure.Security.KeyVault.Keys/tests/KeyClientLiveTests.cs index e9649c135d82a..49c2948c3312e 100644 --- a/sdk/keyvault/Azure.Security.KeyVault.Keys/tests/KeyClientLiveTests.cs +++ b/sdk/keyvault/Azure.Security.KeyVault.Keys/tests/KeyClientLiveTests.cs @@ -17,6 +17,7 @@ public class KeyClientLiveTests : KeysTestBase public KeyClientLiveTests(bool isAsync) : base(isAsync) { + TestDiagnostics = false; } [Test] @@ -298,7 +299,7 @@ public async Task RestoreKey() await WaitForPurgedKey(keyName); Assert.ThrowsAsync(() => Client.GetKeyAsync(keyName)); - + Key restoredResult = await Client.RestoreKeyAsync(backup); RegisterForCleanup(restoredResult); diff --git a/sdk/keyvault/Azure.Security.KeyVault.Secrets/tests/SecretClientLiveTests.cs b/sdk/keyvault/Azure.Security.KeyVault.Secrets/tests/SecretClientLiveTests.cs index 3a8948aee2fe7..be87bd56d5967 100644 --- a/sdk/keyvault/Azure.Security.KeyVault.Secrets/tests/SecretClientLiveTests.cs +++ b/sdk/keyvault/Azure.Security.KeyVault.Secrets/tests/SecretClientLiveTests.cs @@ -20,6 +20,7 @@ public class SecretClientLiveTests : KeyVaultTestBase public SecretClientLiveTests(bool isAsync) : base(isAsync) { + TestDiagnostics = false; } [Test] @@ -136,7 +137,7 @@ public async Task GetSecret() SecretBase setSecret = await Client.SetAsync(secretName, "value"); RegisterForCleanup(setSecret); - + Secret secret = await Client.GetAsync(secretName); AssertSecretsEqual(setSecret, secret); @@ -161,7 +162,7 @@ public async Task GetSecretWithVersion() public async Task GetSecretVersionsNonExisting() { List> allSecrets = await Client.GetSecretVersionsAsync(Recording.GenerateId()).ToEnumerableAsync(); - + Assert.AreEqual(0, allSecrets.Count); } diff --git a/sdk/storage/Azure.Storage.Blobs/src/AppendBlobClient.cs b/sdk/storage/Azure.Storage.Blobs/src/AppendBlobClient.cs index 8c4331207111b..c2bcc8af65ab8 100644 --- a/sdk/storage/Azure.Storage.Blobs/src/AppendBlobClient.cs +++ b/sdk/storage/Azure.Storage.Blobs/src/AppendBlobClient.cs @@ -359,6 +359,7 @@ private async Task> CreateInternal( ifMatch: accessConditions?.HttpAccessConditions?.IfMatch, ifNoneMatch: accessConditions?.HttpAccessConditions?.IfNoneMatch, async: async, + operationName: "Azure.Storage.Blobs.Specialized.AppendBlobClient.Create", cancellationToken: cancellationToken) .ConfigureAwait(false); } @@ -574,6 +575,7 @@ private async Task> AppendBlockInternal( ifMatch: accessConditions?.HttpAccessConditions?.IfMatch, ifNoneMatch: accessConditions?.HttpAccessConditions?.IfNoneMatch, async: async, + operationName: "Azure.Storage.Blobs.Specialized.AppendBlobClient.AppendBlock", cancellationToken: cancellationToken); }, cleanup: () => { }) @@ -824,6 +826,7 @@ private async Task> AppendBlockFromUriInternal( sourceIfMatch: sourceAccessConditions?.HttpAccessConditions?.IfMatch, sourceIfNoneMatch: sourceAccessConditions?.HttpAccessConditions?.IfNoneMatch, async: async, + operationName: "Azure.Storage.Blobs.Specialized.AppendBlobClient.AppendBlockFromUri", cancellationToken: cancellationToken) .ConfigureAwait(false); } diff --git a/sdk/storage/Azure.Storage.Blobs/src/BlobBaseClient.cs b/sdk/storage/Azure.Storage.Blobs/src/BlobBaseClient.cs index 423be9bb2d82d..020c15bcd31b6 100644 --- a/sdk/storage/Azure.Storage.Blobs/src/BlobBaseClient.cs +++ b/sdk/storage/Azure.Storage.Blobs/src/BlobBaseClient.cs @@ -622,6 +622,7 @@ await BlobRestClient.Blob.DownloadAsync( ifMatch: accessConditions?.HttpAccessConditions?.IfMatch, ifNoneMatch: accessConditions?.HttpAccessConditions?.IfNoneMatch, async: async, + operationName: "Azure.Storage.Blobs.Specialized.BlobBaseClient.Download", cancellationToken: cancellationToken) .ConfigureAwait(false); @@ -926,6 +927,7 @@ private async Task> StartCopyFromUriInternal( leaseId: destinationAccessConditions?.LeaseAccessConditions?.LeaseId, metadata: metadata, async: async, + operationName: "Azure.Storage.Blobs.Specialized.BlobBaseClient.StartCopyFromUri", cancellationToken: cancellationToken) .ConfigureAwait(false); } @@ -1065,6 +1067,7 @@ private async Task AbortCopyFromUriInternal( copyId: copyId, leaseId: leaseAccessConditions?.LeaseId, async: async, + operationName: "Azure.Storage.Blobs.Specialized.BlobBaseClient.AbortCopyFromUri", cancellationToken: cancellationToken) .ConfigureAwait(false); } @@ -1220,6 +1223,7 @@ private async Task DeleteInternal( ifMatch: accessConditions?.HttpAccessConditions?.IfMatch, ifNoneMatch: accessConditions?.HttpAccessConditions?.IfNoneMatch, async: async, + operationName: "Azure.Storage.Blobs.Specialized.BlobBaseClient.Delete", cancellationToken: cancellationToken) .ConfigureAwait(false); } @@ -1321,7 +1325,8 @@ private async Task UndeleteInternal( this.Pipeline, this.Uri, async: async, - cancellationToken: cancellationToken) + cancellationToken: cancellationToken, + operationName: "Azure.Storage.Blobs.Specialized.BlobBaseClient.Undelete") .ConfigureAwait(false); } catch (Exception ex) @@ -1454,6 +1459,7 @@ private async Task> GetPropertiesInternal( ifMatch: accessConditions?.HttpAccessConditions?.IfMatch, ifNoneMatch: accessConditions?.HttpAccessConditions?.IfNoneMatch, async: async, + operationName: "Azure.Storage.Blobs.Specialized.BlobBaseClient.GetProperties", cancellationToken: cancellationToken) .ConfigureAwait(false); } @@ -1603,6 +1609,7 @@ await BlobRestClient.Blob.SetHttpHeadersAsync( ifMatch: accessConditions?.HttpAccessConditions?.IfMatch, ifNoneMatch: accessConditions?.HttpAccessConditions?.IfNoneMatch, async: async, + operationName: "Azure.Storage.Blobs.Specialized.BlobBaseClient.SetHttpHeaders", cancellationToken: cancellationToken) .ConfigureAwait(false); return new Response( @@ -1754,6 +1761,7 @@ await BlobRestClient.Blob.SetMetadataAsync( ifMatch: accessConditions?.HttpAccessConditions?.IfMatch, ifNoneMatch: accessConditions?.HttpAccessConditions?.IfNoneMatch, async: async, + operationName: "Azure.Storage.Blobs.Specialized.BlobBaseClient.SetMetadata", cancellationToken: cancellationToken) .ConfigureAwait(false); return new Response( @@ -1903,6 +1911,7 @@ private async Task> CreateSnapshotInternal( ifNoneMatch: accessConditions?.HttpAccessConditions?.IfNoneMatch, leaseId: accessConditions?.LeaseAccessConditions?.LeaseId, async: async, + operationName: "Azure.Storage.Blobs.Specialized.BlobBaseClient.CreateSnapshot", cancellationToken: cancellationToken) .ConfigureAwait(false); } @@ -2066,6 +2075,7 @@ private async Task SetTierInternal( tier: accessTier, leaseId: leaseAccessConditions?.LeaseId, async: async, + operationName: "Azure.Storage.Blobs.Specialized.BlobBaseClient.SetTier", cancellationToken: cancellationToken) .ConfigureAwait(false); } diff --git a/sdk/storage/Azure.Storage.Blobs/src/BlobClient.cs b/sdk/storage/Azure.Storage.Blobs/src/BlobClient.cs index 1fce2c0375298..fb98078ed43bb 100644 --- a/sdk/storage/Azure.Storage.Blobs/src/BlobClient.cs +++ b/sdk/storage/Azure.Storage.Blobs/src/BlobClient.cs @@ -42,7 +42,7 @@ protected BlobClient() /// A connection string includes the authentication information /// required for your application to access data in an Azure Storage /// account at runtime. - /// + /// /// For more information, . /// /// @@ -64,7 +64,7 @@ public BlobClient(string connectionString, string containerName, string blobName /// A connection string includes the authentication information /// required for your application to access data in an Azure Storage /// account at runtime. - /// + /// /// For more information, . /// /// @@ -169,12 +169,12 @@ internal BlobClient(Uri blobUri, HttpPipeline pipeline) /// The operation creates a new block blob /// or updates the content of an existing block blob. Updating an /// existing block blob overwrites any existing metadata on the blob. - /// + /// /// For partial block blob updates and other advanced features, please /// see . To create or modify page or /// append blobs, please see or /// . - /// + /// /// For more information, see . /// /// @@ -188,6 +188,7 @@ internal BlobClient(Uri blobUri, HttpPipeline pipeline) /// A will be thrown if /// a failure occurs. /// + [ForwardsClientCalls] public virtual Response Upload(Stream content) => this.Upload(content, CancellationToken.None); @@ -195,12 +196,12 @@ public virtual Response Upload(Stream content) => /// The operation creates a new block blob /// or updates the content of an existing block blob. Updating an /// existing block blob overwrites any existing metadata on the blob. - /// + /// /// For partial block blob updates and other advanced features, please /// see . To create or modify page or /// append blobs, please see or /// . - /// + /// /// For more information, see . /// /// @@ -214,6 +215,7 @@ public virtual Response Upload(Stream content) => /// A will be thrown if /// a failure occurs. /// + [ForwardsClientCalls] public virtual async Task> UploadAsync(Stream content) => await this.UploadAsync(content, CancellationToken.None).ConfigureAwait(false); @@ -222,12 +224,12 @@ public virtual async Task> UploadAsync(Stream content) /// creates a new block blob or updates the content of an existing /// block blob. Updating an existing block blob overwrites any /// existing metadata on the blob. - /// + /// /// For partial block blob updates and other advanced features, please /// see . To create or modify page or /// append blobs, please see or /// . - /// + /// /// For more information, see . /// /// @@ -245,6 +247,7 @@ public virtual async Task> UploadAsync(Stream content) /// A will be thrown if /// a failure occurs. /// + [ForwardsClientCalls] public virtual Response Upload( Stream content, CancellationToken cancellationToken) => @@ -258,12 +261,12 @@ public virtual Response Upload( /// creates a new block blob or updates the content of an existing /// block blob. Updating an existing block blob overwrites any /// existing metadata on the blob. - /// + /// /// For partial block blob updates and other advanced features, please /// see . To create or modify page or /// append blobs, please see or /// . - /// + /// /// For more information, see . /// /// @@ -281,6 +284,7 @@ public virtual Response Upload( /// A will be thrown if /// a failure occurs. /// + [ForwardsClientCalls] public virtual async Task> UploadAsync( Stream content, CancellationToken cancellationToken) => @@ -295,12 +299,12 @@ await this.UploadAsync( /// operation creates a new block blob or updates the content of an /// existing block blob. Updating an existing block blob overwrites /// any existing metadata on the blob. - /// + /// /// For partial block blob updates and other advanced features, please /// see . To create or modify page or /// append blobs, please see or /// . - /// + /// /// For more information, see . /// /// @@ -333,6 +337,7 @@ await this.UploadAsync( /// A will be thrown if /// a failure occurs. /// + [ForwardsClientCalls] public virtual Response Upload( Stream content, BlobHttpHeaders? blobHttpHeaders = default, @@ -355,12 +360,12 @@ public virtual Response Upload( /// operation creates a new block blob or updates the content of an /// existing block blob. Updating an existing block blob overwrites /// any existing metadata on the blob. - /// + /// /// For partial block blob updates and other advanced features, please /// see . To create or modify page or /// append blobs, please see or /// . - /// + /// /// For more information, see . /// /// @@ -393,6 +398,7 @@ public virtual Response Upload( /// A will be thrown if /// a failure occurs. /// + [ForwardsClientCalls] public virtual async Task> UploadAsync( Stream content, BlobHttpHeaders? blobHttpHeaders = default, diff --git a/sdk/storage/Azure.Storage.Blobs/src/BlobContainerClient.cs b/sdk/storage/Azure.Storage.Blobs/src/BlobContainerClient.cs index d4088ff1f86b4..56f52e48a9560 100644 --- a/sdk/storage/Azure.Storage.Blobs/src/BlobContainerClient.cs +++ b/sdk/storage/Azure.Storage.Blobs/src/BlobContainerClient.cs @@ -45,13 +45,13 @@ public class BlobContainerClient public virtual Uri Uri => this._uri; /// - /// The transport pipeline used to send + /// The transport pipeline used to send /// every request. /// private readonly HttpPipeline _pipeline; /// - /// The transport pipeline used to send + /// The transport pipeline used to send /// every request. /// protected internal virtual HttpPipeline Pipeline => this._pipeline; @@ -73,7 +73,7 @@ protected BlobContainerClient() /// A connection string includes the authentication information /// required for your application to access data in an Azure Storage /// account at runtime. - /// + /// /// For more information, . /// /// @@ -92,7 +92,7 @@ public BlobContainerClient(string connectionString, string containerName) /// A connection string includes the authentication information /// required for your application to access data in an Azure Storage /// account at runtime. - /// + /// /// For more information, . /// /// @@ -208,7 +208,7 @@ internal BlobContainerClient(Uri containerUri, HttpPipeline pipeline) /// The operation creates a new container /// under the specified account. If the container with the same name /// already exists, the operation fails. - /// + /// /// For more information, see . /// /// @@ -254,7 +254,7 @@ public virtual Response Create( /// The operation creates a new container /// under the specified account. If the container with the same name /// already exists, the operation fails. - /// + /// /// For more information, see . /// /// @@ -300,7 +300,7 @@ await this.CreateInternal( /// The operation creates a new container /// under the specified account. If the container with the same name /// already exists, the operation fails. - /// + /// /// For more information, see . /// /// @@ -355,6 +355,7 @@ private async Task> CreateInternal( metadata: metadata, access: publicAccessType, async: async, + operationName: "Azure.Storage.Blobs.BlobContainerClient.Create", cancellationToken: cancellationToken) .ConfigureAwait(false); } @@ -376,7 +377,7 @@ private async Task> CreateInternal( /// The operation marks the specified /// container for deletion. The container and any blobs contained /// within it are later deleted during garbage collection. - /// + /// /// For more information, see . /// /// @@ -407,7 +408,7 @@ public virtual Response Delete( /// The operation marks the specified /// container for deletion. The container and any blobs contained /// within it are later deleted during garbage collection. - /// + /// /// For more information, see . /// /// @@ -438,7 +439,7 @@ await this.DeleteInternal( /// The operation marks the specified /// container for deletion. The container and any blobs contained /// within it are later deleted during garbage collection. - /// + /// /// For more information, see . /// /// @@ -486,6 +487,7 @@ private async Task DeleteInternal( ifModifiedSince: accessConditions?.HttpAccessConditions?.IfModifiedSince, ifUnmodifiedSince: accessConditions?.HttpAccessConditions?.IfUnmodifiedSince, async: async, + operationName: "Azure.Storage.Blobs.BlobContainerClient.Delete", cancellationToken: cancellationToken) .ConfigureAwait(false); } @@ -506,9 +508,9 @@ private async Task DeleteInternal( /// /// The operation returns all /// user-defined metadata and system properties for the specified - /// container. The data returned does not include the container's + /// container. The data returned does not include the container's /// list of blobs. - /// + /// /// For more information, see . /// /// @@ -539,9 +541,9 @@ public virtual Response GetProperties( /// /// The operation returns all /// user-defined metadata and system properties for the specified - /// container. The data returned does not include the container's + /// container. The data returned does not include the container's /// list of blobs. - /// + /// /// For more information, see . /// /// @@ -572,9 +574,9 @@ await this.GetPropertiesInternal( /// /// The operation returns all /// user-defined metadata and system properties for the specified - /// container. The data returned does not include the container's + /// container. The data returned does not include the container's /// list of blobs. - /// + /// /// For more information, see . /// /// @@ -617,6 +619,7 @@ await BlobRestClient.Container.GetPropertiesAsync( this.Uri, leaseId: leaseAccessConditions?.LeaseId, async: async, + operationName: "Azure.Storage.Blobs.BlobContainerClient.GetProperties", cancellationToken: cancellationToken) .ConfigureAwait(false); @@ -658,7 +661,7 @@ await BlobRestClient.Container.GetPropertiesAsync( /// /// The operation sets one or more /// user-defined name-value pairs for the specified container. - /// + /// /// For more information, see . /// /// @@ -693,7 +696,7 @@ public virtual Response SetMetadata( /// /// The operation sets one or more /// user-defined name-value pairs for the specified container. - /// + /// /// For more information, see . /// /// @@ -728,7 +731,7 @@ await this.SetMetadataInternal( /// /// The operation sets one or more /// user-defined name-value pairs for the specified container. - /// + /// /// For more information, see . /// /// @@ -784,6 +787,7 @@ private async Task> SetMetadataInternal( leaseId: accessConditions?.LeaseAccessConditions?.LeaseId, ifModifiedSince: accessConditions?.HttpAccessConditions?.IfModifiedSince, async: async, + operationName: "Azure.Storage.Blobs.BlobContainerClient.SetMetadata", cancellationToken: cancellationToken) .ConfigureAwait(false); } @@ -805,7 +809,7 @@ private async Task> SetMetadataInternal( /// The operation gets the /// permissions for this container. The permissions indicate whether /// container data may be accessed publicly. - /// + /// /// For more information, see . /// /// @@ -837,7 +841,7 @@ public virtual Response GetAccessPolicy( /// The operation gets the /// permissions for this container. The permissions indicate whether /// container data may be accessed publicly. - /// + /// /// For more information, see . /// /// @@ -869,7 +873,7 @@ await this.GetAccessPolicyInternal( /// The operation gets the /// permissions for this container. The permissions indicate whether /// container data may be accessed publicly. - /// + /// /// For more information, see . /// /// @@ -910,6 +914,7 @@ private async Task> GetAccessPolicyInternal( this.Uri, leaseId: leaseAccessConditions?.LeaseId, async: async, + operationName: "Azure.Storage.Blobs.BlobContainerClient.GetAccessPolicy", cancellationToken: cancellationToken) .ConfigureAwait(false); } @@ -931,7 +936,7 @@ private async Task> GetAccessPolicyInternal( /// The operation sets the /// permissions for the specified container. The permissions indicate /// whether container data may be accessed publicly. - /// + /// /// For more information, see . /// /// @@ -984,7 +989,7 @@ public virtual Response SetAccessPolicy( /// The operation sets the /// permissions for the specified container. The permissions indicate /// whether container data may be accessed publicly. - /// + /// /// For more information, see . /// /// @@ -1037,7 +1042,7 @@ await this.SetAccessPolicyInternal( /// The operation sets the /// permissions for the specified container. The permissions indicate /// whether container data may be accessed publicly. - /// + /// /// For more information, see . /// /// @@ -1107,6 +1112,7 @@ private async Task> SetAccessPolicyInternal( ifModifiedSince: accessConditions?.HttpAccessConditions?.IfModifiedSince, ifUnmodifiedSince: accessConditions?.HttpAccessConditions?.IfUnmodifiedSince, async: async, + operationName: "Azure.Storage.Blobs.BlobContainerClient.SetAccessPolicy", cancellationToken: cancellationToken) .ConfigureAwait(false); } @@ -1129,7 +1135,7 @@ private async Task> SetAccessPolicyInternal( /// of blobs in this container. Enumerating the blobs may make /// multiple requests to the service while fetching all the values. /// Blobs are ordered lexicographically by name. - /// + /// /// For more information, see . /// /// @@ -1158,7 +1164,7 @@ public virtual IEnumerable> GetBlobs( /// sequence of blobs in this container. Enumerating the blobs may /// make multiple requests to the service while fetching all the /// values. Blobs are ordered lexicographically by name. - /// + /// /// For more information, see . /// /// @@ -1191,7 +1197,7 @@ public virtual AsyncCollection GetBlobsAsync( /// empty to make subsequent calls to /// to continue enumerating the blobs segment by segment. Blobs are /// ordered lexicographically by name. - /// + /// /// For more information, see . /// /// @@ -1275,7 +1281,7 @@ internal async Task> GetBlobsInternal( /// the values. Blobs are ordered lexicographically by name. A /// can be used to traverse a virtual /// hierarchy of blobs as though it were a file system. - /// + /// /// For more information, see . /// /// @@ -1291,7 +1297,7 @@ internal async Task> GetBlobsInternal( /// prefix to make a subsequent call to list the blobs that begin with /// this prefix, by specifying the value of the prefix for the /// . - /// + /// /// Note that each BlobPrefix element returned counts toward the /// maximum result, just as each Blob element does. /// @@ -1324,7 +1330,7 @@ public virtual IEnumerable> GetBlobsByHierarchy( /// the values. Blobs are ordered lexicographically by name. A /// can be used to traverse a virtual /// hierarchy of blobs as though it were a file system. - /// + /// /// For more information, see . /// /// @@ -1340,7 +1346,7 @@ public virtual IEnumerable> GetBlobsByHierarchy( /// prefix to make a subsequent call to list the blobs that begin with /// this prefix, by specifying the value of the prefix for the /// . - /// + /// /// Note that each BlobPrefix element returned counts toward the /// maximum result, just as each Blob element does. /// @@ -1377,7 +1383,7 @@ public virtual AsyncCollection GetBlobsByHierarchyAsync( /// ordered lexicographically by name. A /// can be used to traverse a virtual hierarchy of blobs as though /// it were a file system. - /// + /// /// For more information, see . /// /// @@ -1402,7 +1408,7 @@ public virtual AsyncCollection GetBlobsByHierarchyAsync( /// prefix to make a subsequent call to list the blobs that begin with /// this prefix, by specifying the value of the prefix for the /// . - /// + /// /// Note that each BlobPrefix element returned counts toward the /// maximum result, just as each Blob element does. /// @@ -1479,12 +1485,12 @@ internal async Task> GetBlobsByHierarchyInternal /// blob or updates the content of an existing block blob in this /// container. Updating an existing block blob overwrites any existing /// metadata on the blob. - /// + /// /// For partial block blob updates and other advanced features, please /// see . To create or modify page or /// append blobs, please see or /// . - /// + /// /// For more information, see . /// /// The name of the blob to upload. @@ -1503,6 +1509,7 @@ internal async Task> GetBlobsByHierarchyInternal /// A will be thrown if /// a failure occurs. /// + [ForwardsClientCalls] public virtual Response UploadBlob( string blobName, Stream content, @@ -1517,12 +1524,12 @@ public virtual Response UploadBlob( /// blob or updates the content of an existing block blob in this /// container. Updating an existing block blob overwrites any existing /// metadata on the blob. - /// + /// /// For partial block blob updates and other advanced features, please /// see . To create or modify page or /// append blobs, please see or /// . - /// + /// /// For more information, see . /// /// The name of the blob to upload. @@ -1541,6 +1548,7 @@ public virtual Response UploadBlob( /// A will be thrown if /// a failure occurs. /// + [ForwardsClientCalls] public virtual async Task> UploadBlobAsync( string blobName, Stream content, @@ -1583,6 +1591,7 @@ await this.GetBlobClient(blobName) /// A will be thrown if /// a failure occurs. /// + [ForwardsClientCalls] public virtual Response DeleteBlob( string blobName, DeleteSnapshotsOption? deleteOptions = default, @@ -1624,6 +1633,7 @@ public virtual Response DeleteBlob( /// A will be thrown if /// a failure occurs. /// + [ForwardsClientCalls] public virtual async Task DeleteBlobAsync( string blobName, DeleteSnapshotsOption? deleteOptions = default, diff --git a/sdk/storage/Azure.Storage.Blobs/src/BlobServiceClient.cs b/sdk/storage/Azure.Storage.Blobs/src/BlobServiceClient.cs index 63588ec72ac2b..bef18810c216d 100644 --- a/sdk/storage/Azure.Storage.Blobs/src/BlobServiceClient.cs +++ b/sdk/storage/Azure.Storage.Blobs/src/BlobServiceClient.cs @@ -34,13 +34,13 @@ public class BlobServiceClient public virtual Uri Uri => this._uri; /// - /// The transport pipeline used to send + /// The transport pipeline used to send /// every request. /// private readonly HttpPipeline _pipeline; /// - /// The transport pipeline used to send + /// The transport pipeline used to send /// every request. /// protected virtual HttpPipeline Pipeline => this._pipeline; @@ -62,7 +62,7 @@ protected BlobServiceClient() /// A connection string includes the authentication information /// required for your application to access data in an Azure Storage /// account at runtime. - /// + /// /// For more information, . /// public BlobServiceClient(string connectionString) @@ -78,7 +78,7 @@ public BlobServiceClient(string connectionString) /// A connection string includes the authentication information /// required for your application to access data in an Azure Storage /// account at runtime. - /// + /// /// For more information, . /// /// @@ -209,7 +209,7 @@ public virtual BlobContainerClient GetBlobContainerClient(string containerName) /// sequence of containers in the storage account. Enumerating the /// containers may make multiple requests to the service while fetching /// all the values. Containers are ordered lexicographically by name. - /// + /// /// For more information, see . /// /// @@ -238,7 +238,7 @@ public virtual IEnumerable> GetContainers( /// sequence of containers in the storage account. Enumerating the /// containers may make multiple requests to the service while fetching /// all the values. Containers are ordered lexicographically by name. - /// + /// /// For more information, see . /// /// @@ -271,7 +271,7 @@ public virtual AsyncCollection GetContainersAsync( /// empty to make subsequent calls to /// to continue enumerating the containers segment by segment. /// Containers are ordered lexicographically by name. - /// + /// /// For more information, see . /// /// @@ -351,7 +351,7 @@ internal async Task> GetContainersInternal( /// /// The operation returns the sku /// name and account kind for the specified account. - /// + /// /// For more information, see . /// /// @@ -375,7 +375,7 @@ public virtual Response GetAccountInfo( /// /// The operation returns the sku /// name and account kind for the specified account. - /// + /// /// For more information, see . /// /// @@ -399,7 +399,7 @@ await this.GetAccountInfoInternal( /// /// The operation returns the sku /// name and account kind for the specified account. - /// + /// /// For more information, see . /// /// @@ -429,6 +429,7 @@ private async Task> GetAccountInfoInternal( this.Pipeline, this.Uri, async: async, + operationName: "Azure.Storage.Blobs.BlobServiceClient.GetAccountInfo", cancellationToken: cancellationToken) .ConfigureAwait(false); } @@ -450,7 +451,7 @@ private async Task> GetAccountInfoInternal( /// The operation gets the properties /// of a storage account’s blob service, including properties for /// Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. - /// + /// /// For more information, see . /// /// @@ -476,7 +477,7 @@ public virtual Response GetProperties( /// The operation gets the properties /// of a storage account’s blob service, including properties for /// Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. - /// + /// /// For more information, see . /// /// @@ -502,7 +503,7 @@ await this.GetPropertiesInternal( /// The operation gets the properties /// of a storage account’s blob service, including properties for /// Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. - /// + /// /// For more information, see . /// /// @@ -533,6 +534,7 @@ private async Task> GetPropertiesInternal( this.Pipeline, this.Uri, async: async, + operationName: "Azure.Storage.Blobs.BlobServiceClient.GetProperties", cancellationToken: cancellationToken) .ConfigureAwait(false); } @@ -557,7 +559,7 @@ private async Task> GetPropertiesInternal( /// and soft delete settings. You can also use this operation to set /// the default request version for all incoming requests to the Blob /// service that do not have a version specified. - /// + /// /// For more information, see . /// /// The blob service properties. @@ -589,7 +591,7 @@ public virtual Response SetProperties( /// and soft delete settings. You can also use this operation to set /// the default request version for all incoming requests to the Blob /// service that do not have a version specified. - /// + /// /// For more information, see . /// /// The blob service properties. @@ -621,7 +623,7 @@ await this.SetPropertiesInternal( /// and soft delete settings. You can also use this operation to set /// the default request version for all incoming requests to the Blob /// service that do not have a version specified. - /// + /// /// For more information, see . /// /// The blob service properties. @@ -659,6 +661,7 @@ private async Task SetPropertiesInternal( this.Uri, properties, async: async, + operationName: "Azure.Storage.Blobs.BlobServiceClient.SetProperties", cancellationToken: cancellationToken) .ConfigureAwait(false); } @@ -682,7 +685,7 @@ private async Task SetPropertiesInternal( /// only available on the secondary location endpoint when read-access /// geo-redundant replication () /// is enabled for the storage account. - /// + /// /// For more information, see . /// /// @@ -710,7 +713,7 @@ public virtual Response GetStatistics( /// only available on the secondary location endpoint when read-access /// geo-redundant replication () /// is enabled for the storage account. - /// + /// /// For more information, see . /// /// @@ -738,7 +741,7 @@ await this.GetStatisticsInternal( /// only available on the secondary location endpoint when read-access /// geo-redundant replication () /// is enabled for the storage account. - /// + /// /// For more information, see . /// /// @@ -769,6 +772,7 @@ private async Task> GetStatisticsInternal( this.Pipeline, this.Uri, async: async, + operationName: "Azure.Storage.Blobs.BlobServiceClient.GetStatistics", cancellationToken: cancellationToken) .ConfigureAwait(false); } @@ -912,6 +916,7 @@ private async Task> GetUserDelegationKeyInternal( this.Uri, keyInfo: keyInfo, async: async, + operationName: "Azure.Storage.Blobs.BlobServiceClient.GetUserDelegationKey", cancellationToken: cancellationToken) .ConfigureAwait(false); } @@ -933,7 +938,7 @@ private async Task> GetUserDelegationKeyInternal( /// The operation creates a new /// container under the specified account. If the container with the /// same name already exists, the operation fails. - /// + /// /// For more information, see . /// /// @@ -967,6 +972,7 @@ private async Task> GetUserDelegationKeyInternal( /// A will be thrown if /// a failure occurs. /// + [ForwardsClientCalls] public virtual Response CreateBlobContainer( string containerName, PublicAccessType? publicAccessType = default, @@ -982,7 +988,7 @@ public virtual Response CreateBlobContainer( /// The operation creates a new /// container under the specified account. If the container with the /// same name already exists, the operation fails. - /// + /// /// For more information, see . /// /// @@ -1016,6 +1022,7 @@ public virtual Response CreateBlobContainer( /// A will be thrown if /// a failure occurs. /// + [ForwardsClientCalls] public virtual async Task> CreateBlobContainerAsync( string containerName, PublicAccessType? publicAccessType = default, @@ -1033,7 +1040,7 @@ public virtual async Task> CreateBlobContainerAsyn /// The operation marks the /// specified container for deletion. The container and any blobs /// contained within it are later deleted during garbage collection. - /// + /// /// For more information, see . /// /// @@ -1054,6 +1061,7 @@ public virtual async Task> CreateBlobContainerAsyn /// A will be thrown if /// a failure occurs. /// + [ForwardsClientCalls] public virtual Response DeleteBlobContainer( string containerName, ContainerAccessConditions? accessConditions = default, @@ -1067,7 +1075,7 @@ public virtual Response DeleteBlobContainer( /// The operation marks the /// specified container for deletion. The container and any blobs /// contained within it are later deleted during garbage collection. - /// + /// /// For more information, see . /// /// @@ -1088,6 +1096,7 @@ public virtual Response DeleteBlobContainer( /// A will be thrown if /// a failure occurs. /// + [ForwardsClientCalls] public virtual async Task DeleteBlobContainerAsync( string containerName, ContainerAccessConditions? accessConditions = default, diff --git a/sdk/storage/Azure.Storage.Blobs/src/BlockBlobClient.cs b/sdk/storage/Azure.Storage.Blobs/src/BlockBlobClient.cs index 67acbd55b4117..759cc299d9264 100644 --- a/sdk/storage/Azure.Storage.Blobs/src/BlockBlobClient.cs +++ b/sdk/storage/Azure.Storage.Blobs/src/BlockBlobClient.cs @@ -491,11 +491,12 @@ internal async Task> UploadInternal( ifMatch: blobAccessConditions?.HttpAccessConditions?.IfMatch, ifNoneMatch: blobAccessConditions?.HttpAccessConditions?.IfNoneMatch, async: async, + operationName: "Azure.Storage.Blobs.Specialized.BlockBlobClient.Upload", cancellationToken: cancellationToken) .ConfigureAwait(false); }, new ReliabilityConfiguration(reset: () => content.Seek(0, SeekOrigin.Begin))) - .ConfigureAwait(false); ; + .ConfigureAwait(false); } catch (Exception ex) @@ -732,6 +733,7 @@ internal async Task> StageBlockInternal( transactionalContentHash: transactionalContentHash, leaseId: leaseAccessConditions?.LeaseId, async: async, + operationName: "Azure.Storage.Blobs.Specialized.BlockBlobClient.StageBlock", cancellationToken: cancellationToken); }, cleanup: () => { }) @@ -1001,6 +1003,7 @@ private async Task> StageBlockFromUriInternal( sourceIfMatch: sourceAccessConditions?.IfMatch, sourceIfNoneMatch: sourceAccessConditions?.IfNoneMatch, async: async, + operationName: "Azure.Storage.Blobs.Specialized.BlockBlobClient.StageBlockFromUri", cancellationToken: cancellationToken) .ConfigureAwait(false); } @@ -1226,6 +1229,7 @@ internal async Task> CommitBlockListInternal( ifMatch: blobAccessConditions?.HttpAccessConditions?.IfMatch, ifNoneMatch: blobAccessConditions?.HttpAccessConditions?.IfNoneMatch, async: async, + operationName: "Azure.Storage.Blobs.Specialized.BlockBlobClient.CommitBlockList", cancellationToken: cancellationToken) .ConfigureAwait(false); } @@ -1408,6 +1412,7 @@ private async Task> GetBlockListInternal( snapshot: snapshot, leaseId: leaseAccessConditions?.LeaseId, async: async, + operationName: "Azure.Storage.Blobs.Specialized.BlockBlobClient.GetBlockList", cancellationToken: cancellationToken) .ConfigureAwait(false)) .ToBlockList(); diff --git a/sdk/storage/Azure.Storage.Blobs/src/Generated/BlobRestClient.cs b/sdk/storage/Azure.Storage.Blobs/src/Generated/BlobRestClient.cs index 7ae12f36ddf5a..dfcfe37e8e294 100644 --- a/sdk/storage/Azure.Storage.Blobs/src/Generated/BlobRestClient.cs +++ b/sdk/storage/Azure.Storage.Blobs/src/Generated/BlobRestClient.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. @@ -28,6 +28,7 @@ public static partial class Service /// The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Blob Service Operations. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// Whether to invoke the operation asynchronously. The default value is true. + /// Operation name. /// Cancellation token. /// Azure.Response public static async System.Threading.Tasks.Task SetPropertiesAsync( @@ -37,23 +38,39 @@ public static partial class Service int? timeout = default, string requestId = default, bool async = true, + string operationName = "Azure.Storage.Blobs.ServiceClient.SetProperties", System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.Request _request = SetPropertiesAsync_CreateRequest( - pipeline, - resourceUri, - blobServiceProperties, - timeout, - requestId)) + Azure.Core.Pipeline.DiagnosticScope _scope = pipeline.Diagnostics.CreateScope(operationName); + try { - Azure.Response _response = async ? - // Send the request asynchronously if we're being called via an async path - await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : - // Send the request synchronously through the API that blocks if we're being called via a sync path - // (this is safe because the Task will complete before the user can call Wait) - pipeline.SendRequest(_request, cancellationToken); - cancellationToken.ThrowIfCancellationRequested(); - return SetPropertiesAsync_CreateResponse(_response); + _scope.AddAttribute("url", resourceUri); + _scope.Start(); + using (Azure.Core.Http.Request _request = SetPropertiesAsync_CreateRequest( + pipeline, + resourceUri, + blobServiceProperties, + timeout, + requestId)) + { + Azure.Response _response = async ? + // Send the request asynchronously if we're being called via an async path + await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : + // Send the request synchronously through the API that blocks if we're being called via a sync path + // (this is safe because the Task will complete before the user can call Wait) + pipeline.SendRequest(_request, cancellationToken); + cancellationToken.ThrowIfCancellationRequested(); + return SetPropertiesAsync_CreateResponse(_response); + } + } + catch (System.Exception ex) + { + _scope.Failed(ex); + throw; + } + finally + { + _scope.Dispose(); } } @@ -143,6 +160,7 @@ internal static Azure.Response SetPropertiesAsync_CreateResponse( /// The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Blob Service Operations. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// Whether to invoke the operation asynchronously. The default value is true. + /// Operation name. /// Cancellation token. /// Storage Service Properties. public static async System.Threading.Tasks.Task> GetPropertiesAsync( @@ -151,22 +169,38 @@ internal static Azure.Response SetPropertiesAsync_CreateResponse( int? timeout = default, string requestId = default, bool async = true, + string operationName = "Azure.Storage.Blobs.ServiceClient.GetProperties", System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.Request _request = GetPropertiesAsync_CreateRequest( - pipeline, - resourceUri, - timeout, - requestId)) + Azure.Core.Pipeline.DiagnosticScope _scope = pipeline.Diagnostics.CreateScope(operationName); + try { - Azure.Response _response = async ? - // Send the request asynchronously if we're being called via an async path - await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : - // Send the request synchronously through the API that blocks if we're being called via a sync path - // (this is safe because the Task will complete before the user can call Wait) - pipeline.SendRequest(_request, cancellationToken); - cancellationToken.ThrowIfCancellationRequested(); - return GetPropertiesAsync_CreateResponse(_response); + _scope.AddAttribute("url", resourceUri); + _scope.Start(); + using (Azure.Core.Http.Request _request = GetPropertiesAsync_CreateRequest( + pipeline, + resourceUri, + timeout, + requestId)) + { + Azure.Response _response = async ? + // Send the request asynchronously if we're being called via an async path + await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : + // Send the request synchronously through the API that blocks if we're being called via a sync path + // (this is safe because the Task will complete before the user can call Wait) + pipeline.SendRequest(_request, cancellationToken); + cancellationToken.ThrowIfCancellationRequested(); + return GetPropertiesAsync_CreateResponse(_response); + } + } + catch (System.Exception ex) + { + _scope.Failed(ex); + throw; + } + finally + { + _scope.Dispose(); } } @@ -253,6 +287,7 @@ internal static Azure.Core.Http.Request GetPropertiesAsync_CreateRequest( /// The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Blob Service Operations. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// Whether to invoke the operation asynchronously. The default value is true. + /// Operation name. /// Cancellation token. /// Statistics for the storage service. public static async System.Threading.Tasks.Task> GetStatisticsAsync( @@ -261,22 +296,38 @@ internal static Azure.Core.Http.Request GetPropertiesAsync_CreateRequest( int? timeout = default, string requestId = default, bool async = true, + string operationName = "Azure.Storage.Blobs.ServiceClient.GetStatistics", System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.Request _request = GetStatisticsAsync_CreateRequest( - pipeline, - resourceUri, - timeout, - requestId)) + Azure.Core.Pipeline.DiagnosticScope _scope = pipeline.Diagnostics.CreateScope(operationName); + try + { + _scope.AddAttribute("url", resourceUri); + _scope.Start(); + using (Azure.Core.Http.Request _request = GetStatisticsAsync_CreateRequest( + pipeline, + resourceUri, + timeout, + requestId)) + { + Azure.Response _response = async ? + // Send the request asynchronously if we're being called via an async path + await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : + // Send the request synchronously through the API that blocks if we're being called via a sync path + // (this is safe because the Task will complete before the user can call Wait) + pipeline.SendRequest(_request, cancellationToken); + cancellationToken.ThrowIfCancellationRequested(); + return GetStatisticsAsync_CreateResponse(_response); + } + } + catch (System.Exception ex) { - Azure.Response _response = async ? - // Send the request asynchronously if we're being called via an async path - await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : - // Send the request synchronously through the API that blocks if we're being called via a sync path - // (this is safe because the Task will complete before the user can call Wait) - pipeline.SendRequest(_request, cancellationToken); - cancellationToken.ThrowIfCancellationRequested(); - return GetStatisticsAsync_CreateResponse(_response); + _scope.Failed(ex); + throw; + } + finally + { + _scope.Dispose(); } } @@ -367,6 +418,7 @@ internal static Azure.Core.Http.Request GetStatisticsAsync_CreateRequest( /// The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Blob Service Operations. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// Whether to invoke the operation asynchronously. The default value is true. + /// Operation name. /// Cancellation token. /// An enumeration of containers public static async System.Threading.Tasks.Task> ListContainersSegmentAsync( @@ -379,26 +431,42 @@ internal static Azure.Core.Http.Request GetStatisticsAsync_CreateRequest( int? timeout = default, string requestId = default, bool async = true, + string operationName = "Azure.Storage.Blobs.ServiceClient.ListContainersSegment", System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.Request _request = ListContainersSegmentAsync_CreateRequest( - pipeline, - resourceUri, - prefix, - marker, - maxresults, - include, - timeout, - requestId)) + Azure.Core.Pipeline.DiagnosticScope _scope = pipeline.Diagnostics.CreateScope(operationName); + try { - Azure.Response _response = async ? - // Send the request asynchronously if we're being called via an async path - await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : - // Send the request synchronously through the API that blocks if we're being called via a sync path - // (this is safe because the Task will complete before the user can call Wait) - pipeline.SendRequest(_request, cancellationToken); - cancellationToken.ThrowIfCancellationRequested(); - return ListContainersSegmentAsync_CreateResponse(_response); + _scope.AddAttribute("url", resourceUri); + _scope.Start(); + using (Azure.Core.Http.Request _request = ListContainersSegmentAsync_CreateRequest( + pipeline, + resourceUri, + prefix, + marker, + maxresults, + include, + timeout, + requestId)) + { + Azure.Response _response = async ? + // Send the request asynchronously if we're being called via an async path + await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : + // Send the request synchronously through the API that blocks if we're being called via a sync path + // (this is safe because the Task will complete before the user can call Wait) + pipeline.SendRequest(_request, cancellationToken); + cancellationToken.ThrowIfCancellationRequested(); + return ListContainersSegmentAsync_CreateResponse(_response); + } + } + catch (System.Exception ex) + { + _scope.Failed(ex); + throw; + } + finally + { + _scope.Dispose(); } } @@ -497,6 +565,7 @@ internal static Azure.Core.Http.Request ListContainersSegmentAsync_CreateRequest /// The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Blob Service Operations. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// Whether to invoke the operation asynchronously. The default value is true. + /// Operation name. /// Cancellation token. /// A user delegation key public static async System.Threading.Tasks.Task> GetUserDelegationKeyAsync( @@ -506,23 +575,39 @@ internal static Azure.Core.Http.Request ListContainersSegmentAsync_CreateRequest int? timeout = default, string requestId = default, bool async = true, + string operationName = "Azure.Storage.Blobs.ServiceClient.GetUserDelegationKey", System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.Request _request = GetUserDelegationKeyAsync_CreateRequest( - pipeline, - resourceUri, - keyInfo, - timeout, - requestId)) + Azure.Core.Pipeline.DiagnosticScope _scope = pipeline.Diagnostics.CreateScope(operationName); + try + { + _scope.AddAttribute("url", resourceUri); + _scope.Start(); + using (Azure.Core.Http.Request _request = GetUserDelegationKeyAsync_CreateRequest( + pipeline, + resourceUri, + keyInfo, + timeout, + requestId)) + { + Azure.Response _response = async ? + // Send the request asynchronously if we're being called via an async path + await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : + // Send the request synchronously through the API that blocks if we're being called via a sync path + // (this is safe because the Task will complete before the user can call Wait) + pipeline.SendRequest(_request, cancellationToken); + cancellationToken.ThrowIfCancellationRequested(); + return GetUserDelegationKeyAsync_CreateResponse(_response); + } + } + catch (System.Exception ex) { - Azure.Response _response = async ? - // Send the request asynchronously if we're being called via an async path - await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : - // Send the request synchronously through the API that blocks if we're being called via a sync path - // (this is safe because the Task will complete before the user can call Wait) - pipeline.SendRequest(_request, cancellationToken); - cancellationToken.ThrowIfCancellationRequested(); - return GetUserDelegationKeyAsync_CreateResponse(_response); + _scope.Failed(ex); + throw; + } + finally + { + _scope.Dispose(); } } @@ -620,26 +705,43 @@ internal static Azure.Core.Http.Request GetUserDelegationKeyAsync_CreateRequest( /// The pipeline used for sending requests. /// The URL of the service account, container, or blob that is the targe of the desired operation. /// Whether to invoke the operation asynchronously. The default value is true. + /// Operation name. /// Cancellation token. /// Azure.Response{Azure.Storage.Blobs.Models.AccountInfo} public static async System.Threading.Tasks.Task> GetAccountInfoAsync( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, bool async = true, + string operationName = "Azure.Storage.Blobs.ServiceClient.GetAccountInfo", System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.Request _request = GetAccountInfoAsync_CreateRequest( - pipeline, - resourceUri)) + Azure.Core.Pipeline.DiagnosticScope _scope = pipeline.Diagnostics.CreateScope(operationName); + try + { + _scope.AddAttribute("url", resourceUri); + _scope.Start(); + using (Azure.Core.Http.Request _request = GetAccountInfoAsync_CreateRequest( + pipeline, + resourceUri)) + { + Azure.Response _response = async ? + // Send the request asynchronously if we're being called via an async path + await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : + // Send the request synchronously through the API that blocks if we're being called via a sync path + // (this is safe because the Task will complete before the user can call Wait) + pipeline.SendRequest(_request, cancellationToken); + cancellationToken.ThrowIfCancellationRequested(); + return GetAccountInfoAsync_CreateResponse(_response); + } + } + catch (System.Exception ex) + { + _scope.Failed(ex); + throw; + } + finally { - Azure.Response _response = async ? - // Send the request asynchronously if we're being called via an async path - await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : - // Send the request synchronously through the API that blocks if we're being called via a sync path - // (this is safe because the Task will complete before the user can call Wait) - pipeline.SendRequest(_request, cancellationToken); - cancellationToken.ThrowIfCancellationRequested(); - return GetAccountInfoAsync_CreateResponse(_response); + _scope.Dispose(); } } @@ -740,6 +842,7 @@ public static partial class Container /// Specifies whether data in the container may be accessed publicly and the level of access /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// Whether to invoke the operation asynchronously. The default value is true. + /// Operation name. /// Cancellation token. /// Azure.Response{Azure.Storage.Blobs.Models.ContainerInfo} public static async System.Threading.Tasks.Task> CreateAsync( @@ -750,24 +853,40 @@ public static partial class Container Azure.Storage.Blobs.Models.PublicAccessType? access = default, string requestId = default, bool async = true, + string operationName = "Azure.Storage.Blobs.ContainerClient.Create", System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.Request _request = CreateAsync_CreateRequest( - pipeline, - resourceUri, - timeout, - metadata, - access, - requestId)) + Azure.Core.Pipeline.DiagnosticScope _scope = pipeline.Diagnostics.CreateScope(operationName); + try + { + _scope.AddAttribute("url", resourceUri); + _scope.Start(); + using (Azure.Core.Http.Request _request = CreateAsync_CreateRequest( + pipeline, + resourceUri, + timeout, + metadata, + access, + requestId)) + { + Azure.Response _response = async ? + // Send the request asynchronously if we're being called via an async path + await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : + // Send the request synchronously through the API that blocks if we're being called via a sync path + // (this is safe because the Task will complete before the user can call Wait) + pipeline.SendRequest(_request, cancellationToken); + cancellationToken.ThrowIfCancellationRequested(); + return CreateAsync_CreateResponse(_response); + } + } + catch (System.Exception ex) + { + _scope.Failed(ex); + throw; + } + finally { - Azure.Response _response = async ? - // Send the request asynchronously if we're being called via an async path - await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : - // Send the request synchronously through the API that blocks if we're being called via a sync path - // (this is safe because the Task will complete before the user can call Wait) - pipeline.SendRequest(_request, cancellationToken); - cancellationToken.ThrowIfCancellationRequested(); - return CreateAsync_CreateResponse(_response); + _scope.Dispose(); } } @@ -875,6 +994,7 @@ internal static Azure.Core.Http.Request CreateAsync_CreateRequest( /// If specified, the operation only succeeds if the resource's lease is active and matches this ID. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// Whether to invoke the operation asynchronously. The default value is true. + /// Operation name. /// Cancellation token. /// Azure.Response{Azure.Storage.Blobs.Models.FlattenedContainerItem} public static async System.Threading.Tasks.Task> GetPropertiesAsync( @@ -884,23 +1004,39 @@ internal static Azure.Core.Http.Request CreateAsync_CreateRequest( string leaseId = default, string requestId = default, bool async = true, + string operationName = "Azure.Storage.Blobs.ContainerClient.GetProperties", System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.Request _request = GetPropertiesAsync_CreateRequest( - pipeline, - resourceUri, - timeout, - leaseId, - requestId)) + Azure.Core.Pipeline.DiagnosticScope _scope = pipeline.Diagnostics.CreateScope(operationName); + try + { + _scope.AddAttribute("url", resourceUri); + _scope.Start(); + using (Azure.Core.Http.Request _request = GetPropertiesAsync_CreateRequest( + pipeline, + resourceUri, + timeout, + leaseId, + requestId)) + { + Azure.Response _response = async ? + // Send the request asynchronously if we're being called via an async path + await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : + // Send the request synchronously through the API that blocks if we're being called via a sync path + // (this is safe because the Task will complete before the user can call Wait) + pipeline.SendRequest(_request, cancellationToken); + cancellationToken.ThrowIfCancellationRequested(); + return GetPropertiesAsync_CreateResponse(_response); + } + } + catch (System.Exception ex) { - Azure.Response _response = async ? - // Send the request asynchronously if we're being called via an async path - await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : - // Send the request synchronously through the API that blocks if we're being called via a sync path - // (this is safe because the Task will complete before the user can call Wait) - pipeline.SendRequest(_request, cancellationToken); - cancellationToken.ThrowIfCancellationRequested(); - return GetPropertiesAsync_CreateResponse(_response); + _scope.Failed(ex); + throw; + } + finally + { + _scope.Dispose(); } } @@ -1046,6 +1182,7 @@ internal static Azure.Core.Http.Request GetPropertiesAsync_CreateRequest( /// Specify this header value to operate only on a blob if it has not been modified since the specified date/time. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// Whether to invoke the operation asynchronously. The default value is true. + /// Operation name. /// Cancellation token. /// Azure.Response public static async System.Threading.Tasks.Task DeleteAsync( @@ -1057,25 +1194,41 @@ internal static Azure.Core.Http.Request GetPropertiesAsync_CreateRequest( System.DateTimeOffset? ifUnmodifiedSince = default, string requestId = default, bool async = true, + string operationName = "Azure.Storage.Blobs.ContainerClient.Delete", System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.Request _request = DeleteAsync_CreateRequest( - pipeline, - resourceUri, - timeout, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - requestId)) + Azure.Core.Pipeline.DiagnosticScope _scope = pipeline.Diagnostics.CreateScope(operationName); + try + { + _scope.AddAttribute("url", resourceUri); + _scope.Start(); + using (Azure.Core.Http.Request _request = DeleteAsync_CreateRequest( + pipeline, + resourceUri, + timeout, + leaseId, + ifModifiedSince, + ifUnmodifiedSince, + requestId)) + { + Azure.Response _response = async ? + // Send the request asynchronously if we're being called via an async path + await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : + // Send the request synchronously through the API that blocks if we're being called via a sync path + // (this is safe because the Task will complete before the user can call Wait) + pipeline.SendRequest(_request, cancellationToken); + cancellationToken.ThrowIfCancellationRequested(); + return DeleteAsync_CreateResponse(_response); + } + } + catch (System.Exception ex) { - Azure.Response _response = async ? - // Send the request asynchronously if we're being called via an async path - await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : - // Send the request synchronously through the API that blocks if we're being called via a sync path - // (this is safe because the Task will complete before the user can call Wait) - pipeline.SendRequest(_request, cancellationToken); - cancellationToken.ThrowIfCancellationRequested(); - return DeleteAsync_CreateResponse(_response); + _scope.Failed(ex); + throw; + } + finally + { + _scope.Dispose(); } } @@ -1163,6 +1316,7 @@ internal static Azure.Response DeleteAsync_CreateResponse( /// Specify this header value to operate only on a blob if it has been modified since the specified date/time. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// Whether to invoke the operation asynchronously. The default value is true. + /// Operation name. /// Cancellation token. /// Azure.Response{Azure.Storage.Blobs.Models.ContainerInfo} public static async System.Threading.Tasks.Task> SetMetadataAsync( @@ -1174,25 +1328,41 @@ internal static Azure.Response DeleteAsync_CreateResponse( System.DateTimeOffset? ifModifiedSince = default, string requestId = default, bool async = true, + string operationName = "Azure.Storage.Blobs.ContainerClient.SetMetadata", System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.Request _request = SetMetadataAsync_CreateRequest( - pipeline, - resourceUri, - timeout, - leaseId, - metadata, - ifModifiedSince, - requestId)) + Azure.Core.Pipeline.DiagnosticScope _scope = pipeline.Diagnostics.CreateScope(operationName); + try + { + _scope.AddAttribute("url", resourceUri); + _scope.Start(); + using (Azure.Core.Http.Request _request = SetMetadataAsync_CreateRequest( + pipeline, + resourceUri, + timeout, + leaseId, + metadata, + ifModifiedSince, + requestId)) + { + Azure.Response _response = async ? + // Send the request asynchronously if we're being called via an async path + await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : + // Send the request synchronously through the API that blocks if we're being called via a sync path + // (this is safe because the Task will complete before the user can call Wait) + pipeline.SendRequest(_request, cancellationToken); + cancellationToken.ThrowIfCancellationRequested(); + return SetMetadataAsync_CreateResponse(_response); + } + } + catch (System.Exception ex) + { + _scope.Failed(ex); + throw; + } + finally { - Azure.Response _response = async ? - // Send the request asynchronously if we're being called via an async path - await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : - // Send the request synchronously through the API that blocks if we're being called via a sync path - // (this is safe because the Task will complete before the user can call Wait) - pipeline.SendRequest(_request, cancellationToken); - cancellationToken.ThrowIfCancellationRequested(); - return SetMetadataAsync_CreateResponse(_response); + _scope.Dispose(); } } @@ -1304,6 +1474,7 @@ internal static Azure.Core.Http.Request SetMetadataAsync_CreateRequest( /// If specified, the operation only succeeds if the resource's lease is active and matches this ID. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// Whether to invoke the operation asynchronously. The default value is true. + /// Operation name. /// Cancellation token. /// Azure.Response{Azure.Storage.Blobs.Models.ContainerAccessPolicy} public static async System.Threading.Tasks.Task> GetAccessPolicyAsync( @@ -1313,23 +1484,39 @@ internal static Azure.Core.Http.Request SetMetadataAsync_CreateRequest( string leaseId = default, string requestId = default, bool async = true, + string operationName = "Azure.Storage.Blobs.ContainerClient.GetAccessPolicy", System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.Request _request = GetAccessPolicyAsync_CreateRequest( - pipeline, - resourceUri, - timeout, - leaseId, - requestId)) + Azure.Core.Pipeline.DiagnosticScope _scope = pipeline.Diagnostics.CreateScope(operationName); + try { - Azure.Response _response = async ? - // Send the request asynchronously if we're being called via an async path - await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : - // Send the request synchronously through the API that blocks if we're being called via a sync path - // (this is safe because the Task will complete before the user can call Wait) - pipeline.SendRequest(_request, cancellationToken); - cancellationToken.ThrowIfCancellationRequested(); - return GetAccessPolicyAsync_CreateResponse(_response); + _scope.AddAttribute("url", resourceUri); + _scope.Start(); + using (Azure.Core.Http.Request _request = GetAccessPolicyAsync_CreateRequest( + pipeline, + resourceUri, + timeout, + leaseId, + requestId)) + { + Azure.Response _response = async ? + // Send the request asynchronously if we're being called via an async path + await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : + // Send the request synchronously through the API that blocks if we're being called via a sync path + // (this is safe because the Task will complete before the user can call Wait) + pipeline.SendRequest(_request, cancellationToken); + cancellationToken.ThrowIfCancellationRequested(); + return GetAccessPolicyAsync_CreateResponse(_response); + } + } + catch (System.Exception ex) + { + _scope.Failed(ex); + throw; + } + finally + { + _scope.Dispose(); } } @@ -1444,6 +1631,7 @@ internal static Azure.Core.Http.Request GetAccessPolicyAsync_CreateRequest( /// Specify this header value to operate only on a blob if it has not been modified since the specified date/time. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// Whether to invoke the operation asynchronously. The default value is true. + /// Operation name. /// Cancellation token. /// Azure.Response{Azure.Storage.Blobs.Models.ContainerInfo} public static async System.Threading.Tasks.Task> SetAccessPolicyAsync( @@ -1457,27 +1645,43 @@ internal static Azure.Core.Http.Request GetAccessPolicyAsync_CreateRequest( System.DateTimeOffset? ifUnmodifiedSince = default, string requestId = default, bool async = true, + string operationName = "Azure.Storage.Blobs.ContainerClient.SetAccessPolicy", System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.Request _request = SetAccessPolicyAsync_CreateRequest( - pipeline, - resourceUri, - permissions, - timeout, - leaseId, - access, - ifModifiedSince, - ifUnmodifiedSince, - requestId)) + Azure.Core.Pipeline.DiagnosticScope _scope = pipeline.Diagnostics.CreateScope(operationName); + try + { + _scope.AddAttribute("url", resourceUri); + _scope.Start(); + using (Azure.Core.Http.Request _request = SetAccessPolicyAsync_CreateRequest( + pipeline, + resourceUri, + permissions, + timeout, + leaseId, + access, + ifModifiedSince, + ifUnmodifiedSince, + requestId)) + { + Azure.Response _response = async ? + // Send the request asynchronously if we're being called via an async path + await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : + // Send the request synchronously through the API that blocks if we're being called via a sync path + // (this is safe because the Task will complete before the user can call Wait) + pipeline.SendRequest(_request, cancellationToken); + cancellationToken.ThrowIfCancellationRequested(); + return SetAccessPolicyAsync_CreateResponse(_response); + } + } + catch (System.Exception ex) + { + _scope.Failed(ex); + throw; + } + finally { - Azure.Response _response = async ? - // Send the request asynchronously if we're being called via an async path - await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : - // Send the request synchronously through the API that blocks if we're being called via a sync path - // (this is safe because the Task will complete before the user can call Wait) - pipeline.SendRequest(_request, cancellationToken); - cancellationToken.ThrowIfCancellationRequested(); - return SetAccessPolicyAsync_CreateResponse(_response); + _scope.Dispose(); } } @@ -1606,6 +1810,7 @@ internal static Azure.Core.Http.Request SetAccessPolicyAsync_CreateRequest( /// Specify this header value to operate only on a blob if it has not been modified since the specified date/time. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// Whether to invoke the operation asynchronously. The default value is true. + /// Operation name. /// Cancellation token. /// Azure.Response{Azure.Storage.Blobs.Models.Lease} public static async System.Threading.Tasks.Task> AcquireLeaseAsync( @@ -1618,26 +1823,42 @@ internal static Azure.Core.Http.Request SetAccessPolicyAsync_CreateRequest( System.DateTimeOffset? ifUnmodifiedSince = default, string requestId = default, bool async = true, + string operationName = "Azure.Storage.Blobs.ContainerClient.AcquireLease", System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.Request _request = AcquireLeaseAsync_CreateRequest( - pipeline, - resourceUri, - timeout, - duration, - proposedLeaseId, - ifModifiedSince, - ifUnmodifiedSince, - requestId)) + Azure.Core.Pipeline.DiagnosticScope _scope = pipeline.Diagnostics.CreateScope(operationName); + try { - Azure.Response _response = async ? - // Send the request asynchronously if we're being called via an async path - await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : - // Send the request synchronously through the API that blocks if we're being called via a sync path - // (this is safe because the Task will complete before the user can call Wait) - pipeline.SendRequest(_request, cancellationToken); - cancellationToken.ThrowIfCancellationRequested(); - return AcquireLeaseAsync_CreateResponse(_response); + _scope.AddAttribute("url", resourceUri); + _scope.Start(); + using (Azure.Core.Http.Request _request = AcquireLeaseAsync_CreateRequest( + pipeline, + resourceUri, + timeout, + duration, + proposedLeaseId, + ifModifiedSince, + ifUnmodifiedSince, + requestId)) + { + Azure.Response _response = async ? + // Send the request asynchronously if we're being called via an async path + await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : + // Send the request synchronously through the API that blocks if we're being called via a sync path + // (this is safe because the Task will complete before the user can call Wait) + pipeline.SendRequest(_request, cancellationToken); + cancellationToken.ThrowIfCancellationRequested(); + return AcquireLeaseAsync_CreateResponse(_response); + } + } + catch (System.Exception ex) + { + _scope.Failed(ex); + throw; + } + finally + { + _scope.Dispose(); } } @@ -1754,6 +1975,7 @@ internal static Azure.Core.Http.Request AcquireLeaseAsync_CreateRequest( /// Specify this header value to operate only on a blob if it has not been modified since the specified date/time. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// Whether to invoke the operation asynchronously. The default value is true. + /// Operation name. /// Cancellation token. /// Azure.Response{Azure.Storage.Blobs.Models.ContainerInfo} public static async System.Threading.Tasks.Task> ReleaseLeaseAsync( @@ -1765,25 +1987,41 @@ internal static Azure.Core.Http.Request AcquireLeaseAsync_CreateRequest( System.DateTimeOffset? ifUnmodifiedSince = default, string requestId = default, bool async = true, + string operationName = "Azure.Storage.Blobs.ContainerClient.ReleaseLease", System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.Request _request = ReleaseLeaseAsync_CreateRequest( - pipeline, - resourceUri, - leaseId, - timeout, - ifModifiedSince, - ifUnmodifiedSince, - requestId)) + Azure.Core.Pipeline.DiagnosticScope _scope = pipeline.Diagnostics.CreateScope(operationName); + try + { + _scope.AddAttribute("url", resourceUri); + _scope.Start(); + using (Azure.Core.Http.Request _request = ReleaseLeaseAsync_CreateRequest( + pipeline, + resourceUri, + leaseId, + timeout, + ifModifiedSince, + ifUnmodifiedSince, + requestId)) + { + Azure.Response _response = async ? + // Send the request asynchronously if we're being called via an async path + await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : + // Send the request synchronously through the API that blocks if we're being called via a sync path + // (this is safe because the Task will complete before the user can call Wait) + pipeline.SendRequest(_request, cancellationToken); + cancellationToken.ThrowIfCancellationRequested(); + return ReleaseLeaseAsync_CreateResponse(_response); + } + } + catch (System.Exception ex) { - Azure.Response _response = async ? - // Send the request asynchronously if we're being called via an async path - await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : - // Send the request synchronously through the API that blocks if we're being called via a sync path - // (this is safe because the Task will complete before the user can call Wait) - pipeline.SendRequest(_request, cancellationToken); - cancellationToken.ThrowIfCancellationRequested(); - return ReleaseLeaseAsync_CreateResponse(_response); + _scope.Failed(ex); + throw; + } + finally + { + _scope.Dispose(); } } @@ -1897,6 +2135,7 @@ internal static Azure.Core.Http.Request ReleaseLeaseAsync_CreateRequest( /// Specify this header value to operate only on a blob if it has not been modified since the specified date/time. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// Whether to invoke the operation asynchronously. The default value is true. + /// Operation name. /// Cancellation token. /// Azure.Response{Azure.Storage.Blobs.Models.Lease} public static async System.Threading.Tasks.Task> RenewLeaseAsync( @@ -1908,25 +2147,41 @@ internal static Azure.Core.Http.Request ReleaseLeaseAsync_CreateRequest( System.DateTimeOffset? ifUnmodifiedSince = default, string requestId = default, bool async = true, + string operationName = "Azure.Storage.Blobs.ContainerClient.RenewLease", System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.Request _request = RenewLeaseAsync_CreateRequest( - pipeline, - resourceUri, - leaseId, - timeout, - ifModifiedSince, - ifUnmodifiedSince, - requestId)) + Azure.Core.Pipeline.DiagnosticScope _scope = pipeline.Diagnostics.CreateScope(operationName); + try + { + _scope.AddAttribute("url", resourceUri); + _scope.Start(); + using (Azure.Core.Http.Request _request = RenewLeaseAsync_CreateRequest( + pipeline, + resourceUri, + leaseId, + timeout, + ifModifiedSince, + ifUnmodifiedSince, + requestId)) + { + Azure.Response _response = async ? + // Send the request asynchronously if we're being called via an async path + await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : + // Send the request synchronously through the API that blocks if we're being called via a sync path + // (this is safe because the Task will complete before the user can call Wait) + pipeline.SendRequest(_request, cancellationToken); + cancellationToken.ThrowIfCancellationRequested(); + return RenewLeaseAsync_CreateResponse(_response); + } + } + catch (System.Exception ex) { - Azure.Response _response = async ? - // Send the request asynchronously if we're being called via an async path - await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : - // Send the request synchronously through the API that blocks if we're being called via a sync path - // (this is safe because the Task will complete before the user can call Wait) - pipeline.SendRequest(_request, cancellationToken); - cancellationToken.ThrowIfCancellationRequested(); - return RenewLeaseAsync_CreateResponse(_response); + _scope.Failed(ex); + throw; + } + finally + { + _scope.Dispose(); } } @@ -2044,6 +2299,7 @@ internal static Azure.Core.Http.Request RenewLeaseAsync_CreateRequest( /// Specify this header value to operate only on a blob if it has not been modified since the specified date/time. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// Whether to invoke the operation asynchronously. The default value is true. + /// Operation name. /// Cancellation token. /// Azure.Response{Azure.Storage.Blobs.Models.BrokenLease} public static async System.Threading.Tasks.Task> BreakLeaseAsync( @@ -2055,25 +2311,41 @@ internal static Azure.Core.Http.Request RenewLeaseAsync_CreateRequest( System.DateTimeOffset? ifUnmodifiedSince = default, string requestId = default, bool async = true, + string operationName = "Azure.Storage.Blobs.ContainerClient.BreakLease", System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.Request _request = BreakLeaseAsync_CreateRequest( - pipeline, - resourceUri, - timeout, - breakPeriod, - ifModifiedSince, - ifUnmodifiedSince, - requestId)) + Azure.Core.Pipeline.DiagnosticScope _scope = pipeline.Diagnostics.CreateScope(operationName); + try { - Azure.Response _response = async ? - // Send the request asynchronously if we're being called via an async path - await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : - // Send the request synchronously through the API that blocks if we're being called via a sync path - // (this is safe because the Task will complete before the user can call Wait) - pipeline.SendRequest(_request, cancellationToken); - cancellationToken.ThrowIfCancellationRequested(); - return BreakLeaseAsync_CreateResponse(_response); + _scope.AddAttribute("url", resourceUri); + _scope.Start(); + using (Azure.Core.Http.Request _request = BreakLeaseAsync_CreateRequest( + pipeline, + resourceUri, + timeout, + breakPeriod, + ifModifiedSince, + ifUnmodifiedSince, + requestId)) + { + Azure.Response _response = async ? + // Send the request asynchronously if we're being called via an async path + await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : + // Send the request synchronously through the API that blocks if we're being called via a sync path + // (this is safe because the Task will complete before the user can call Wait) + pipeline.SendRequest(_request, cancellationToken); + cancellationToken.ThrowIfCancellationRequested(); + return BreakLeaseAsync_CreateResponse(_response); + } + } + catch (System.Exception ex) + { + _scope.Failed(ex); + throw; + } + finally + { + _scope.Dispose(); } } @@ -2200,6 +2472,7 @@ internal static Azure.Core.Http.Request BreakLeaseAsync_CreateRequest( /// Specify this header value to operate only on a blob if it has not been modified since the specified date/time. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// Whether to invoke the operation asynchronously. The default value is true. + /// Operation name. /// Cancellation token. /// Azure.Response{Azure.Storage.Blobs.Models.Lease} public static async System.Threading.Tasks.Task> ChangeLeaseAsync( @@ -2212,26 +2485,42 @@ internal static Azure.Core.Http.Request BreakLeaseAsync_CreateRequest( System.DateTimeOffset? ifUnmodifiedSince = default, string requestId = default, bool async = true, + string operationName = "Azure.Storage.Blobs.ContainerClient.ChangeLease", System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.Request _request = ChangeLeaseAsync_CreateRequest( - pipeline, - resourceUri, - leaseId, - proposedLeaseId, - timeout, - ifModifiedSince, - ifUnmodifiedSince, - requestId)) + Azure.Core.Pipeline.DiagnosticScope _scope = pipeline.Diagnostics.CreateScope(operationName); + try + { + _scope.AddAttribute("url", resourceUri); + _scope.Start(); + using (Azure.Core.Http.Request _request = ChangeLeaseAsync_CreateRequest( + pipeline, + resourceUri, + leaseId, + proposedLeaseId, + timeout, + ifModifiedSince, + ifUnmodifiedSince, + requestId)) + { + Azure.Response _response = async ? + // Send the request asynchronously if we're being called via an async path + await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : + // Send the request synchronously through the API that blocks if we're being called via a sync path + // (this is safe because the Task will complete before the user can call Wait) + pipeline.SendRequest(_request, cancellationToken); + cancellationToken.ThrowIfCancellationRequested(); + return ChangeLeaseAsync_CreateResponse(_response); + } + } + catch (System.Exception ex) { - Azure.Response _response = async ? - // Send the request asynchronously if we're being called via an async path - await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : - // Send the request synchronously through the API that blocks if we're being called via a sync path - // (this is safe because the Task will complete before the user can call Wait) - pipeline.SendRequest(_request, cancellationToken); - cancellationToken.ThrowIfCancellationRequested(); - return ChangeLeaseAsync_CreateResponse(_response); + _scope.Failed(ex); + throw; + } + finally + { + _scope.Dispose(); } } @@ -2357,6 +2646,7 @@ internal static Azure.Core.Http.Request ChangeLeaseAsync_CreateRequest( /// The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Blob Service Operations. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// Whether to invoke the operation asynchronously. The default value is true. + /// Operation name. /// Cancellation token. /// An enumeration of blobs public static async System.Threading.Tasks.Task> ListBlobsFlatSegmentAsync( @@ -2369,26 +2659,42 @@ internal static Azure.Core.Http.Request ChangeLeaseAsync_CreateRequest( int? timeout = default, string requestId = default, bool async = true, + string operationName = "Azure.Storage.Blobs.ContainerClient.ListBlobsFlatSegment", System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.Request _request = ListBlobsFlatSegmentAsync_CreateRequest( - pipeline, - resourceUri, - prefix, - marker, - maxresults, - include, - timeout, - requestId)) + Azure.Core.Pipeline.DiagnosticScope _scope = pipeline.Diagnostics.CreateScope(operationName); + try { - Azure.Response _response = async ? - // Send the request asynchronously if we're being called via an async path - await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : - // Send the request synchronously through the API that blocks if we're being called via a sync path - // (this is safe because the Task will complete before the user can call Wait) - pipeline.SendRequest(_request, cancellationToken); - cancellationToken.ThrowIfCancellationRequested(); - return ListBlobsFlatSegmentAsync_CreateResponse(_response); + _scope.AddAttribute("url", resourceUri); + _scope.Start(); + using (Azure.Core.Http.Request _request = ListBlobsFlatSegmentAsync_CreateRequest( + pipeline, + resourceUri, + prefix, + marker, + maxresults, + include, + timeout, + requestId)) + { + Azure.Response _response = async ? + // Send the request asynchronously if we're being called via an async path + await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : + // Send the request synchronously through the API that blocks if we're being called via a sync path + // (this is safe because the Task will complete before the user can call Wait) + pipeline.SendRequest(_request, cancellationToken); + cancellationToken.ThrowIfCancellationRequested(); + return ListBlobsFlatSegmentAsync_CreateResponse(_response); + } + } + catch (System.Exception ex) + { + _scope.Failed(ex); + throw; + } + finally + { + _scope.Dispose(); } } @@ -2492,6 +2798,7 @@ internal static Azure.Core.Http.Request ListBlobsFlatSegmentAsync_CreateRequest( /// The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Blob Service Operations. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// Whether to invoke the operation asynchronously. The default value is true. + /// Operation name. /// Cancellation token. /// An enumeration of blobs public static async System.Threading.Tasks.Task> ListBlobsHierarchySegmentAsync( @@ -2505,27 +2812,43 @@ internal static Azure.Core.Http.Request ListBlobsFlatSegmentAsync_CreateRequest( int? timeout = default, string requestId = default, bool async = true, + string operationName = "Azure.Storage.Blobs.ContainerClient.ListBlobsHierarchySegment", System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.Request _request = ListBlobsHierarchySegmentAsync_CreateRequest( - pipeline, - resourceUri, - prefix, - delimiter, - marker, - maxresults, - include, - timeout, - requestId)) + Azure.Core.Pipeline.DiagnosticScope _scope = pipeline.Diagnostics.CreateScope(operationName); + try + { + _scope.AddAttribute("url", resourceUri); + _scope.Start(); + using (Azure.Core.Http.Request _request = ListBlobsHierarchySegmentAsync_CreateRequest( + pipeline, + resourceUri, + prefix, + delimiter, + marker, + maxresults, + include, + timeout, + requestId)) + { + Azure.Response _response = async ? + // Send the request asynchronously if we're being called via an async path + await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : + // Send the request synchronously through the API that blocks if we're being called via a sync path + // (this is safe because the Task will complete before the user can call Wait) + pipeline.SendRequest(_request, cancellationToken); + cancellationToken.ThrowIfCancellationRequested(); + return ListBlobsHierarchySegmentAsync_CreateResponse(_response); + } + } + catch (System.Exception ex) + { + _scope.Failed(ex); + throw; + } + finally { - Azure.Response _response = async ? - // Send the request asynchronously if we're being called via an async path - await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : - // Send the request synchronously through the API that blocks if we're being called via a sync path - // (this is safe because the Task will complete before the user can call Wait) - pipeline.SendRequest(_request, cancellationToken); - cancellationToken.ThrowIfCancellationRequested(); - return ListBlobsHierarchySegmentAsync_CreateResponse(_response); + _scope.Dispose(); } } @@ -2643,6 +2966,7 @@ public static partial class Blob /// Specify an ETag value to operate only on blobs without a matching value. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// Whether to invoke the operation asynchronously. The default value is true. + /// Operation name. /// Cancellation token. /// Azure.Response{Azure.Storage.Blobs.Models.FlattenedDownloadProperties} public static async System.Threading.Tasks.Task> DownloadAsync( @@ -2659,30 +2983,46 @@ public static partial class Blob Azure.Core.Http.ETag? ifNoneMatch = default, string requestId = default, bool async = true, + string operationName = "Azure.Storage.Blobs.BlobClient.Download", System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.Request _request = DownloadAsync_CreateRequest( - pipeline, - resourceUri, - snapshot, - timeout, - range, - leaseId, - rangeGetContentHash, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - requestId)) + Azure.Core.Pipeline.DiagnosticScope _scope = pipeline.Diagnostics.CreateScope(operationName); + try + { + _scope.AddAttribute("url", resourceUri); + _scope.Start(); + using (Azure.Core.Http.Request _request = DownloadAsync_CreateRequest( + pipeline, + resourceUri, + snapshot, + timeout, + range, + leaseId, + rangeGetContentHash, + ifModifiedSince, + ifUnmodifiedSince, + ifMatch, + ifNoneMatch, + requestId)) + { + Azure.Response _response = async ? + // Send the request asynchronously if we're being called via an async path + await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : + // Send the request synchronously through the API that blocks if we're being called via a sync path + // (this is safe because the Task will complete before the user can call Wait) + pipeline.SendRequest(_request, cancellationToken); + cancellationToken.ThrowIfCancellationRequested(); + return DownloadAsync_CreateResponse(_response); + } + } + catch (System.Exception ex) { - Azure.Response _response = async ? - // Send the request asynchronously if we're being called via an async path - await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : - // Send the request synchronously through the API that blocks if we're being called via a sync path - // (this is safe because the Task will complete before the user can call Wait) - pipeline.SendRequest(_request, cancellationToken); - cancellationToken.ThrowIfCancellationRequested(); - return DownloadAsync_CreateResponse(_response); + _scope.Failed(ex); + throw; + } + finally + { + _scope.Dispose(); } } @@ -3075,6 +3415,7 @@ internal static Azure.Core.Http.Request DownloadAsync_CreateRequest( /// Specify an ETag value to operate only on blobs without a matching value. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// Whether to invoke the operation asynchronously. The default value is true. + /// Operation name. /// Cancellation token. /// Azure.Response{Azure.Storage.Blobs.Models.BlobProperties} public static async System.Threading.Tasks.Task> GetPropertiesAsync( @@ -3089,28 +3430,44 @@ internal static Azure.Core.Http.Request DownloadAsync_CreateRequest( Azure.Core.Http.ETag? ifNoneMatch = default, string requestId = default, bool async = true, + string operationName = "Azure.Storage.Blobs.BlobClient.GetProperties", System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.Request _request = GetPropertiesAsync_CreateRequest( - pipeline, - resourceUri, - snapshot, - timeout, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - requestId)) + Azure.Core.Pipeline.DiagnosticScope _scope = pipeline.Diagnostics.CreateScope(operationName); + try { - Azure.Response _response = async ? - // Send the request asynchronously if we're being called via an async path - await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : - // Send the request synchronously through the API that blocks if we're being called via a sync path - // (this is safe because the Task will complete before the user can call Wait) - pipeline.SendRequest(_request, cancellationToken); - cancellationToken.ThrowIfCancellationRequested(); - return GetPropertiesAsync_CreateResponse(_response); + _scope.AddAttribute("url", resourceUri); + _scope.Start(); + using (Azure.Core.Http.Request _request = GetPropertiesAsync_CreateRequest( + pipeline, + resourceUri, + snapshot, + timeout, + leaseId, + ifModifiedSince, + ifUnmodifiedSince, + ifMatch, + ifNoneMatch, + requestId)) + { + Azure.Response _response = async ? + // Send the request asynchronously if we're being called via an async path + await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : + // Send the request synchronously through the API that blocks if we're being called via a sync path + // (this is safe because the Task will complete before the user can call Wait) + pipeline.SendRequest(_request, cancellationToken); + cancellationToken.ThrowIfCancellationRequested(); + return GetPropertiesAsync_CreateResponse(_response); + } + } + catch (System.Exception ex) + { + _scope.Failed(ex); + throw; + } + finally + { + _scope.Dispose(); } } @@ -3370,6 +3727,7 @@ internal static Azure.Core.Http.Request GetPropertiesAsync_CreateRequest( /// Specify an ETag value to operate only on blobs without a matching value. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// Whether to invoke the operation asynchronously. The default value is true. + /// Operation name. /// Cancellation token. /// Azure.Response public static async System.Threading.Tasks.Task DeleteAsync( @@ -3385,29 +3743,45 @@ internal static Azure.Core.Http.Request GetPropertiesAsync_CreateRequest( Azure.Core.Http.ETag? ifNoneMatch = default, string requestId = default, bool async = true, + string operationName = "Azure.Storage.Blobs.BlobClient.Delete", System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.Request _request = DeleteAsync_CreateRequest( - pipeline, - resourceUri, - snapshot, - timeout, - leaseId, - deleteSnapshots, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - requestId)) + Azure.Core.Pipeline.DiagnosticScope _scope = pipeline.Diagnostics.CreateScope(operationName); + try + { + _scope.AddAttribute("url", resourceUri); + _scope.Start(); + using (Azure.Core.Http.Request _request = DeleteAsync_CreateRequest( + pipeline, + resourceUri, + snapshot, + timeout, + leaseId, + deleteSnapshots, + ifModifiedSince, + ifUnmodifiedSince, + ifMatch, + ifNoneMatch, + requestId)) + { + Azure.Response _response = async ? + // Send the request asynchronously if we're being called via an async path + await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : + // Send the request synchronously through the API that blocks if we're being called via a sync path + // (this is safe because the Task will complete before the user can call Wait) + pipeline.SendRequest(_request, cancellationToken); + cancellationToken.ThrowIfCancellationRequested(); + return DeleteAsync_CreateResponse(_response); + } + } + catch (System.Exception ex) { - Azure.Response _response = async ? - // Send the request asynchronously if we're being called via an async path - await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : - // Send the request synchronously through the API that blocks if we're being called via a sync path - // (this is safe because the Task will complete before the user can call Wait) - pipeline.SendRequest(_request, cancellationToken); - cancellationToken.ThrowIfCancellationRequested(); - return DeleteAsync_CreateResponse(_response); + _scope.Failed(ex); + throw; + } + finally + { + _scope.Dispose(); } } @@ -3503,6 +3877,7 @@ internal static Azure.Response DeleteAsync_CreateResponse( /// The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Blob Service Operations. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// Whether to invoke the operation asynchronously. The default value is true. + /// Operation name. /// Cancellation token. /// Azure.Response public static async System.Threading.Tasks.Task UndeleteAsync( @@ -3511,22 +3886,38 @@ internal static Azure.Response DeleteAsync_CreateResponse( int? timeout = default, string requestId = default, bool async = true, + string operationName = "Azure.Storage.Blobs.BlobClient.Undelete", System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.Request _request = UndeleteAsync_CreateRequest( - pipeline, - resourceUri, - timeout, - requestId)) + Azure.Core.Pipeline.DiagnosticScope _scope = pipeline.Diagnostics.CreateScope(operationName); + try + { + _scope.AddAttribute("url", resourceUri); + _scope.Start(); + using (Azure.Core.Http.Request _request = UndeleteAsync_CreateRequest( + pipeline, + resourceUri, + timeout, + requestId)) + { + Azure.Response _response = async ? + // Send the request asynchronously if we're being called via an async path + await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : + // Send the request synchronously through the API that blocks if we're being called via a sync path + // (this is safe because the Task will complete before the user can call Wait) + pipeline.SendRequest(_request, cancellationToken); + cancellationToken.ThrowIfCancellationRequested(); + return UndeleteAsync_CreateResponse(_response); + } + } + catch (System.Exception ex) + { + _scope.Failed(ex); + throw; + } + finally { - Azure.Response _response = async ? - // Send the request asynchronously if we're being called via an async path - await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : - // Send the request synchronously through the API that blocks if we're being called via a sync path - // (this is safe because the Task will complete before the user can call Wait) - pipeline.SendRequest(_request, cancellationToken); - cancellationToken.ThrowIfCancellationRequested(); - return UndeleteAsync_CreateResponse(_response); + _scope.Dispose(); } } @@ -3613,6 +4004,7 @@ internal static Azure.Response UndeleteAsync_CreateResponse( /// Optional. Sets the blob's Content-Disposition header. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// Whether to invoke the operation asynchronously. The default value is true. + /// Operation name. /// Cancellation token. /// Azure.Response{Azure.Storage.Blobs.Models.SetHttpHeadersOperation} public static async System.Threading.Tasks.Task> SetHttpHeadersAsync( @@ -3632,33 +4024,49 @@ internal static Azure.Response UndeleteAsync_CreateResponse( string blobContentDisposition = default, string requestId = default, bool async = true, + string operationName = "Azure.Storage.Blobs.BlobClient.SetHttpHeaders", System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.Request _request = SetHttpHeadersAsync_CreateRequest( - pipeline, - resourceUri, - timeout, - blobCacheControl, - blobContentType, - blobContentHash, - blobContentEncoding, - blobContentLanguage, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - blobContentDisposition, - requestId)) - { - Azure.Response _response = async ? - // Send the request asynchronously if we're being called via an async path - await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : - // Send the request synchronously through the API that blocks if we're being called via a sync path - // (this is safe because the Task will complete before the user can call Wait) - pipeline.SendRequest(_request, cancellationToken); - cancellationToken.ThrowIfCancellationRequested(); - return SetHttpHeadersAsync_CreateResponse(_response); + Azure.Core.Pipeline.DiagnosticScope _scope = pipeline.Diagnostics.CreateScope(operationName); + try + { + _scope.AddAttribute("url", resourceUri); + _scope.Start(); + using (Azure.Core.Http.Request _request = SetHttpHeadersAsync_CreateRequest( + pipeline, + resourceUri, + timeout, + blobCacheControl, + blobContentType, + blobContentHash, + blobContentEncoding, + blobContentLanguage, + leaseId, + ifModifiedSince, + ifUnmodifiedSince, + ifMatch, + ifNoneMatch, + blobContentDisposition, + requestId)) + { + Azure.Response _response = async ? + // Send the request asynchronously if we're being called via an async path + await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : + // Send the request synchronously through the API that blocks if we're being called via a sync path + // (this is safe because the Task will complete before the user can call Wait) + pipeline.SendRequest(_request, cancellationToken); + cancellationToken.ThrowIfCancellationRequested(); + return SetHttpHeadersAsync_CreateResponse(_response); + } + } + catch (System.Exception ex) + { + _scope.Failed(ex); + throw; + } + finally + { + _scope.Dispose(); } } @@ -3819,6 +4227,7 @@ internal static Azure.Core.Http.Request SetHttpHeadersAsync_CreateRequest( /// Specify an ETag value to operate only on blobs without a matching value. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// Whether to invoke the operation asynchronously. The default value is true. + /// Operation name. /// Cancellation token. /// Azure.Response{Azure.Storage.Blobs.Models.SetMetadataOperation} public static async System.Threading.Tasks.Task> SetMetadataAsync( @@ -3833,28 +4242,44 @@ internal static Azure.Core.Http.Request SetHttpHeadersAsync_CreateRequest( Azure.Core.Http.ETag? ifNoneMatch = default, string requestId = default, bool async = true, + string operationName = "Azure.Storage.Blobs.BlobClient.SetMetadata", System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.Request _request = SetMetadataAsync_CreateRequest( - pipeline, - resourceUri, - timeout, - metadata, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - requestId)) + Azure.Core.Pipeline.DiagnosticScope _scope = pipeline.Diagnostics.CreateScope(operationName); + try + { + _scope.AddAttribute("url", resourceUri); + _scope.Start(); + using (Azure.Core.Http.Request _request = SetMetadataAsync_CreateRequest( + pipeline, + resourceUri, + timeout, + metadata, + leaseId, + ifModifiedSince, + ifUnmodifiedSince, + ifMatch, + ifNoneMatch, + requestId)) + { + Azure.Response _response = async ? + // Send the request asynchronously if we're being called via an async path + await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : + // Send the request synchronously through the API that blocks if we're being called via a sync path + // (this is safe because the Task will complete before the user can call Wait) + pipeline.SendRequest(_request, cancellationToken); + cancellationToken.ThrowIfCancellationRequested(); + return SetMetadataAsync_CreateResponse(_response); + } + } + catch (System.Exception ex) + { + _scope.Failed(ex); + throw; + } + finally { - Azure.Response _response = async ? - // Send the request asynchronously if we're being called via an async path - await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : - // Send the request synchronously through the API that blocks if we're being called via a sync path - // (this is safe because the Task will complete before the user can call Wait) - pipeline.SendRequest(_request, cancellationToken); - cancellationToken.ThrowIfCancellationRequested(); - return SetMetadataAsync_CreateResponse(_response); + _scope.Dispose(); } } @@ -3995,6 +4420,7 @@ internal static Azure.Core.Http.Request SetMetadataAsync_CreateRequest( /// Specify an ETag value to operate only on blobs without a matching value. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// Whether to invoke the operation asynchronously. The default value is true. + /// Operation name. /// Cancellation token. /// Azure.Response{Azure.Storage.Blobs.Models.Lease} public static async System.Threading.Tasks.Task> AcquireLeaseAsync( @@ -4009,28 +4435,44 @@ internal static Azure.Core.Http.Request SetMetadataAsync_CreateRequest( Azure.Core.Http.ETag? ifNoneMatch = default, string requestId = default, bool async = true, + string operationName = "Azure.Storage.Blobs.BlobClient.AcquireLease", System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.Request _request = AcquireLeaseAsync_CreateRequest( - pipeline, - resourceUri, - timeout, - duration, - proposedLeaseId, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - requestId)) + Azure.Core.Pipeline.DiagnosticScope _scope = pipeline.Diagnostics.CreateScope(operationName); + try + { + _scope.AddAttribute("url", resourceUri); + _scope.Start(); + using (Azure.Core.Http.Request _request = AcquireLeaseAsync_CreateRequest( + pipeline, + resourceUri, + timeout, + duration, + proposedLeaseId, + ifModifiedSince, + ifUnmodifiedSince, + ifMatch, + ifNoneMatch, + requestId)) + { + Azure.Response _response = async ? + // Send the request asynchronously if we're being called via an async path + await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : + // Send the request synchronously through the API that blocks if we're being called via a sync path + // (this is safe because the Task will complete before the user can call Wait) + pipeline.SendRequest(_request, cancellationToken); + cancellationToken.ThrowIfCancellationRequested(); + return AcquireLeaseAsync_CreateResponse(_response); + } + } + catch (System.Exception ex) { - Azure.Response _response = async ? - // Send the request asynchronously if we're being called via an async path - await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : - // Send the request synchronously through the API that blocks if we're being called via a sync path - // (this is safe because the Task will complete before the user can call Wait) - pipeline.SendRequest(_request, cancellationToken); - cancellationToken.ThrowIfCancellationRequested(); - return AcquireLeaseAsync_CreateResponse(_response); + _scope.Failed(ex); + throw; + } + finally + { + _scope.Dispose(); } } @@ -4154,6 +4596,7 @@ internal static Azure.Core.Http.Request AcquireLeaseAsync_CreateRequest( /// Specify an ETag value to operate only on blobs without a matching value. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// Whether to invoke the operation asynchronously. The default value is true. + /// Operation name. /// Cancellation token. /// Azure.Response{Azure.Storage.Blobs.Models.BlobInfo} public static async System.Threading.Tasks.Task> ReleaseLeaseAsync( @@ -4167,27 +4610,43 @@ internal static Azure.Core.Http.Request AcquireLeaseAsync_CreateRequest( Azure.Core.Http.ETag? ifNoneMatch = default, string requestId = default, bool async = true, + string operationName = "Azure.Storage.Blobs.BlobClient.ReleaseLease", System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.Request _request = ReleaseLeaseAsync_CreateRequest( - pipeline, - resourceUri, - leaseId, - timeout, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - requestId)) + Azure.Core.Pipeline.DiagnosticScope _scope = pipeline.Diagnostics.CreateScope(operationName); + try + { + _scope.AddAttribute("url", resourceUri); + _scope.Start(); + using (Azure.Core.Http.Request _request = ReleaseLeaseAsync_CreateRequest( + pipeline, + resourceUri, + leaseId, + timeout, + ifModifiedSince, + ifUnmodifiedSince, + ifMatch, + ifNoneMatch, + requestId)) + { + Azure.Response _response = async ? + // Send the request asynchronously if we're being called via an async path + await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : + // Send the request synchronously through the API that blocks if we're being called via a sync path + // (this is safe because the Task will complete before the user can call Wait) + pipeline.SendRequest(_request, cancellationToken); + cancellationToken.ThrowIfCancellationRequested(); + return ReleaseLeaseAsync_CreateResponse(_response); + } + } + catch (System.Exception ex) + { + _scope.Failed(ex); + throw; + } + finally { - Azure.Response _response = async ? - // Send the request asynchronously if we're being called via an async path - await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : - // Send the request synchronously through the API that blocks if we're being called via a sync path - // (this is safe because the Task will complete before the user can call Wait) - pipeline.SendRequest(_request, cancellationToken); - cancellationToken.ThrowIfCancellationRequested(); - return ReleaseLeaseAsync_CreateResponse(_response); + _scope.Dispose(); } } @@ -4308,6 +4767,7 @@ internal static Azure.Core.Http.Request ReleaseLeaseAsync_CreateRequest( /// Specify an ETag value to operate only on blobs without a matching value. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// Whether to invoke the operation asynchronously. The default value is true. + /// Operation name. /// Cancellation token. /// Azure.Response{Azure.Storage.Blobs.Models.Lease} public static async System.Threading.Tasks.Task> RenewLeaseAsync( @@ -4321,27 +4781,43 @@ internal static Azure.Core.Http.Request ReleaseLeaseAsync_CreateRequest( Azure.Core.Http.ETag? ifNoneMatch = default, string requestId = default, bool async = true, + string operationName = "Azure.Storage.Blobs.BlobClient.RenewLease", System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.Request _request = RenewLeaseAsync_CreateRequest( - pipeline, - resourceUri, - leaseId, - timeout, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - requestId)) + Azure.Core.Pipeline.DiagnosticScope _scope = pipeline.Diagnostics.CreateScope(operationName); + try { - Azure.Response _response = async ? - // Send the request asynchronously if we're being called via an async path - await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : - // Send the request synchronously through the API that blocks if we're being called via a sync path - // (this is safe because the Task will complete before the user can call Wait) - pipeline.SendRequest(_request, cancellationToken); - cancellationToken.ThrowIfCancellationRequested(); - return RenewLeaseAsync_CreateResponse(_response); + _scope.AddAttribute("url", resourceUri); + _scope.Start(); + using (Azure.Core.Http.Request _request = RenewLeaseAsync_CreateRequest( + pipeline, + resourceUri, + leaseId, + timeout, + ifModifiedSince, + ifUnmodifiedSince, + ifMatch, + ifNoneMatch, + requestId)) + { + Azure.Response _response = async ? + // Send the request asynchronously if we're being called via an async path + await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : + // Send the request synchronously through the API that blocks if we're being called via a sync path + // (this is safe because the Task will complete before the user can call Wait) + pipeline.SendRequest(_request, cancellationToken); + cancellationToken.ThrowIfCancellationRequested(); + return RenewLeaseAsync_CreateResponse(_response); + } + } + catch (System.Exception ex) + { + _scope.Failed(ex); + throw; + } + finally + { + _scope.Dispose(); } } @@ -4467,6 +4943,7 @@ internal static Azure.Core.Http.Request RenewLeaseAsync_CreateRequest( /// Specify an ETag value to operate only on blobs without a matching value. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// Whether to invoke the operation asynchronously. The default value is true. + /// Operation name. /// Cancellation token. /// Azure.Response{Azure.Storage.Blobs.Models.Lease} public static async System.Threading.Tasks.Task> ChangeLeaseAsync( @@ -4481,28 +4958,44 @@ internal static Azure.Core.Http.Request RenewLeaseAsync_CreateRequest( Azure.Core.Http.ETag? ifNoneMatch = default, string requestId = default, bool async = true, + string operationName = "Azure.Storage.Blobs.BlobClient.ChangeLease", System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.Request _request = ChangeLeaseAsync_CreateRequest( - pipeline, - resourceUri, - leaseId, - proposedLeaseId, - timeout, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - requestId)) + Azure.Core.Pipeline.DiagnosticScope _scope = pipeline.Diagnostics.CreateScope(operationName); + try { - Azure.Response _response = async ? - // Send the request asynchronously if we're being called via an async path - await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : - // Send the request synchronously through the API that blocks if we're being called via a sync path - // (this is safe because the Task will complete before the user can call Wait) - pipeline.SendRequest(_request, cancellationToken); - cancellationToken.ThrowIfCancellationRequested(); - return ChangeLeaseAsync_CreateResponse(_response); + _scope.AddAttribute("url", resourceUri); + _scope.Start(); + using (Azure.Core.Http.Request _request = ChangeLeaseAsync_CreateRequest( + pipeline, + resourceUri, + leaseId, + proposedLeaseId, + timeout, + ifModifiedSince, + ifUnmodifiedSince, + ifMatch, + ifNoneMatch, + requestId)) + { + Azure.Response _response = async ? + // Send the request asynchronously if we're being called via an async path + await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : + // Send the request synchronously through the API that blocks if we're being called via a sync path + // (this is safe because the Task will complete before the user can call Wait) + pipeline.SendRequest(_request, cancellationToken); + cancellationToken.ThrowIfCancellationRequested(); + return ChangeLeaseAsync_CreateResponse(_response); + } + } + catch (System.Exception ex) + { + _scope.Failed(ex); + throw; + } + finally + { + _scope.Dispose(); } } @@ -4634,6 +5127,7 @@ internal static Azure.Core.Http.Request ChangeLeaseAsync_CreateRequest( /// Specify an ETag value to operate only on blobs without a matching value. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// Whether to invoke the operation asynchronously. The default value is true. + /// Operation name. /// Cancellation token. /// Azure.Response{Azure.Storage.Blobs.Models.BrokenLease} public static async System.Threading.Tasks.Task> BreakLeaseAsync( @@ -4647,27 +5141,43 @@ internal static Azure.Core.Http.Request ChangeLeaseAsync_CreateRequest( Azure.Core.Http.ETag? ifNoneMatch = default, string requestId = default, bool async = true, + string operationName = "Azure.Storage.Blobs.BlobClient.BreakLease", System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.Request _request = BreakLeaseAsync_CreateRequest( - pipeline, - resourceUri, - timeout, - breakPeriod, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - requestId)) + Azure.Core.Pipeline.DiagnosticScope _scope = pipeline.Diagnostics.CreateScope(operationName); + try + { + _scope.AddAttribute("url", resourceUri); + _scope.Start(); + using (Azure.Core.Http.Request _request = BreakLeaseAsync_CreateRequest( + pipeline, + resourceUri, + timeout, + breakPeriod, + ifModifiedSince, + ifUnmodifiedSince, + ifMatch, + ifNoneMatch, + requestId)) + { + Azure.Response _response = async ? + // Send the request asynchronously if we're being called via an async path + await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : + // Send the request synchronously through the API that blocks if we're being called via a sync path + // (this is safe because the Task will complete before the user can call Wait) + pipeline.SendRequest(_request, cancellationToken); + cancellationToken.ThrowIfCancellationRequested(); + return BreakLeaseAsync_CreateResponse(_response); + } + } + catch (System.Exception ex) { - Azure.Response _response = async ? - // Send the request asynchronously if we're being called via an async path - await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : - // Send the request synchronously through the API that blocks if we're being called via a sync path - // (this is safe because the Task will complete before the user can call Wait) - pipeline.SendRequest(_request, cancellationToken); - cancellationToken.ThrowIfCancellationRequested(); - return BreakLeaseAsync_CreateResponse(_response); + _scope.Failed(ex); + throw; + } + finally + { + _scope.Dispose(); } } @@ -4801,6 +5311,7 @@ internal static Azure.Core.Http.Request BreakLeaseAsync_CreateRequest( /// If specified, the operation only succeeds if the resource's lease is active and matches this ID. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// Whether to invoke the operation asynchronously. The default value is true. + /// Operation name. /// Cancellation token. /// Azure.Response{Azure.Storage.Blobs.Models.BlobSnapshotInfo} public static async System.Threading.Tasks.Task> CreateSnapshotAsync( @@ -4815,28 +5326,44 @@ internal static Azure.Core.Http.Request BreakLeaseAsync_CreateRequest( string leaseId = default, string requestId = default, bool async = true, + string operationName = "Azure.Storage.Blobs.BlobClient.CreateSnapshot", System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.Request _request = CreateSnapshotAsync_CreateRequest( - pipeline, - resourceUri, - timeout, - metadata, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - leaseId, - requestId)) + Azure.Core.Pipeline.DiagnosticScope _scope = pipeline.Diagnostics.CreateScope(operationName); + try { - Azure.Response _response = async ? - // Send the request asynchronously if we're being called via an async path - await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : - // Send the request synchronously through the API that blocks if we're being called via a sync path - // (this is safe because the Task will complete before the user can call Wait) - pipeline.SendRequest(_request, cancellationToken); - cancellationToken.ThrowIfCancellationRequested(); - return CreateSnapshotAsync_CreateResponse(_response); + _scope.AddAttribute("url", resourceUri); + _scope.Start(); + using (Azure.Core.Http.Request _request = CreateSnapshotAsync_CreateRequest( + pipeline, + resourceUri, + timeout, + metadata, + ifModifiedSince, + ifUnmodifiedSince, + ifMatch, + ifNoneMatch, + leaseId, + requestId)) + { + Azure.Response _response = async ? + // Send the request asynchronously if we're being called via an async path + await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : + // Send the request synchronously through the API that blocks if we're being called via a sync path + // (this is safe because the Task will complete before the user can call Wait) + pipeline.SendRequest(_request, cancellationToken); + cancellationToken.ThrowIfCancellationRequested(); + return CreateSnapshotAsync_CreateResponse(_response); + } + } + catch (System.Exception ex) + { + _scope.Failed(ex); + throw; + } + finally + { + _scope.Dispose(); } } @@ -4970,6 +5497,7 @@ internal static Azure.Core.Http.Request CreateSnapshotAsync_CreateRequest( /// If specified, the operation only succeeds if the resource's lease is active and matches this ID. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// Whether to invoke the operation asynchronously. The default value is true. + /// Operation name. /// Cancellation token. /// Azure.Response{Azure.Storage.Blobs.Models.BlobCopyInfo} public static async System.Threading.Tasks.Task> StartCopyFromUriAsync( @@ -4989,33 +5517,49 @@ internal static Azure.Core.Http.Request CreateSnapshotAsync_CreateRequest( string leaseId = default, string requestId = default, bool async = true, + string operationName = "Azure.Storage.Blobs.BlobClient.StartCopyFromUri", System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.Request _request = StartCopyFromUriAsync_CreateRequest( - pipeline, - resourceUri, - copySource, - timeout, - metadata, - sourceIfModifiedSince, - sourceIfUnmodifiedSince, - sourceIfMatch, - sourceIfNoneMatch, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - leaseId, - requestId)) - { - Azure.Response _response = async ? - // Send the request asynchronously if we're being called via an async path - await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : - // Send the request synchronously through the API that blocks if we're being called via a sync path - // (this is safe because the Task will complete before the user can call Wait) - pipeline.SendRequest(_request, cancellationToken); - cancellationToken.ThrowIfCancellationRequested(); - return StartCopyFromUriAsync_CreateResponse(_response); + Azure.Core.Pipeline.DiagnosticScope _scope = pipeline.Diagnostics.CreateScope(operationName); + try + { + _scope.AddAttribute("url", resourceUri); + _scope.Start(); + using (Azure.Core.Http.Request _request = StartCopyFromUriAsync_CreateRequest( + pipeline, + resourceUri, + copySource, + timeout, + metadata, + sourceIfModifiedSince, + sourceIfUnmodifiedSince, + sourceIfMatch, + sourceIfNoneMatch, + ifModifiedSince, + ifUnmodifiedSince, + ifMatch, + ifNoneMatch, + leaseId, + requestId)) + { + Azure.Response _response = async ? + // Send the request asynchronously if we're being called via an async path + await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : + // Send the request synchronously through the API that blocks if we're being called via a sync path + // (this is safe because the Task will complete before the user can call Wait) + pipeline.SendRequest(_request, cancellationToken); + cancellationToken.ThrowIfCancellationRequested(); + return StartCopyFromUriAsync_CreateResponse(_response); + } + } + catch (System.Exception ex) + { + _scope.Failed(ex); + throw; + } + finally + { + _scope.Dispose(); } } @@ -5171,6 +5715,7 @@ internal static Azure.Core.Http.Request StartCopyFromUriAsync_CreateRequest( /// If specified, the operation only succeeds if the resource's lease is active and matches this ID. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// Whether to invoke the operation asynchronously. The default value is true. + /// Operation name. /// Cancellation token. /// Azure.Response{Azure.Storage.Blobs.Models.BlobCopyInfo} public static async System.Threading.Tasks.Task> CopyFromUriAsync( @@ -5190,33 +5735,49 @@ internal static Azure.Core.Http.Request StartCopyFromUriAsync_CreateRequest( string leaseId = default, string requestId = default, bool async = true, + string operationName = "Azure.Storage.Blobs.BlobClient.CopyFromUri", System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.Request _request = CopyFromUriAsync_CreateRequest( - pipeline, - resourceUri, - copySource, - timeout, - metadata, - sourceIfModifiedSince, - sourceIfUnmodifiedSince, - sourceIfMatch, - sourceIfNoneMatch, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - leaseId, - requestId)) - { - Azure.Response _response = async ? - // Send the request asynchronously if we're being called via an async path - await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : - // Send the request synchronously through the API that blocks if we're being called via a sync path - // (this is safe because the Task will complete before the user can call Wait) - pipeline.SendRequest(_request, cancellationToken); - cancellationToken.ThrowIfCancellationRequested(); - return CopyFromUriAsync_CreateResponse(_response); + Azure.Core.Pipeline.DiagnosticScope _scope = pipeline.Diagnostics.CreateScope(operationName); + try + { + _scope.AddAttribute("url", resourceUri); + _scope.Start(); + using (Azure.Core.Http.Request _request = CopyFromUriAsync_CreateRequest( + pipeline, + resourceUri, + copySource, + timeout, + metadata, + sourceIfModifiedSince, + sourceIfUnmodifiedSince, + sourceIfMatch, + sourceIfNoneMatch, + ifModifiedSince, + ifUnmodifiedSince, + ifMatch, + ifNoneMatch, + leaseId, + requestId)) + { + Azure.Response _response = async ? + // Send the request asynchronously if we're being called via an async path + await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : + // Send the request synchronously through the API that blocks if we're being called via a sync path + // (this is safe because the Task will complete before the user can call Wait) + pipeline.SendRequest(_request, cancellationToken); + cancellationToken.ThrowIfCancellationRequested(); + return CopyFromUriAsync_CreateResponse(_response); + } + } + catch (System.Exception ex) + { + _scope.Failed(ex); + throw; + } + finally + { + _scope.Dispose(); } } @@ -5364,6 +5925,7 @@ internal static Azure.Core.Http.Request CopyFromUriAsync_CreateRequest( /// If specified, the operation only succeeds if the resource's lease is active and matches this ID. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// Whether to invoke the operation asynchronously. The default value is true. + /// Operation name. /// Cancellation token. /// Azure.Response public static async System.Threading.Tasks.Task AbortCopyFromUriAsync( @@ -5374,24 +5936,40 @@ internal static Azure.Core.Http.Request CopyFromUriAsync_CreateRequest( string leaseId = default, string requestId = default, bool async = true, + string operationName = "Azure.Storage.Blobs.BlobClient.AbortCopyFromUri", System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.Request _request = AbortCopyFromUriAsync_CreateRequest( - pipeline, - resourceUri, - copyId, - timeout, - leaseId, - requestId)) + Azure.Core.Pipeline.DiagnosticScope _scope = pipeline.Diagnostics.CreateScope(operationName); + try + { + _scope.AddAttribute("url", resourceUri); + _scope.Start(); + using (Azure.Core.Http.Request _request = AbortCopyFromUriAsync_CreateRequest( + pipeline, + resourceUri, + copyId, + timeout, + leaseId, + requestId)) + { + Azure.Response _response = async ? + // Send the request asynchronously if we're being called via an async path + await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : + // Send the request synchronously through the API that blocks if we're being called via a sync path + // (this is safe because the Task will complete before the user can call Wait) + pipeline.SendRequest(_request, cancellationToken); + cancellationToken.ThrowIfCancellationRequested(); + return AbortCopyFromUriAsync_CreateResponse(_response); + } + } + catch (System.Exception ex) + { + _scope.Failed(ex); + throw; + } + finally { - Azure.Response _response = async ? - // Send the request asynchronously if we're being called via an async path - await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : - // Send the request synchronously through the API that blocks if we're being called via a sync path - // (this is safe because the Task will complete before the user can call Wait) - pipeline.SendRequest(_request, cancellationToken); - cancellationToken.ThrowIfCancellationRequested(); - return AbortCopyFromUriAsync_CreateResponse(_response); + _scope.Dispose(); } } @@ -5480,6 +6058,7 @@ internal static Azure.Response AbortCopyFromUriAsync_CreateResponse( /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// If specified, the operation only succeeds if the resource's lease is active and matches this ID. /// Whether to invoke the operation asynchronously. The default value is true. + /// Operation name. /// Cancellation token. /// Azure.Response public static async System.Threading.Tasks.Task SetTierAsync( @@ -5490,24 +6069,40 @@ internal static Azure.Response AbortCopyFromUriAsync_CreateResponse( string requestId = default, string leaseId = default, bool async = true, + string operationName = "Azure.Storage.Blobs.BlobClient.SetTier", System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.Request _request = SetTierAsync_CreateRequest( - pipeline, - resourceUri, - tier, - timeout, - requestId, - leaseId)) + Azure.Core.Pipeline.DiagnosticScope _scope = pipeline.Diagnostics.CreateScope(operationName); + try { - Azure.Response _response = async ? - // Send the request asynchronously if we're being called via an async path - await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : - // Send the request synchronously through the API that blocks if we're being called via a sync path - // (this is safe because the Task will complete before the user can call Wait) - pipeline.SendRequest(_request, cancellationToken); - cancellationToken.ThrowIfCancellationRequested(); - return SetTierAsync_CreateResponse(_response); + _scope.AddAttribute("url", resourceUri); + _scope.Start(); + using (Azure.Core.Http.Request _request = SetTierAsync_CreateRequest( + pipeline, + resourceUri, + tier, + timeout, + requestId, + leaseId)) + { + Azure.Response _response = async ? + // Send the request asynchronously if we're being called via an async path + await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : + // Send the request synchronously through the API that blocks if we're being called via a sync path + // (this is safe because the Task will complete before the user can call Wait) + pipeline.SendRequest(_request, cancellationToken); + cancellationToken.ThrowIfCancellationRequested(); + return SetTierAsync_CreateResponse(_response); + } + } + catch (System.Exception ex) + { + _scope.Failed(ex); + throw; + } + finally + { + _scope.Dispose(); } } @@ -5620,6 +6215,7 @@ public static partial class PageBlob /// Set for page blobs only. The sequence number is a user-controlled value that you can use to track requests. The value of the sequence number must be between 0 and 2^63 - 1. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// Whether to invoke the operation asynchronously. The default value is true. + /// Operation name. /// Cancellation token. /// Azure.Response{Azure.Storage.Blobs.Models.BlobContentInfo} public static async System.Threading.Tasks.Task> CreateAsync( @@ -5643,37 +6239,53 @@ public static partial class PageBlob long? blobSequenceNumber = default, string requestId = default, bool async = true, + string operationName = "Azure.Storage.Blobs.PageBlobClient.Create", System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.Request _request = CreateAsync_CreateRequest( - pipeline, - resourceUri, - contentLength, - blobContentLength, - timeout, - blobContentType, - blobContentEncoding, - blobContentLanguage, - blobContentHash, - blobCacheControl, - metadata, - leaseId, - blobContentDisposition, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - blobSequenceNumber, - requestId)) - { - Azure.Response _response = async ? - // Send the request asynchronously if we're being called via an async path - await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : - // Send the request synchronously through the API that blocks if we're being called via a sync path - // (this is safe because the Task will complete before the user can call Wait) - pipeline.SendRequest(_request, cancellationToken); - cancellationToken.ThrowIfCancellationRequested(); - return CreateAsync_CreateResponse(_response); + Azure.Core.Pipeline.DiagnosticScope _scope = pipeline.Diagnostics.CreateScope(operationName); + try + { + _scope.AddAttribute("url", resourceUri); + _scope.Start(); + using (Azure.Core.Http.Request _request = CreateAsync_CreateRequest( + pipeline, + resourceUri, + contentLength, + blobContentLength, + timeout, + blobContentType, + blobContentEncoding, + blobContentLanguage, + blobContentHash, + blobCacheControl, + metadata, + leaseId, + blobContentDisposition, + ifModifiedSince, + ifUnmodifiedSince, + ifMatch, + ifNoneMatch, + blobSequenceNumber, + requestId)) + { + Azure.Response _response = async ? + // Send the request asynchronously if we're being called via an async path + await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : + // Send the request synchronously through the API that blocks if we're being called via a sync path + // (this is safe because the Task will complete before the user can call Wait) + pipeline.SendRequest(_request, cancellationToken); + cancellationToken.ThrowIfCancellationRequested(); + return CreateAsync_CreateResponse(_response); + } + } + catch (System.Exception ex) + { + _scope.Failed(ex); + throw; + } + finally + { + _scope.Dispose(); } } @@ -5849,6 +6461,7 @@ internal static Azure.Core.Http.Request CreateAsync_CreateRequest( /// Specify an ETag value to operate only on blobs without a matching value. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// Whether to invoke the operation asynchronously. The default value is true. + /// Operation name. /// Cancellation token. /// Azure.Response{Azure.Storage.Blobs.Models.PageInfo} public static async System.Threading.Tasks.Task> UploadPagesAsync( @@ -5869,34 +6482,50 @@ internal static Azure.Core.Http.Request CreateAsync_CreateRequest( Azure.Core.Http.ETag? ifNoneMatch = default, string requestId = default, bool async = true, + string operationName = "Azure.Storage.Blobs.PageBlobClient.UploadPages", System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.Request _request = UploadPagesAsync_CreateRequest( - pipeline, - resourceUri, - body, - contentLength, - transactionalContentHash, - timeout, - range, - leaseId, - ifSequenceNumberLessThanOrEqualTo, - ifSequenceNumberLessThan, - ifSequenceNumberEqualTo, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - requestId)) - { - Azure.Response _response = async ? - // Send the request asynchronously if we're being called via an async path - await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : - // Send the request synchronously through the API that blocks if we're being called via a sync path - // (this is safe because the Task will complete before the user can call Wait) - pipeline.SendRequest(_request, cancellationToken); - cancellationToken.ThrowIfCancellationRequested(); - return UploadPagesAsync_CreateResponse(_response); + Azure.Core.Pipeline.DiagnosticScope _scope = pipeline.Diagnostics.CreateScope(operationName); + try + { + _scope.AddAttribute("url", resourceUri); + _scope.Start(); + using (Azure.Core.Http.Request _request = UploadPagesAsync_CreateRequest( + pipeline, + resourceUri, + body, + contentLength, + transactionalContentHash, + timeout, + range, + leaseId, + ifSequenceNumberLessThanOrEqualTo, + ifSequenceNumberLessThan, + ifSequenceNumberEqualTo, + ifModifiedSince, + ifUnmodifiedSince, + ifMatch, + ifNoneMatch, + requestId)) + { + Azure.Response _response = async ? + // Send the request asynchronously if we're being called via an async path + await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : + // Send the request synchronously through the API that blocks if we're being called via a sync path + // (this is safe because the Task will complete before the user can call Wait) + pipeline.SendRequest(_request, cancellationToken); + cancellationToken.ThrowIfCancellationRequested(); + return UploadPagesAsync_CreateResponse(_response); + } + } + catch (System.Exception ex) + { + _scope.Failed(ex); + throw; + } + finally + { + _scope.Dispose(); } } @@ -6053,6 +6682,7 @@ internal static Azure.Core.Http.Request UploadPagesAsync_CreateRequest( /// Specify an ETag value to operate only on blobs without a matching value. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// Whether to invoke the operation asynchronously. The default value is true. + /// Operation name. /// Cancellation token. /// Azure.Response{Azure.Storage.Blobs.Models.PageInfo} public static async System.Threading.Tasks.Task> ClearPagesAsync( @@ -6071,32 +6701,48 @@ internal static Azure.Core.Http.Request UploadPagesAsync_CreateRequest( Azure.Core.Http.ETag? ifNoneMatch = default, string requestId = default, bool async = true, + string operationName = "Azure.Storage.Blobs.PageBlobClient.ClearPages", System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.Request _request = ClearPagesAsync_CreateRequest( - pipeline, - resourceUri, - contentLength, - timeout, - range, - leaseId, - ifSequenceNumberLessThanOrEqualTo, - ifSequenceNumberLessThan, - ifSequenceNumberEqualTo, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - requestId)) - { - Azure.Response _response = async ? - // Send the request asynchronously if we're being called via an async path - await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : - // Send the request synchronously through the API that blocks if we're being called via a sync path - // (this is safe because the Task will complete before the user can call Wait) - pipeline.SendRequest(_request, cancellationToken); - cancellationToken.ThrowIfCancellationRequested(); - return ClearPagesAsync_CreateResponse(_response); + Azure.Core.Pipeline.DiagnosticScope _scope = pipeline.Diagnostics.CreateScope(operationName); + try + { + _scope.AddAttribute("url", resourceUri); + _scope.Start(); + using (Azure.Core.Http.Request _request = ClearPagesAsync_CreateRequest( + pipeline, + resourceUri, + contentLength, + timeout, + range, + leaseId, + ifSequenceNumberLessThanOrEqualTo, + ifSequenceNumberLessThan, + ifSequenceNumberEqualTo, + ifModifiedSince, + ifUnmodifiedSince, + ifMatch, + ifNoneMatch, + requestId)) + { + Azure.Response _response = async ? + // Send the request asynchronously if we're being called via an async path + await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : + // Send the request synchronously through the API that blocks if we're being called via a sync path + // (this is safe because the Task will complete before the user can call Wait) + pipeline.SendRequest(_request, cancellationToken); + cancellationToken.ThrowIfCancellationRequested(); + return ClearPagesAsync_CreateResponse(_response); + } + } + catch (System.Exception ex) + { + _scope.Failed(ex); + throw; + } + finally + { + _scope.Dispose(); } } @@ -6248,6 +6894,7 @@ internal static Azure.Core.Http.Request ClearPagesAsync_CreateRequest( /// Specify an ETag value to operate only on blobs without a matching value. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// Whether to invoke the operation asynchronously. The default value is true. + /// Operation name. /// Cancellation token. /// Azure.Response{Azure.Storage.Blobs.Models.PageInfo} public static async System.Threading.Tasks.Task> UploadPagesFromUriAsync( @@ -6273,39 +6920,55 @@ internal static Azure.Core.Http.Request ClearPagesAsync_CreateRequest( Azure.Core.Http.ETag? sourceIfNoneMatch = default, string requestId = default, bool async = true, + string operationName = "Azure.Storage.Blobs.PageBlobClient.UploadPagesFromUri", System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.Request _request = UploadPagesFromUriAsync_CreateRequest( - pipeline, - resourceUri, - sourceUri, - sourceRange, - contentLength, - range, - sourceContentHash, - timeout, - leaseId, - ifSequenceNumberLessThanOrEqualTo, - ifSequenceNumberLessThan, - ifSequenceNumberEqualTo, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - sourceIfModifiedSince, - sourceIfUnmodifiedSince, - sourceIfMatch, - sourceIfNoneMatch, - requestId)) - { - Azure.Response _response = async ? - // Send the request asynchronously if we're being called via an async path - await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : - // Send the request synchronously through the API that blocks if we're being called via a sync path - // (this is safe because the Task will complete before the user can call Wait) - pipeline.SendRequest(_request, cancellationToken); - cancellationToken.ThrowIfCancellationRequested(); - return UploadPagesFromUriAsync_CreateResponse(_response); + Azure.Core.Pipeline.DiagnosticScope _scope = pipeline.Diagnostics.CreateScope(operationName); + try + { + _scope.AddAttribute("url", resourceUri); + _scope.Start(); + using (Azure.Core.Http.Request _request = UploadPagesFromUriAsync_CreateRequest( + pipeline, + resourceUri, + sourceUri, + sourceRange, + contentLength, + range, + sourceContentHash, + timeout, + leaseId, + ifSequenceNumberLessThanOrEqualTo, + ifSequenceNumberLessThan, + ifSequenceNumberEqualTo, + ifModifiedSince, + ifUnmodifiedSince, + ifMatch, + ifNoneMatch, + sourceIfModifiedSince, + sourceIfUnmodifiedSince, + sourceIfMatch, + sourceIfNoneMatch, + requestId)) + { + Azure.Response _response = async ? + // Send the request asynchronously if we're being called via an async path + await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : + // Send the request synchronously through the API that blocks if we're being called via a sync path + // (this is safe because the Task will complete before the user can call Wait) + pipeline.SendRequest(_request, cancellationToken); + cancellationToken.ThrowIfCancellationRequested(); + return UploadPagesFromUriAsync_CreateResponse(_response); + } + } + catch (System.Exception ex) + { + _scope.Failed(ex); + throw; + } + finally + { + _scope.Dispose(); } } @@ -6494,6 +7157,7 @@ internal static Azure.Core.Http.Request UploadPagesFromUriAsync_CreateRequest( /// Specify an ETag value to operate only on blobs without a matching value. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// Whether to invoke the operation asynchronously. The default value is true. + /// Operation name. /// Cancellation token. /// Azure.Response{Azure.Storage.Blobs.Models.PageRangesInfo} public static async System.Threading.Tasks.Task> GetPageRangesAsync( @@ -6509,29 +7173,45 @@ internal static Azure.Core.Http.Request UploadPagesFromUriAsync_CreateRequest( Azure.Core.Http.ETag? ifNoneMatch = default, string requestId = default, bool async = true, + string operationName = "Azure.Storage.Blobs.PageBlobClient.GetPageRanges", System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.Request _request = GetPageRangesAsync_CreateRequest( - pipeline, - resourceUri, - snapshot, - timeout, - range, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - requestId)) + Azure.Core.Pipeline.DiagnosticScope _scope = pipeline.Diagnostics.CreateScope(operationName); + try + { + _scope.AddAttribute("url", resourceUri); + _scope.Start(); + using (Azure.Core.Http.Request _request = GetPageRangesAsync_CreateRequest( + pipeline, + resourceUri, + snapshot, + timeout, + range, + leaseId, + ifModifiedSince, + ifUnmodifiedSince, + ifMatch, + ifNoneMatch, + requestId)) + { + Azure.Response _response = async ? + // Send the request asynchronously if we're being called via an async path + await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : + // Send the request synchronously through the API that blocks if we're being called via a sync path + // (this is safe because the Task will complete before the user can call Wait) + pipeline.SendRequest(_request, cancellationToken); + cancellationToken.ThrowIfCancellationRequested(); + return GetPageRangesAsync_CreateResponse(_response); + } + } + catch (System.Exception ex) { - Azure.Response _response = async ? - // Send the request asynchronously if we're being called via an async path - await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : - // Send the request synchronously through the API that blocks if we're being called via a sync path - // (this is safe because the Task will complete before the user can call Wait) - pipeline.SendRequest(_request, cancellationToken); - cancellationToken.ThrowIfCancellationRequested(); - return GetPageRangesAsync_CreateResponse(_response); + _scope.Failed(ex); + throw; + } + finally + { + _scope.Dispose(); } } @@ -6676,6 +7356,7 @@ internal static Azure.Core.Http.Request GetPageRangesAsync_CreateRequest( /// Specify an ETag value to operate only on blobs without a matching value. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// Whether to invoke the operation asynchronously. The default value is true. + /// Operation name. /// Cancellation token. /// Azure.Response{Azure.Storage.Blobs.Models.PageRangesInfo} public static async System.Threading.Tasks.Task> GetPageRangesDiffAsync( @@ -6692,30 +7373,46 @@ internal static Azure.Core.Http.Request GetPageRangesAsync_CreateRequest( Azure.Core.Http.ETag? ifNoneMatch = default, string requestId = default, bool async = true, + string operationName = "Azure.Storage.Blobs.PageBlobClient.GetPageRangesDiff", System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.Request _request = GetPageRangesDiffAsync_CreateRequest( - pipeline, - resourceUri, - snapshot, - timeout, - prevsnapshot, - range, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - requestId)) + Azure.Core.Pipeline.DiagnosticScope _scope = pipeline.Diagnostics.CreateScope(operationName); + try + { + _scope.AddAttribute("url", resourceUri); + _scope.Start(); + using (Azure.Core.Http.Request _request = GetPageRangesDiffAsync_CreateRequest( + pipeline, + resourceUri, + snapshot, + timeout, + prevsnapshot, + range, + leaseId, + ifModifiedSince, + ifUnmodifiedSince, + ifMatch, + ifNoneMatch, + requestId)) + { + Azure.Response _response = async ? + // Send the request asynchronously if we're being called via an async path + await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : + // Send the request synchronously through the API that blocks if we're being called via a sync path + // (this is safe because the Task will complete before the user can call Wait) + pipeline.SendRequest(_request, cancellationToken); + cancellationToken.ThrowIfCancellationRequested(); + return GetPageRangesDiffAsync_CreateResponse(_response); + } + } + catch (System.Exception ex) { - Azure.Response _response = async ? - // Send the request asynchronously if we're being called via an async path - await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : - // Send the request synchronously through the API that blocks if we're being called via a sync path - // (this is safe because the Task will complete before the user can call Wait) - pipeline.SendRequest(_request, cancellationToken); - cancellationToken.ThrowIfCancellationRequested(); - return GetPageRangesDiffAsync_CreateResponse(_response); + _scope.Failed(ex); + throw; + } + finally + { + _scope.Dispose(); } } @@ -6861,6 +7558,7 @@ internal static Azure.Core.Http.Request GetPageRangesDiffAsync_CreateRequest( /// Specify an ETag value to operate only on blobs without a matching value. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// Whether to invoke the operation asynchronously. The default value is true. + /// Operation name. /// Cancellation token. /// Azure.Response{Azure.Storage.Blobs.Models.PageBlobInfo} public static async System.Threading.Tasks.Task> ResizeAsync( @@ -6875,28 +7573,44 @@ internal static Azure.Core.Http.Request GetPageRangesDiffAsync_CreateRequest( Azure.Core.Http.ETag? ifNoneMatch = default, string requestId = default, bool async = true, + string operationName = "Azure.Storage.Blobs.PageBlobClient.Resize", System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.Request _request = ResizeAsync_CreateRequest( - pipeline, - resourceUri, - blobContentLength, - timeout, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - requestId)) + Azure.Core.Pipeline.DiagnosticScope _scope = pipeline.Diagnostics.CreateScope(operationName); + try { - Azure.Response _response = async ? - // Send the request asynchronously if we're being called via an async path - await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : - // Send the request synchronously through the API that blocks if we're being called via a sync path - // (this is safe because the Task will complete before the user can call Wait) - pipeline.SendRequest(_request, cancellationToken); - cancellationToken.ThrowIfCancellationRequested(); - return ResizeAsync_CreateResponse(_response); + _scope.AddAttribute("url", resourceUri); + _scope.Start(); + using (Azure.Core.Http.Request _request = ResizeAsync_CreateRequest( + pipeline, + resourceUri, + blobContentLength, + timeout, + leaseId, + ifModifiedSince, + ifUnmodifiedSince, + ifMatch, + ifNoneMatch, + requestId)) + { + Azure.Response _response = async ? + // Send the request asynchronously if we're being called via an async path + await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : + // Send the request synchronously through the API that blocks if we're being called via a sync path + // (this is safe because the Task will complete before the user can call Wait) + pipeline.SendRequest(_request, cancellationToken); + cancellationToken.ThrowIfCancellationRequested(); + return ResizeAsync_CreateResponse(_response); + } + } + catch (System.Exception ex) + { + _scope.Failed(ex); + throw; + } + finally + { + _scope.Dispose(); } } @@ -7021,6 +7735,7 @@ internal static Azure.Core.Http.Request ResizeAsync_CreateRequest( /// Set for page blobs only. The sequence number is a user-controlled value that you can use to track requests. The value of the sequence number must be between 0 and 2^63 - 1. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// Whether to invoke the operation asynchronously. The default value is true. + /// Operation name. /// Cancellation token. /// Azure.Response{Azure.Storage.Blobs.Models.PageBlobInfo} public static async System.Threading.Tasks.Task> UpdateSequenceNumberAsync( @@ -7036,29 +7751,45 @@ internal static Azure.Core.Http.Request ResizeAsync_CreateRequest( long? blobSequenceNumber = default, string requestId = default, bool async = true, + string operationName = "Azure.Storage.Blobs.PageBlobClient.UpdateSequenceNumber", System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.Request _request = UpdateSequenceNumberAsync_CreateRequest( - pipeline, - resourceUri, - sequenceNumberAction, - timeout, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - blobSequenceNumber, - requestId)) + Azure.Core.Pipeline.DiagnosticScope _scope = pipeline.Diagnostics.CreateScope(operationName); + try + { + _scope.AddAttribute("url", resourceUri); + _scope.Start(); + using (Azure.Core.Http.Request _request = UpdateSequenceNumberAsync_CreateRequest( + pipeline, + resourceUri, + sequenceNumberAction, + timeout, + leaseId, + ifModifiedSince, + ifUnmodifiedSince, + ifMatch, + ifNoneMatch, + blobSequenceNumber, + requestId)) + { + Azure.Response _response = async ? + // Send the request asynchronously if we're being called via an async path + await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : + // Send the request synchronously through the API that blocks if we're being called via a sync path + // (this is safe because the Task will complete before the user can call Wait) + pipeline.SendRequest(_request, cancellationToken); + cancellationToken.ThrowIfCancellationRequested(); + return UpdateSequenceNumberAsync_CreateResponse(_response); + } + } + catch (System.Exception ex) { - Azure.Response _response = async ? - // Send the request asynchronously if we're being called via an async path - await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : - // Send the request synchronously through the API that blocks if we're being called via a sync path - // (this is safe because the Task will complete before the user can call Wait) - pipeline.SendRequest(_request, cancellationToken); - cancellationToken.ThrowIfCancellationRequested(); - return UpdateSequenceNumberAsync_CreateResponse(_response); + _scope.Failed(ex); + throw; + } + finally + { + _scope.Dispose(); } } @@ -7184,6 +7915,7 @@ internal static Azure.Core.Http.Request UpdateSequenceNumberAsync_CreateRequest( /// Specify an ETag value to operate only on blobs without a matching value. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// Whether to invoke the operation asynchronously. The default value is true. + /// Operation name. /// Cancellation token. /// Azure.Response{Azure.Storage.Blobs.Models.BlobCopyInfo} public static async System.Threading.Tasks.Task> CopyIncrementalAsync( @@ -7197,27 +7929,43 @@ internal static Azure.Core.Http.Request UpdateSequenceNumberAsync_CreateRequest( Azure.Core.Http.ETag? ifNoneMatch = default, string requestId = default, bool async = true, + string operationName = "Azure.Storage.Blobs.PageBlobClient.CopyIncremental", System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.Request _request = CopyIncrementalAsync_CreateRequest( - pipeline, - resourceUri, - copySource, - timeout, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - requestId)) + Azure.Core.Pipeline.DiagnosticScope _scope = pipeline.Diagnostics.CreateScope(operationName); + try { - Azure.Response _response = async ? - // Send the request asynchronously if we're being called via an async path - await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : - // Send the request synchronously through the API that blocks if we're being called via a sync path - // (this is safe because the Task will complete before the user can call Wait) - pipeline.SendRequest(_request, cancellationToken); - cancellationToken.ThrowIfCancellationRequested(); - return CopyIncrementalAsync_CreateResponse(_response); + _scope.AddAttribute("url", resourceUri); + _scope.Start(); + using (Azure.Core.Http.Request _request = CopyIncrementalAsync_CreateRequest( + pipeline, + resourceUri, + copySource, + timeout, + ifModifiedSince, + ifUnmodifiedSince, + ifMatch, + ifNoneMatch, + requestId)) + { + Azure.Response _response = async ? + // Send the request asynchronously if we're being called via an async path + await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : + // Send the request synchronously through the API that blocks if we're being called via a sync path + // (this is safe because the Task will complete before the user can call Wait) + pipeline.SendRequest(_request, cancellationToken); + cancellationToken.ThrowIfCancellationRequested(); + return CopyIncrementalAsync_CreateResponse(_response); + } + } + catch (System.Exception ex) + { + _scope.Failed(ex); + throw; + } + finally + { + _scope.Dispose(); } } @@ -7361,6 +8109,7 @@ public static partial class AppendBlob /// Specify an ETag value to operate only on blobs without a matching value. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// Whether to invoke the operation asynchronously. The default value is true. + /// Operation name. /// Cancellation token. /// Azure.Response{Azure.Storage.Blobs.Models.BlobContentInfo} public static async System.Threading.Tasks.Task> CreateAsync( @@ -7382,35 +8131,51 @@ public static partial class AppendBlob Azure.Core.Http.ETag? ifNoneMatch = default, string requestId = default, bool async = true, + string operationName = "Azure.Storage.Blobs.AppendBlobClient.Create", System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.Request _request = CreateAsync_CreateRequest( - pipeline, - resourceUri, - contentLength, - timeout, - blobContentType, - blobContentEncoding, - blobContentLanguage, - blobContentHash, - blobCacheControl, - metadata, - leaseId, - blobContentDisposition, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - requestId)) - { - Azure.Response _response = async ? - // Send the request asynchronously if we're being called via an async path - await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : - // Send the request synchronously through the API that blocks if we're being called via a sync path - // (this is safe because the Task will complete before the user can call Wait) - pipeline.SendRequest(_request, cancellationToken); - cancellationToken.ThrowIfCancellationRequested(); - return CreateAsync_CreateResponse(_response); + Azure.Core.Pipeline.DiagnosticScope _scope = pipeline.Diagnostics.CreateScope(operationName); + try + { + _scope.AddAttribute("url", resourceUri); + _scope.Start(); + using (Azure.Core.Http.Request _request = CreateAsync_CreateRequest( + pipeline, + resourceUri, + contentLength, + timeout, + blobContentType, + blobContentEncoding, + blobContentLanguage, + blobContentHash, + blobCacheControl, + metadata, + leaseId, + blobContentDisposition, + ifModifiedSince, + ifUnmodifiedSince, + ifMatch, + ifNoneMatch, + requestId)) + { + Azure.Response _response = async ? + // Send the request asynchronously if we're being called via an async path + await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : + // Send the request synchronously through the API that blocks if we're being called via a sync path + // (this is safe because the Task will complete before the user can call Wait) + pipeline.SendRequest(_request, cancellationToken); + cancellationToken.ThrowIfCancellationRequested(); + return CreateAsync_CreateResponse(_response); + } + } + catch (System.Exception ex) + { + _scope.Failed(ex); + throw; + } + finally + { + _scope.Dispose(); } } @@ -7578,6 +8343,7 @@ internal static Azure.Core.Http.Request CreateAsync_CreateRequest( /// Specify an ETag value to operate only on blobs without a matching value. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// Whether to invoke the operation asynchronously. The default value is true. + /// Operation name. /// Cancellation token. /// Azure.Response{Azure.Storage.Blobs.Models.BlobAppendInfo} public static async System.Threading.Tasks.Task> AppendBlockAsync( @@ -7596,32 +8362,48 @@ internal static Azure.Core.Http.Request CreateAsync_CreateRequest( Azure.Core.Http.ETag? ifNoneMatch = default, string requestId = default, bool async = true, + string operationName = "Azure.Storage.Blobs.AppendBlobClient.AppendBlock", System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.Request _request = AppendBlockAsync_CreateRequest( - pipeline, - resourceUri, - body, - contentLength, - timeout, - transactionalContentHash, - leaseId, - maxSize, - appendPosition, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - requestId)) - { - Azure.Response _response = async ? - // Send the request asynchronously if we're being called via an async path - await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : - // Send the request synchronously through the API that blocks if we're being called via a sync path - // (this is safe because the Task will complete before the user can call Wait) - pipeline.SendRequest(_request, cancellationToken); - cancellationToken.ThrowIfCancellationRequested(); - return AppendBlockAsync_CreateResponse(_response); + Azure.Core.Pipeline.DiagnosticScope _scope = pipeline.Diagnostics.CreateScope(operationName); + try + { + _scope.AddAttribute("url", resourceUri); + _scope.Start(); + using (Azure.Core.Http.Request _request = AppendBlockAsync_CreateRequest( + pipeline, + resourceUri, + body, + contentLength, + timeout, + transactionalContentHash, + leaseId, + maxSize, + appendPosition, + ifModifiedSince, + ifUnmodifiedSince, + ifMatch, + ifNoneMatch, + requestId)) + { + Azure.Response _response = async ? + // Send the request asynchronously if we're being called via an async path + await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : + // Send the request synchronously through the API that blocks if we're being called via a sync path + // (this is safe because the Task will complete before the user can call Wait) + pipeline.SendRequest(_request, cancellationToken); + cancellationToken.ThrowIfCancellationRequested(); + return AppendBlockAsync_CreateResponse(_response); + } + } + catch (System.Exception ex) + { + _scope.Failed(ex); + throw; + } + finally + { + _scope.Dispose(); } } @@ -7784,6 +8566,7 @@ internal static Azure.Core.Http.Request AppendBlockAsync_CreateRequest( /// Specify an ETag value to operate only on blobs without a matching value. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// Whether to invoke the operation asynchronously. The default value is true. + /// Operation name. /// Cancellation token. /// Azure.Response{Azure.Storage.Blobs.Models.BlobAppendInfo} public static async System.Threading.Tasks.Task> AppendBlockFromUriAsync( @@ -7807,37 +8590,53 @@ internal static Azure.Core.Http.Request AppendBlockAsync_CreateRequest( Azure.Core.Http.ETag? sourceIfNoneMatch = default, string requestId = default, bool async = true, + string operationName = "Azure.Storage.Blobs.AppendBlobClient.AppendBlockFromUri", System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.Request _request = AppendBlockFromUriAsync_CreateRequest( - pipeline, - resourceUri, - sourceUri, - contentLength, - sourceRange, - sourceContentHash, - timeout, - leaseId, - maxSize, - appendPosition, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - sourceIfModifiedSince, - sourceIfUnmodifiedSince, - sourceIfMatch, - sourceIfNoneMatch, - requestId)) - { - Azure.Response _response = async ? - // Send the request asynchronously if we're being called via an async path - await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : - // Send the request synchronously through the API that blocks if we're being called via a sync path - // (this is safe because the Task will complete before the user can call Wait) - pipeline.SendRequest(_request, cancellationToken); - cancellationToken.ThrowIfCancellationRequested(); - return AppendBlockFromUriAsync_CreateResponse(_response); + Azure.Core.Pipeline.DiagnosticScope _scope = pipeline.Diagnostics.CreateScope(operationName); + try + { + _scope.AddAttribute("url", resourceUri); + _scope.Start(); + using (Azure.Core.Http.Request _request = AppendBlockFromUriAsync_CreateRequest( + pipeline, + resourceUri, + sourceUri, + contentLength, + sourceRange, + sourceContentHash, + timeout, + leaseId, + maxSize, + appendPosition, + ifModifiedSince, + ifUnmodifiedSince, + ifMatch, + ifNoneMatch, + sourceIfModifiedSince, + sourceIfUnmodifiedSince, + sourceIfMatch, + sourceIfNoneMatch, + requestId)) + { + Azure.Response _response = async ? + // Send the request asynchronously if we're being called via an async path + await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : + // Send the request synchronously through the API that blocks if we're being called via a sync path + // (this is safe because the Task will complete before the user can call Wait) + pipeline.SendRequest(_request, cancellationToken); + cancellationToken.ThrowIfCancellationRequested(); + return AppendBlockFromUriAsync_CreateResponse(_response); + } + } + catch (System.Exception ex) + { + _scope.Failed(ex); + throw; + } + finally + { + _scope.Dispose(); } } @@ -8034,6 +8833,7 @@ public static partial class BlockBlob /// Specify an ETag value to operate only on blobs without a matching value. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// Whether to invoke the operation asynchronously. The default value is true. + /// Operation name. /// Cancellation token. /// Azure.Response{Azure.Storage.Blobs.Models.BlobContentInfo} public static async System.Threading.Tasks.Task> UploadAsync( @@ -8056,36 +8856,52 @@ public static partial class BlockBlob Azure.Core.Http.ETag? ifNoneMatch = default, string requestId = default, bool async = true, + string operationName = "Azure.Storage.Blobs.BlockBlobClient.Upload", System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.Request _request = UploadAsync_CreateRequest( - pipeline, - resourceUri, - body, - contentLength, - timeout, - blobContentType, - blobContentEncoding, - blobContentLanguage, - blobContentHash, - blobCacheControl, - metadata, - leaseId, - blobContentDisposition, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - requestId)) - { - Azure.Response _response = async ? - // Send the request asynchronously if we're being called via an async path - await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : - // Send the request synchronously through the API that blocks if we're being called via a sync path - // (this is safe because the Task will complete before the user can call Wait) - pipeline.SendRequest(_request, cancellationToken); - cancellationToken.ThrowIfCancellationRequested(); - return UploadAsync_CreateResponse(_response); + Azure.Core.Pipeline.DiagnosticScope _scope = pipeline.Diagnostics.CreateScope(operationName); + try + { + _scope.AddAttribute("url", resourceUri); + _scope.Start(); + using (Azure.Core.Http.Request _request = UploadAsync_CreateRequest( + pipeline, + resourceUri, + body, + contentLength, + timeout, + blobContentType, + blobContentEncoding, + blobContentLanguage, + blobContentHash, + blobCacheControl, + metadata, + leaseId, + blobContentDisposition, + ifModifiedSince, + ifUnmodifiedSince, + ifMatch, + ifNoneMatch, + requestId)) + { + Azure.Response _response = async ? + // Send the request asynchronously if we're being called via an async path + await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : + // Send the request synchronously through the API that blocks if we're being called via a sync path + // (this is safe because the Task will complete before the user can call Wait) + pipeline.SendRequest(_request, cancellationToken); + cancellationToken.ThrowIfCancellationRequested(); + return UploadAsync_CreateResponse(_response); + } + } + catch (System.Exception ex) + { + _scope.Failed(ex); + throw; + } + finally + { + _scope.Dispose(); } } @@ -8257,6 +9073,7 @@ internal static Azure.Core.Http.Request UploadAsync_CreateRequest( /// If specified, the operation only succeeds if the resource's lease is active and matches this ID. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// Whether to invoke the operation asynchronously. The default value is true. + /// Operation name. /// Cancellation token. /// Azure.Response{Azure.Storage.Blobs.Models.BlockInfo} public static async System.Threading.Tasks.Task> StageBlockAsync( @@ -8270,27 +9087,43 @@ internal static Azure.Core.Http.Request UploadAsync_CreateRequest( string leaseId = default, string requestId = default, bool async = true, + string operationName = "Azure.Storage.Blobs.BlockBlobClient.StageBlock", System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.Request _request = StageBlockAsync_CreateRequest( - pipeline, - resourceUri, - blockId, - contentLength, - body, - transactionalContentHash, - timeout, - leaseId, - requestId)) + Azure.Core.Pipeline.DiagnosticScope _scope = pipeline.Diagnostics.CreateScope(operationName); + try + { + _scope.AddAttribute("url", resourceUri); + _scope.Start(); + using (Azure.Core.Http.Request _request = StageBlockAsync_CreateRequest( + pipeline, + resourceUri, + blockId, + contentLength, + body, + transactionalContentHash, + timeout, + leaseId, + requestId)) + { + Azure.Response _response = async ? + // Send the request asynchronously if we're being called via an async path + await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : + // Send the request synchronously through the API that blocks if we're being called via a sync path + // (this is safe because the Task will complete before the user can call Wait) + pipeline.SendRequest(_request, cancellationToken); + cancellationToken.ThrowIfCancellationRequested(); + return StageBlockAsync_CreateResponse(_response); + } + } + catch (System.Exception ex) { - Azure.Response _response = async ? - // Send the request asynchronously if we're being called via an async path - await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : - // Send the request synchronously through the API that blocks if we're being called via a sync path - // (this is safe because the Task will complete before the user can call Wait) - pipeline.SendRequest(_request, cancellationToken); - cancellationToken.ThrowIfCancellationRequested(); - return StageBlockAsync_CreateResponse(_response); + _scope.Failed(ex); + throw; + } + finally + { + _scope.Dispose(); } } @@ -8417,6 +9250,7 @@ internal static Azure.Core.Http.Request StageBlockAsync_CreateRequest( /// Specify an ETag value to operate only on blobs without a matching value. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// Whether to invoke the operation asynchronously. The default value is true. + /// Operation name. /// Cancellation token. /// Azure.Response{Azure.Storage.Blobs.Models.BlockInfo} public static async System.Threading.Tasks.Task> StageBlockFromUriAsync( @@ -8435,32 +9269,48 @@ internal static Azure.Core.Http.Request StageBlockAsync_CreateRequest( Azure.Core.Http.ETag? sourceIfNoneMatch = default, string requestId = default, bool async = true, + string operationName = "Azure.Storage.Blobs.BlockBlobClient.StageBlockFromUri", System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.Request _request = StageBlockFromUriAsync_CreateRequest( - pipeline, - resourceUri, - blockId, - contentLength, - sourceUri, - sourceRange, - sourceContentHash, - timeout, - leaseId, - sourceIfModifiedSince, - sourceIfUnmodifiedSince, - sourceIfMatch, - sourceIfNoneMatch, - requestId)) - { - Azure.Response _response = async ? - // Send the request asynchronously if we're being called via an async path - await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : - // Send the request synchronously through the API that blocks if we're being called via a sync path - // (this is safe because the Task will complete before the user can call Wait) - pipeline.SendRequest(_request, cancellationToken); - cancellationToken.ThrowIfCancellationRequested(); - return StageBlockFromUriAsync_CreateResponse(_response); + Azure.Core.Pipeline.DiagnosticScope _scope = pipeline.Diagnostics.CreateScope(operationName); + try + { + _scope.AddAttribute("url", resourceUri); + _scope.Start(); + using (Azure.Core.Http.Request _request = StageBlockFromUriAsync_CreateRequest( + pipeline, + resourceUri, + blockId, + contentLength, + sourceUri, + sourceRange, + sourceContentHash, + timeout, + leaseId, + sourceIfModifiedSince, + sourceIfUnmodifiedSince, + sourceIfMatch, + sourceIfNoneMatch, + requestId)) + { + Azure.Response _response = async ? + // Send the request asynchronously if we're being called via an async path + await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : + // Send the request synchronously through the API that blocks if we're being called via a sync path + // (this is safe because the Task will complete before the user can call Wait) + pipeline.SendRequest(_request, cancellationToken); + cancellationToken.ThrowIfCancellationRequested(); + return StageBlockFromUriAsync_CreateResponse(_response); + } + } + catch (System.Exception ex) + { + _scope.Failed(ex); + throw; + } + finally + { + _scope.Dispose(); } } @@ -8617,6 +9467,7 @@ internal static Azure.Core.Http.Request StageBlockFromUriAsync_CreateRequest( /// Specify an ETag value to operate only on blobs without a matching value. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// Whether to invoke the operation asynchronously. The default value is true. + /// Operation name. /// Cancellation token. /// Azure.Response{Azure.Storage.Blobs.Models.BlobContentInfo} public static async System.Threading.Tasks.Task> CommitBlockListAsync( @@ -8638,35 +9489,51 @@ internal static Azure.Core.Http.Request StageBlockFromUriAsync_CreateRequest( Azure.Core.Http.ETag? ifNoneMatch = default, string requestId = default, bool async = true, + string operationName = "Azure.Storage.Blobs.BlockBlobClient.CommitBlockList", System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.Request _request = CommitBlockListAsync_CreateRequest( - pipeline, - resourceUri, - blocks, - timeout, - blobCacheControl, - blobContentType, - blobContentEncoding, - blobContentLanguage, - blobContentHash, - metadata, - leaseId, - blobContentDisposition, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - requestId)) - { - Azure.Response _response = async ? - // Send the request asynchronously if we're being called via an async path - await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : - // Send the request synchronously through the API that blocks if we're being called via a sync path - // (this is safe because the Task will complete before the user can call Wait) - pipeline.SendRequest(_request, cancellationToken); - cancellationToken.ThrowIfCancellationRequested(); - return CommitBlockListAsync_CreateResponse(_response); + Azure.Core.Pipeline.DiagnosticScope _scope = pipeline.Diagnostics.CreateScope(operationName); + try + { + _scope.AddAttribute("url", resourceUri); + _scope.Start(); + using (Azure.Core.Http.Request _request = CommitBlockListAsync_CreateRequest( + pipeline, + resourceUri, + blocks, + timeout, + blobCacheControl, + blobContentType, + blobContentEncoding, + blobContentLanguage, + blobContentHash, + metadata, + leaseId, + blobContentDisposition, + ifModifiedSince, + ifUnmodifiedSince, + ifMatch, + ifNoneMatch, + requestId)) + { + Azure.Response _response = async ? + // Send the request asynchronously if we're being called via an async path + await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : + // Send the request synchronously through the API that blocks if we're being called via a sync path + // (this is safe because the Task will complete before the user can call Wait) + pipeline.SendRequest(_request, cancellationToken); + cancellationToken.ThrowIfCancellationRequested(); + return CommitBlockListAsync_CreateResponse(_response); + } + } + catch (System.Exception ex) + { + _scope.Failed(ex); + throw; + } + finally + { + _scope.Dispose(); } } @@ -8837,6 +9704,7 @@ internal static Azure.Core.Http.Request CommitBlockListAsync_CreateRequest( /// If specified, the operation only succeeds if the resource's lease is active and matches this ID. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// Whether to invoke the operation asynchronously. The default value is true. + /// Operation name. /// Cancellation token. /// Azure.Response{Azure.Storage.Blobs.Models.GetBlockListOperation} public static async System.Threading.Tasks.Task> GetBlockListAsync( @@ -8848,25 +9716,41 @@ internal static Azure.Core.Http.Request CommitBlockListAsync_CreateRequest( string leaseId = default, string requestId = default, bool async = true, + string operationName = "Azure.Storage.Blobs.BlockBlobClient.GetBlockList", System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.Request _request = GetBlockListAsync_CreateRequest( - pipeline, - resourceUri, - listType, - snapshot, - timeout, - leaseId, - requestId)) - { - Azure.Response _response = async ? - // Send the request asynchronously if we're being called via an async path - await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : - // Send the request synchronously through the API that blocks if we're being called via a sync path - // (this is safe because the Task will complete before the user can call Wait) - pipeline.SendRequest(_request, cancellationToken); - cancellationToken.ThrowIfCancellationRequested(); - return GetBlockListAsync_CreateResponse(_response); + Azure.Core.Pipeline.DiagnosticScope _scope = pipeline.Diagnostics.CreateScope(operationName); + try + { + _scope.AddAttribute("url", resourceUri); + _scope.Start(); + using (Azure.Core.Http.Request _request = GetBlockListAsync_CreateRequest( + pipeline, + resourceUri, + listType, + snapshot, + timeout, + leaseId, + requestId)) + { + Azure.Response _response = async ? + // Send the request asynchronously if we're being called via an async path + await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : + // Send the request synchronously through the API that blocks if we're being called via a sync path + // (this is safe because the Task will complete before the user can call Wait) + pipeline.SendRequest(_request, cancellationToken); + cancellationToken.ThrowIfCancellationRequested(); + return GetBlockListAsync_CreateResponse(_response); + } + } + catch (System.Exception ex) + { + _scope.Failed(ex); + throw; + } + finally + { + _scope.Dispose(); } } diff --git a/sdk/storage/Azure.Storage.Blobs/src/LeaseClient.cs b/sdk/storage/Azure.Storage.Blobs/src/LeaseClient.cs index df7ded7748129..2a5d1eda25f5e 100644 --- a/sdk/storage/Azure.Storage.Blobs/src/LeaseClient.cs +++ b/sdk/storage/Azure.Storage.Blobs/src/LeaseClient.cs @@ -274,6 +274,7 @@ private async Task> AcquireInternal( ifMatch: httpAccessConditions?.IfMatch, ifNoneMatch: httpAccessConditions?.IfNoneMatch, async: async, + operationName: "Azure.Storage.Blobs.Specialized.LeaseClient.Acquire", cancellationToken: cancellationToken) .ConfigureAwait(false); } @@ -439,6 +440,7 @@ private async Task> RenewInternal( ifMatch: httpAccessConditions?.IfMatch, ifNoneMatch: httpAccessConditions?.IfNoneMatch, async: async, + operationName: "Azure.Storage.Blobs.Specialized.LeaseClient.Renew", cancellationToken: cancellationToken) .ConfigureAwait(false); } @@ -605,6 +607,7 @@ await BlobRestClient.Blob.ReleaseLeaseAsync( ifMatch: httpAccessConditions?.IfMatch, ifNoneMatch: httpAccessConditions?.IfNoneMatch, async: async, + operationName: "Azure.Storage.Blobs.Specialized.LeaseClient.Release", cancellationToken: cancellationToken) .ConfigureAwait(false); return new Response( @@ -784,6 +787,7 @@ private async Task> ChangeInternal( ifMatch: httpAccessConditions?.IfMatch, ifNoneMatch: httpAccessConditions?.IfNoneMatch, async: async, + operationName: "Azure.Storage.Blobs.Specialized.LeaseClient.Change", cancellationToken: cancellationToken) .ConfigureAwait(false); } @@ -803,6 +807,7 @@ private async Task> ChangeInternal( ifModifiedSince: httpAccessConditions?.IfModifiedSince, ifUnmodifiedSince: httpAccessConditions?.IfUnmodifiedSince, async: async, + operationName: "Azure.Storage.Blobs.Specialized.LeaseClient.Change", cancellationToken: cancellationToken) .ConfigureAwait(false); } @@ -1009,6 +1014,7 @@ private async Task> BreakInternal( ifMatch: httpAccessConditions?.IfMatch, ifNoneMatch: httpAccessConditions?.IfNoneMatch, async: async, + operationName: "Azure.Storage.Blobs.Specialized.LeaseClient.Break", cancellationToken: cancellationToken) .ConfigureAwait(false)) .ToLease(); diff --git a/sdk/storage/Azure.Storage.Blobs/src/PageBlobClient.cs b/sdk/storage/Azure.Storage.Blobs/src/PageBlobClient.cs index dece55f39e9b3..1875ec612255a 100644 --- a/sdk/storage/Azure.Storage.Blobs/src/PageBlobClient.cs +++ b/sdk/storage/Azure.Storage.Blobs/src/PageBlobClient.cs @@ -425,6 +425,7 @@ private async Task> CreateInternal( blobContentLength: size, blobSequenceNumber: sequenceNumber, async: async, + operationName: "Azure.Storage.Blobs.Specialized.PageBlobClient.Create", cancellationToken: cancellationToken) .ConfigureAwait(false); } @@ -659,6 +660,7 @@ private async Task> UploadPagesInternal( ifMatch: accessConditions?.HttpAccessConditions?.IfMatch, ifNoneMatch: accessConditions?.HttpAccessConditions?.IfNoneMatch, async: async, + operationName: "Azure.Storage.Blobs.Specialized.PageBlobClient.UploadPages", cancellationToken: cancellationToken); }, cleanup: () => { }) @@ -825,6 +827,7 @@ private async Task> ClearPagesInternal( ifMatch: accessConditions?.HttpAccessConditions?.IfMatch, ifNoneMatch: accessConditions?.HttpAccessConditions?.IfNoneMatch, async: async, + operationName: "Azure.Storage.Blobs.Specialized.PageBlobClient.ClearPages", cancellationToken: cancellationToken) .ConfigureAwait(false); } @@ -992,6 +995,7 @@ private async Task> GetPageRangesInternal( ifMatch: accessConditions?.HttpAccessConditions?.IfMatch, ifNoneMatch: accessConditions?.HttpAccessConditions?.IfNoneMatch, async: async, + operationName: "Azure.Storage.Blobs.Specialized.PageBlobClient.GetPageRanges", cancellationToken: cancellationToken) .ConfigureAwait(false); } @@ -1193,6 +1197,7 @@ private async Task> GetPageRangesDiffInternal( ifMatch: accessConditions?.HttpAccessConditions?.IfMatch, ifNoneMatch: accessConditions?.HttpAccessConditions?.IfNoneMatch, async: async, + operationName: "Azure.Storage.Blobs.Specialized.PageBlobClient.GetPageRangesDiff", cancellationToken: cancellationToken) .ConfigureAwait(false); } @@ -1351,6 +1356,7 @@ private async Task> ResizeInternal( ifMatch: accessConditions?.HttpAccessConditions?.IfMatch, ifNoneMatch: accessConditions?.HttpAccessConditions?.IfNoneMatch, async: async, + operationName: "Azure.Storage.Blobs.Specialized.PageBlobClient.Resize", cancellationToken: cancellationToken) .ConfigureAwait(false); } @@ -1557,6 +1563,7 @@ private async Task> UpdateSequenceNumberInternal( ifUnmodifiedSince: accessConditions?.HttpAccessConditions?.IfUnmodifiedSince, ifMatch: accessConditions?.HttpAccessConditions?.IfMatch, ifNoneMatch: accessConditions?.HttpAccessConditions?.IfNoneMatch, + operationName: "Azure.Storage.Blobs.Specialized.PageBlobClient.UpdateSequenceNumber", async: async, cancellationToken: cancellationToken) .ConfigureAwait(false); @@ -1974,6 +1981,7 @@ private async Task> StartCopyIncrementalInternal( ifMatch: accessConditions?.HttpAccessConditions?.IfMatch, ifNoneMatch: accessConditions?.HttpAccessConditions?.IfNoneMatch, async: async, + operationName: "Azure.Storage.Blobs.Specialized.PageBlobClient.StartCopyIncremental", cancellationToken: cancellationToken) .ConfigureAwait(false); } @@ -2241,6 +2249,7 @@ private async Task> UploadPagesFromUriInternal( sourceIfMatch: sourceAccessConditions?.HttpAccessConditions?.IfMatch, sourceIfNoneMatch: sourceAccessConditions?.HttpAccessConditions?.IfNoneMatch, async: async, + operationName: "Azure.Storage.Blobs.Specialized.PageBlobClient.UploadPagesFromUri", cancellationToken: cancellationToken) .ConfigureAwait(false); } diff --git a/sdk/storage/Azure.Storage.Blobs/swagger/blob.json b/sdk/storage/Azure.Storage.Blobs/swagger/blob.json index cd3a484055132..384203419b291 100644 --- a/sdk/storage/Azure.Storage.Blobs/swagger/blob.json +++ b/sdk/storage/Azure.Storage.Blobs/swagger/blob.json @@ -6199,7 +6199,8 @@ "type": "string", "format": "url", "in": "path", - "x-ms-skip-url-encoding": true + "x-ms-skip-url-encoding": true, + "x-ms-trace": true }, "ApiVersionParameter": { "name": "x-ms-version", diff --git a/sdk/storage/Azure.Storage.Blobs/tests/BlobBaseClientTests.cs b/sdk/storage/Azure.Storage.Blobs/tests/BlobBaseClientTests.cs index 03b47b6d2bee2..eb536b5568dfc 100644 --- a/sdk/storage/Azure.Storage.Blobs/tests/BlobBaseClientTests.cs +++ b/sdk/storage/Azure.Storage.Blobs/tests/BlobBaseClientTests.cs @@ -67,7 +67,7 @@ public async Task DownloadAsync() // Act var response = await blob.DownloadAsync(); - + // Assert Assert.AreEqual(data.Length, response.Value.ContentLength); var actual = new MemoryStream(); @@ -212,7 +212,7 @@ public async Task DownloadAsync_MD5() // Act var response = await blob.DownloadAsync( - range: new HttpRange(offset, count), + range: new HttpRange(offset, count), rangeGetContentHash: true); // Assert @@ -1851,7 +1851,7 @@ public async Task SetTierAsync_Lease() // Act var response = await blob.SetTierAsync( - accessTier: AccessTier.Cool, + accessTier: AccessTier.Cool, leaseAccessConditions: new LeaseAccessConditions { LeaseId = leaseId diff --git a/sdk/storage/Azure.Storage.Blobs/tests/ServiceClientTests.cs b/sdk/storage/Azure.Storage.Blobs/tests/ServiceClientTests.cs index a34b968ab505d..213ce4384f04f 100644 --- a/sdk/storage/Azure.Storage.Blobs/tests/ServiceClientTests.cs +++ b/sdk/storage/Azure.Storage.Blobs/tests/ServiceClientTests.cs @@ -117,7 +117,7 @@ public async Task ListContainersSegmentAsync_Prefix() Assert.IsNotNull(items.Single(c => c.Value.Name == containerName)); } } - + [Test] public async Task ListContainersSegmentAsync_Metadata() { diff --git a/sdk/storage/Azure.Storage.Common/src/Azure.Storage.Common.csproj b/sdk/storage/Azure.Storage.Common/src/Azure.Storage.Common.csproj index 1abad8acbfe0c..4ae72c420e205 100644 --- a/sdk/storage/Azure.Storage.Common/src/Azure.Storage.Common.csproj +++ b/sdk/storage/Azure.Storage.Common/src/Azure.Storage.Common.csproj @@ -23,5 +23,6 @@ (and shared via InternalsVisibleTo with the other libraries) --> + diff --git a/sdk/storage/Azure.Storage.Common/swagger/Generator/src/generator.ts b/sdk/storage/Azure.Storage.Common/swagger/Generator/src/generator.ts index d170f4e0282cf..2775c6acba188 100644 --- a/sdk/storage/Azure.Storage.Common/swagger/Generator/src/generator.ts +++ b/sdk/storage/Azure.Storage.Common/swagger/Generator/src/generator.ts @@ -85,7 +85,7 @@ function generateService(w: IndentWriter, model: IServiceModel): void { // w.scope(() => { // const headerAccess = responseType.type === `void` ? ``: `.Raw`; // w.write(`=> response${headerAccess}.Headers.TryGetValue("${header.name}", out string header) ?`); - // w.scope(() => { + // w.scope(() => { // w.line(`${types.convertFromString('header', header.model, service)} :`) // w.line(`default;`); // }); @@ -130,6 +130,8 @@ function generateOperation(w: IndentWriter, serviceModel: IServiceModel, group: const pairName = `_headerPair`; let responseName = "_response"; const resultName = "_result"; + const scopeName = "_scope"; + const operationName = "operationName"; const result = operation.response.model; const sync = serviceModel.info.sync; @@ -154,6 +156,7 @@ function generateOperation(w: IndentWriter, serviceModel: IServiceModel, group: if (sync) { w.line(`/// Whether to invoke the operation asynchronously. The default value is true.`); } + w.line(`/// Operation name.`); w.line(`/// Cancellation token.`); w.line(`/// ${operation.response.model.description || returnType.replace(//g, '}')}`); w.write(`public static async System.Threading.Tasks.Task<${returnType}> ${methodName}(`); @@ -169,36 +172,58 @@ function generateOperation(w: IndentWriter, serviceModel: IServiceModel, group: w.write(`bool async = true`); } if (separateParams()) { w.line(`,`); } + w.write(`string ${operationName} = "${naming.namespace(serviceModel.info.namespace)}.${operation.group ? operation.group + "Client" : naming.type(service.name)}.${operation.name}"`); + if (separateParams()) { w.line(`,`); } w.write(`System.Threading.CancellationToken ${cancellationName} = default`); w.write(')') }); w.scope('{', '}', () => { - w.write(`using (Azure.Core.Http.Request ${requestName} = ${methodName}_CreateRequest(`); - w.scope(() => { - const separateParams = IndentWriter.createFenceposter(); + w.line(`Azure.Core.Pipeline.DiagnosticScope ${scopeName} = ${pipelineName}.Diagnostics.CreateScope(${operationName});`) + w.line(`try`); + w.scope('{', '}', () => { for (const arg of operation.request.arguments) { - if (separateParams()) { w.line(`,`); } - w.write(`${naming.parameter(arg.clientName)}`); + if (arg.trace) + { + w.line(`${scopeName}.AddAttribute("${naming.parameter(arg.name)}", ${naming.parameter(arg.clientName)});`); + } } - w.write(`))`); + w.line(`${scopeName}.Start();`); + w.write(`using (Azure.Core.Http.Request ${requestName} = ${methodName}_CreateRequest(`); + w.scope(() => { + const separateParams = IndentWriter.createFenceposter(); + for (const arg of operation.request.arguments) { + if (separateParams()) { w.line(`,`); } + w.write(`${naming.parameter(arg.clientName)}`); + } + w.write(`))`); + }); + w.scope('{', '}', () => { + w.write(`Azure.Response ${responseName} = `); + const asyncCall = `await ${pipelineName}.SendRequestAsync(${requestName}, ${cancellationName}).ConfigureAwait(false)`; + if (sync) { + w.write('async ?'); + w.scope(() => { + w.line(`// Send the request asynchronously if we're being called via an async path`); + w.line(`${asyncCall} :`); + w.line(`// Send the request synchronously through the API that blocks if we're being called via a sync path`); + w.line(`// (this is safe because the Task will complete before the user can call Wait)`); + w.line(`${pipelineName}.SendRequest(${requestName}, ${cancellationName});`); + }); + } else { + w.line(`${asyncCall};`); + } + w.line(`${cancellationName}.ThrowIfCancellationRequested();`); + w.line(`return ${methodName}_CreateResponse(${responseName});`); + }); }); + w.line(`catch (System.Exception ex)`); w.scope('{', '}', () => { - w.write(`Azure.Response ${responseName} = `); - const asyncCall = `await ${pipelineName}.SendRequestAsync(${requestName}, ${cancellationName}).ConfigureAwait(false)`; - if (sync) { - w.write('async ?'); - w.scope(() => { - w.line(`// Send the request asynchronously if we're being called via an async path`); - w.line(`${asyncCall} :`); - w.line(`// Send the request synchronously through the API that blocks if we're being called via a sync path`); - w.line(`// (this is safe because the Task will complete before the user can call Wait)`); - w.line(`${pipelineName}.SendRequest(${requestName}, ${cancellationName});`); - }); - } else { - w.line(`${asyncCall};`); - } - w.line(`${cancellationName}.ThrowIfCancellationRequested();`); - w.line(`return ${methodName}_CreateResponse(${responseName});`); + w.line(`${scopeName}.Failed(ex);`); + w.line(`throw;`); + }); + w.line(`finally`); + w.scope('{', '}', () => { + w.line(`${scopeName}.Dispose();`); }); }); w.line(); diff --git a/sdk/storage/Azure.Storage.Common/swagger/Generator/src/models.ts b/sdk/storage/Azure.Storage.Common/swagger/Generator/src/models.ts index 76ddaed666562..a5e7e2f2e9e04 100644 --- a/sdk/storage/Azure.Storage.Common/swagger/Generator/src/models.ts +++ b/sdk/storage/Azure.Storage.Common/swagger/Generator/src/models.ts @@ -217,7 +217,8 @@ export interface IParameter { location: string, skipUrlEncoding: boolean, parameterGroup?: string, - model: IModelType + model: IModelType, + trace: boolean } export interface IResponses { diff --git a/sdk/storage/Azure.Storage.Common/swagger/Generator/src/serviceModel.ts b/sdk/storage/Azure.Storage.Common/swagger/Generator/src/serviceModel.ts index 68c7a8137469d..c0ae449e8448b 100644 --- a/sdk/storage/Azure.Storage.Common/swagger/Generator/src/serviceModel.ts +++ b/sdk/storage/Azure.Storage.Common/swagger/Generator/src/serviceModel.ts @@ -320,6 +320,8 @@ function createParameter(project: IProject, swagger: any, location: string): IPa unsupported(() => grouping.postfix, `${location}['x-ms-parameter-grouping'].postfix`); } + const trace = optional(() => swagger[`x-ms-trace`], false); + unsupported(() => swagger[`x-ms-client-flatten`], location); unsupported(() => swagger[`x-ms-client-request-id`], location); @@ -338,7 +340,8 @@ function createParameter(project: IProject, swagger: any, location: string): IPa location: at, skipUrlEncoding, parameterGroup, - model + model, + trace }; } @@ -829,7 +832,8 @@ function getOperationParameters(project: IProject, info: IServiceInfo, path: tem namespace: 'Azure.Core.Pipeline', properties: { }, xml: { } - } + }, + trace: false }); return parameters; diff --git a/sdk/storage/Azure.Storage.Files/src/DirectoryClient.cs b/sdk/storage/Azure.Storage.Files/src/DirectoryClient.cs index 1791e016957bb..c1c156e5b3605 100644 --- a/sdk/storage/Azure.Storage.Files/src/DirectoryClient.cs +++ b/sdk/storage/Azure.Storage.Files/src/DirectoryClient.cs @@ -6,6 +6,7 @@ using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; +using Azure.Core; using Azure.Core.Pipeline; using Azure.Storage.Common; using Azure.Storage.Files.Models; @@ -29,13 +30,13 @@ public class DirectoryClient public virtual Uri Uri => this._uri; /// - /// The transport pipeline used to send + /// The transport pipeline used to send /// every request. /// private readonly HttpPipeline _pipeline; /// - /// Gets the transport pipeline used to send + /// Gets the transport pipeline used to send /// every request. /// protected virtual HttpPipeline Pipeline => this._pipeline; @@ -56,7 +57,7 @@ protected DirectoryClient() /// A connection string includes the authentication information /// required for your application to access data in an Azure Storage /// account at runtime. - /// + /// /// For more information, . /// /// @@ -77,7 +78,7 @@ public DirectoryClient(string connectionString, string shareName, string directo /// A connection string includes the authentication information /// required for your application to access data in an Azure Storage /// account at runtime. - /// + /// /// For more information, . /// /// @@ -213,7 +214,7 @@ public virtual DirectoryClient GetSubdirectoryClient(string subdirectoryName) /// /// The operation creates a new directory /// at the specified . - /// + /// /// For more information, see . /// /// @@ -243,7 +244,7 @@ public virtual Response Create( /// /// The operation creates a new directory /// at the specified . - /// + /// /// For more information, see . /// /// @@ -273,7 +274,7 @@ await this.CreateInternal( /// /// The operation creates a new directory /// at the specified . - /// + /// /// For more information, see . /// /// @@ -311,6 +312,7 @@ private async Task> CreateInternal( this.Uri, metadata: metadata, async: async, + operationName: "Azure.Storage.Files.DirectoryClient.Create", cancellationToken: cancellationToken) .ConfigureAwait(false); } @@ -330,7 +332,7 @@ private async Task> CreateInternal( #region Delete /// /// The operation removes the specified empty directory. - /// + /// /// For more information, see . /// /// @@ -352,7 +354,7 @@ public virtual Response Delete( /// /// The operation removes the specified empty directory. - /// + /// /// For more information, see . /// /// @@ -375,7 +377,7 @@ await this.DeleteInternal( /// /// The operation removes the specified /// empty directory. - /// + /// /// For more information, see . /// /// @@ -406,6 +408,7 @@ private async Task DeleteInternal( this.Pipeline, this.Uri, async: async, + operationName: "Azure.Storage.Files.DirectoryClient.Delete", cancellationToken: cancellationToken) .ConfigureAwait(false); } @@ -426,9 +429,9 @@ private async Task DeleteInternal( /// /// The operation returns all /// user-defined metadata and system properties for the specified - /// directory. The data returned does not include the directory's + /// directory. The data returned does not include the directory's /// list of subdirectories or files. - /// + /// /// For more information, see . /// /// @@ -447,7 +450,7 @@ private async Task DeleteInternal( /// /// A will be thrown if /// a failure occurs. - /// + /// public virtual Response GetProperties( string shareSnapshot = default, CancellationToken cancellationToken = default) => @@ -460,9 +463,9 @@ public virtual Response GetProperties( /// /// The operation returns all /// user-defined metadata and system properties for the specified - /// directory. The data returned does not include the directory's + /// directory. The data returned does not include the directory's /// list of subdirectories or files. - /// + /// /// For more information, see . /// /// @@ -481,7 +484,7 @@ public virtual Response GetProperties( /// /// A will be thrown if /// a failure occurs. - /// + /// public virtual async Task> GetPropertiesAsync( string shareSnapshot = default, CancellationToken cancellationToken = default) => @@ -494,9 +497,9 @@ await this.GetPropertiesInternal( /// /// The operation returns all /// user-defined metadata and system properties for the specified - /// directory. The data returned does not include the directory's + /// directory. The data returned does not include the directory's /// list of subdirectories or files. - /// + /// /// For more information, see . /// /// @@ -518,7 +521,7 @@ await this.GetPropertiesInternal( /// /// A will be thrown if /// a failure occurs. - /// + /// private async Task> GetPropertiesInternal( string shareSnapshot, bool async, @@ -538,6 +541,7 @@ private async Task> GetPropertiesInternal( this.Uri, sharesnapshot: shareSnapshot, async: async, + operationName: "Azure.Storage.Files.DirectoryClient.GetProperties", cancellationToken: cancellationToken) .ConfigureAwait(false); } @@ -558,7 +562,7 @@ private async Task> GetPropertiesInternal( /// /// The operation sets one or more /// user-defined name-value pairs for the specified directory. - /// + /// /// For more information, see . /// /// @@ -587,7 +591,7 @@ public virtual Response SetMetadata( /// /// The operation sets one or more /// user-defined name-value pairs for the specified directory. - /// + /// /// For more information, see . /// /// @@ -616,7 +620,7 @@ await this.SetMetadataInternal( /// /// The operation sets one or more /// user-defined name-value pairs for the specified directory. - /// + /// /// For more information, see . /// /// @@ -653,6 +657,7 @@ private async Task> SetMetadataInternal( this.Uri, metadata: metadata, async: async, + operationName: "Azure.Storage.Files.DirectoryClient.SetMetadata", cancellationToken: cancellationToken) .ConfigureAwait(false); } @@ -675,7 +680,7 @@ private async Task> SetMetadataInternal( /// sequence of files and subdirectories in this directory. /// Enumerating the files and directories may make multiple requests /// to the service while fetching all the values. - /// + /// /// For more information, see . /// /// @@ -703,7 +708,7 @@ public virtual IEnumerable> GetFilesAndDirectories( /// async collection of files and subdirectories in this directory. /// Enumerating the files and directories may make multiple requests /// to the service while fetching all the values. - /// + /// /// For more information, see . /// /// @@ -730,7 +735,7 @@ public virtual AsyncCollection GetFilesAndDirectoriesAsync( /// The operation returns a /// single segment of files and subdirectories in this directory, starting /// from the specified . - /// + /// /// For more information, see . /// /// @@ -789,6 +794,7 @@ internal async Task> GetFilesAndDirectories maxresults: pageSizeHint, sharesnapshot: options?.ShareSnapshot, async: async, + operationName: "Azure.Storage.Files.DirectoryClient.ListFilesAndDirectoriesSegment", cancellationToken: cancellationToken) .ConfigureAwait(false); } @@ -811,7 +817,7 @@ internal async Task> GetFilesAndDirectories /// of the open handles on a directory or a file. Enumerating the /// handles may make multiple requests to the service while fetching /// all the values. - /// + /// /// For more information, see . /// /// @@ -839,7 +845,7 @@ public virtual IEnumerable> GetHandles( /// sequence of the open handles on a directory or a file. /// Enumerating the handles may make multiple requests to the service /// while fetching all the values. - /// + /// /// For more information, see . /// /// @@ -865,7 +871,7 @@ public virtual AsyncCollection GetHandlesAsync( /// /// The operation returns a list of open /// handles on a directory or a file. - /// + /// /// For more information, see . /// /// @@ -925,6 +931,7 @@ internal async Task> GetHandlesInternal( maxresults: maxResults, recursive: recursive, async: async, + operationName: "Azure.Storage.Files.DirectoryClient.ListHandles", cancellationToken: cancellationToken) .ConfigureAwait(false); } @@ -943,17 +950,17 @@ internal async Task> GetHandlesInternal( #region ForceCloseHandles /// - /// The operation closes a handle or handles opened on a directory - /// or a file at the service. It supports closing a single handle specified by on a file or - /// directory or closing all handles opened on that resource. It optionally supports recursively closing + /// The operation closes a handle or handles opened on a directory + /// or a file at the service. It supports closing a single handle specified by on a file or + /// directory or closing all handles opened on that resource. It optionally supports recursively closing /// handles on subresources when the resource is a directory. - /// - /// This API is intended to be used alongside to force close handles that - /// block operations, such as renaming a directory. These handles may have leaked or been lost track of by - /// SMB clients. The API has client-side impact on the handle being closed, including user visible - /// errors due to failed attempts to read or write files. This API is not intended for use as a replacement + /// + /// This API is intended to be used alongside to force close handles that + /// block operations, such as renaming a directory. These handles may have leaked or been lost track of by + /// SMB clients. The API has client-side impact on the handle being closed, including user visible + /// errors due to failed attempts to read or write files. This API is not intended for use as a replacement /// or alternative for SMB close. - /// + /// /// For more information, see . /// /// @@ -982,7 +989,7 @@ internal async Task> GetHandlesInternal( /// /// A will be thrown if /// a failure occurs. - /// + /// public virtual Response ForceCloseHandles( string handleId = Constants.CloseAllHandles, string marker = default, @@ -997,17 +1004,17 @@ public virtual Response ForceCloseHandles( .EnsureCompleted(); /// - /// The operation closes a handle or handles opened on a directory - /// or a file at the service. It supports closing a single handle specified by on a file or - /// directory or closing all handles opened on that resource. It optionally supports recursively closing + /// The operation closes a handle or handles opened on a directory + /// or a file at the service. It supports closing a single handle specified by on a file or + /// directory or closing all handles opened on that resource. It optionally supports recursively closing /// handles on subresources when the resource is a directory. - /// - /// This API is intended to be used alongside to force close handles that - /// block operations, such as renaming a directory. These handles may have leaked or been lost track of by - /// SMB clients. The API has client-side impact on the handle being closed, including user visible - /// errors due to failed attempts to read or write files. This API is not intended for use as a replacement + /// + /// This API is intended to be used alongside to force close handles that + /// block operations, such as renaming a directory. These handles may have leaked or been lost track of by + /// SMB clients. The API has client-side impact on the handle being closed, including user visible + /// errors due to failed attempts to read or write files. This API is not intended for use as a replacement /// or alternative for SMB close. - /// + /// /// For more information, see . /// /// @@ -1036,7 +1043,7 @@ public virtual Response ForceCloseHandles( /// /// A will be thrown if /// a failure occurs. - /// + /// public virtual async Task> ForceCloseHandlesAsync( string handleId = Constants.CloseAllHandles, string marker = default, @@ -1051,17 +1058,17 @@ await this.ForceCloseHandlesInternal( .ConfigureAwait(false); /// - /// The operation closes a handle or handles opened on a directory - /// or a file at the service. It supports closing a single handle specified by on a file or - /// directory or closing all handles opened on that resource. It optionally supports recursively closing + /// The operation closes a handle or handles opened on a directory + /// or a file at the service. It supports closing a single handle specified by on a file or + /// directory or closing all handles opened on that resource. It optionally supports recursively closing /// handles on subresources when the resource is a directory. - /// - /// This API is intended to be used alongside to force close handles that - /// block operations, such as renaming a directory. These handles may have leaked or been lost track of by - /// SMB clients. The API has client-side impact on the handle being closed, including user visible - /// errors due to failed attempts to read or write files. This API is not intended for use as a replacement + /// + /// This API is intended to be used alongside to force close handles that + /// block operations, such as renaming a directory. These handles may have leaked or been lost track of by + /// SMB clients. The API has client-side impact on the handle being closed, including user visible + /// errors due to failed attempts to read or write files. This API is not intended for use as a replacement /// or alternative for SMB close. - /// + /// /// For more information, see . /// /// @@ -1093,7 +1100,7 @@ await this.ForceCloseHandlesInternal( /// /// A will be thrown if /// a failure occurs. - /// + /// private async Task> ForceCloseHandlesInternal( string handleId, string marker, @@ -1121,6 +1128,7 @@ private async Task> ForceCloseHandlesInter handleId: handleId, recursive: recursive, async: async, + operationName: "Azure.Storage.Files.DirectoryClient.ForceCloseHandles", cancellationToken: cancellationToken) .ConfigureAwait(false); } @@ -1141,7 +1149,7 @@ private async Task> ForceCloseHandlesInter /// /// The operation creates a new /// subdirectory under this directory. - /// + /// /// For more information, see . /// /// The name of the subdirectory. @@ -1160,6 +1168,7 @@ private async Task> ForceCloseHandlesInter /// A will be thrown if /// a failure occurs. /// + [ForwardsClientCalls] public virtual Response CreateSubdirectory( string subdirectoryName, Metadata metadata = default, @@ -1173,7 +1182,7 @@ public virtual Response CreateSubdirectory( /// /// The operation creates a new /// subdirectory under this directory. - /// + /// /// For more information, see . /// /// The name of the subdirectory. @@ -1192,6 +1201,7 @@ public virtual Response CreateSubdirectory( /// A will be thrown if /// a failure occurs. /// + [ForwardsClientCalls] public virtual async Task> CreateSubdirectoryAsync( string subdirectoryName, Metadata metadata = default, @@ -1207,7 +1217,7 @@ public virtual async Task> CreateSubdirectoryAsync( /// /// The operation removes the /// specified empty subdirectory. - /// + /// /// For more information, see . /// /// The name of the subdirectory. @@ -1221,6 +1231,7 @@ public virtual async Task> CreateSubdirectoryAsync( /// /// Note that the directory must be empty before it can be deleted. /// + [ForwardsClientCalls] public virtual Response DeleteSubdirectory( string subdirectoryName, CancellationToken cancellationToken = default) => @@ -1229,7 +1240,7 @@ public virtual Response DeleteSubdirectory( /// /// The operation removes the /// specified empty subdirectory. - /// + /// /// For more information, see . /// /// The name of the subdirectory. @@ -1243,6 +1254,7 @@ public virtual Response DeleteSubdirectory( /// /// Note that the directory must be empty before it can be deleted. /// + [ForwardsClientCalls] public virtual async Task DeleteSubdirectoryAsync( string subdirectoryName, CancellationToken cancellationToken = default) => @@ -1282,6 +1294,7 @@ await this.GetSubdirectoryClient(subdirectoryName) /// A will be thrown if /// a failure occurs. /// + [ForwardsClientCalls] public virtual Response CreateFile( string fileName, long maxSize, @@ -1324,6 +1337,7 @@ public virtual Response CreateFile( /// A will be thrown if /// a failure occurs. /// + [ForwardsClientCalls] public virtual async Task> CreateFileAsync( string fileName, long maxSize, @@ -1356,6 +1370,7 @@ public virtual async Task> CreateFileAsync( /// A will be thrown if /// a failure occurs. /// + [ForwardsClientCalls] public virtual Response DeleteFile( string fileName, CancellationToken cancellationToken = default) => @@ -1379,6 +1394,7 @@ public virtual Response DeleteFile( /// A will be thrown if /// a failure occurs. /// + [ForwardsClientCalls] public virtual async Task DeleteFileAsync( string fileName, CancellationToken cancellationToken = default) => diff --git a/sdk/storage/Azure.Storage.Files/src/FileClient.cs b/sdk/storage/Azure.Storage.Files/src/FileClient.cs index 6345a6f176679..0052313a5b090 100644 --- a/sdk/storage/Azure.Storage.Files/src/FileClient.cs +++ b/sdk/storage/Azure.Storage.Files/src/FileClient.cs @@ -1228,6 +1228,7 @@ private async Task> SetHttpHeadersInternal( fileContentHash: httpHeaders?.ContentHash, fileContentDisposition: httpHeaders?.ContentDisposition, async: async, + operationName: "Azure.Storage.Files.FileClient.SetHttpHeaders", cancellationToken: cancellationToken) .ConfigureAwait(false); } diff --git a/sdk/storage/Azure.Storage.Files/src/FileServiceClient.cs b/sdk/storage/Azure.Storage.Files/src/FileServiceClient.cs index 85be4d69c9f78..1be34600ee3c7 100644 --- a/sdk/storage/Azure.Storage.Files/src/FileServiceClient.cs +++ b/sdk/storage/Azure.Storage.Files/src/FileServiceClient.cs @@ -7,6 +7,7 @@ using System.Linq; using System.Threading; using System.Threading.Tasks; +using Azure.Core; using Azure.Core.Pipeline; using Azure.Storage.Common; using Azure.Storage.Files.Models; @@ -412,6 +413,7 @@ private async Task> GetPropertiesInternal( this.Pipeline, this.Uri, async: async, + operationName: "Azure.Storage.Files.FileServiceClient.GetProperties", cancellationToken: cancellationToken) .ConfigureAwait(false); } @@ -533,6 +535,7 @@ private async Task SetPropertiesInternal( this.Uri, properties: properties, async: async, + operationName: "Azure.Storage.Files.FileServiceClient.SetProperties", cancellationToken: cancellationToken) .ConfigureAwait(false); } @@ -578,6 +581,7 @@ private async Task SetPropertiesInternal( /// A will be thrown if /// a failure occurs. /// + [ForwardsClientCalls] public virtual Response CreateShare( string shareName, IDictionary metadata = default, @@ -617,6 +621,7 @@ public virtual Response CreateShare( /// A will be thrown if /// a failure occurs. /// + [ForwardsClientCalls] public virtual async Task> CreateShareAsync( string shareName, IDictionary metadata = default, @@ -652,6 +657,7 @@ public virtual async Task> CreateShareAsync( /// A will be thrown if /// a failure occurs. /// + [ForwardsClientCalls] public virtual Response DeleteShare( string shareName, CancellationToken cancellationToken = default) => @@ -679,6 +685,7 @@ public virtual Response DeleteShare( /// A will be thrown if /// a failure occurs. /// + [ForwardsClientCalls] public virtual async Task DeleteShareAsync( string shareName, CancellationToken cancellationToken = default) => diff --git a/sdk/storage/Azure.Storage.Files/src/Generated/FileRestClient.cs b/sdk/storage/Azure.Storage.Files/src/Generated/FileRestClient.cs index 7140de7428f23..80f30e5eb5037 100644 --- a/sdk/storage/Azure.Storage.Files/src/Generated/FileRestClient.cs +++ b/sdk/storage/Azure.Storage.Files/src/Generated/FileRestClient.cs @@ -27,6 +27,7 @@ public static partial class Service /// The StorageService properties. /// The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for File Service Operations. /// Whether to invoke the operation asynchronously. The default value is true. + /// Operation name. /// Cancellation token. /// Azure.Response public static async System.Threading.Tasks.Task SetPropertiesAsync( @@ -35,22 +36,38 @@ public static partial class Service Azure.Storage.Files.Models.FileServiceProperties properties, int? timeout = default, bool async = true, + string operationName = "Azure.Storage.Files.ServiceClient.SetProperties", System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.Request _request = SetPropertiesAsync_CreateRequest( - pipeline, - resourceUri, - properties, - timeout)) + Azure.Core.Pipeline.DiagnosticScope _scope = pipeline.Diagnostics.CreateScope(operationName); + try { - Azure.Response _response = async ? - // Send the request asynchronously if we're being called via an async path - await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : - // Send the request synchronously through the API that blocks if we're being called via a sync path - // (this is safe because the Task will complete before the user can call Wait) - pipeline.SendRequest(_request, cancellationToken); - cancellationToken.ThrowIfCancellationRequested(); - return SetPropertiesAsync_CreateResponse(_response); + _scope.AddAttribute("url", resourceUri); + _scope.Start(); + using (Azure.Core.Http.Request _request = SetPropertiesAsync_CreateRequest( + pipeline, + resourceUri, + properties, + timeout)) + { + Azure.Response _response = async ? + // Send the request asynchronously if we're being called via an async path + await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : + // Send the request synchronously through the API that blocks if we're being called via a sync path + // (this is safe because the Task will complete before the user can call Wait) + pipeline.SendRequest(_request, cancellationToken); + cancellationToken.ThrowIfCancellationRequested(); + return SetPropertiesAsync_CreateResponse(_response); + } + } + catch (System.Exception ex) + { + _scope.Failed(ex); + throw; + } + finally + { + _scope.Dispose(); } } @@ -136,6 +153,7 @@ internal static Azure.Response SetPropertiesAsync_CreateResponse( /// The URL of the service account, share, directory or file that is the target of the desired operation. /// The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for File Service Operations. /// Whether to invoke the operation asynchronously. The default value is true. + /// Operation name. /// Cancellation token. /// Storage service properties. public static async System.Threading.Tasks.Task> GetPropertiesAsync( @@ -143,21 +161,37 @@ internal static Azure.Response SetPropertiesAsync_CreateResponse( System.Uri resourceUri, int? timeout = default, bool async = true, + string operationName = "Azure.Storage.Files.ServiceClient.GetProperties", System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.Request _request = GetPropertiesAsync_CreateRequest( - pipeline, - resourceUri, - timeout)) + Azure.Core.Pipeline.DiagnosticScope _scope = pipeline.Diagnostics.CreateScope(operationName); + try + { + _scope.AddAttribute("url", resourceUri); + _scope.Start(); + using (Azure.Core.Http.Request _request = GetPropertiesAsync_CreateRequest( + pipeline, + resourceUri, + timeout)) + { + Azure.Response _response = async ? + // Send the request asynchronously if we're being called via an async path + await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : + // Send the request synchronously through the API that blocks if we're being called via a sync path + // (this is safe because the Task will complete before the user can call Wait) + pipeline.SendRequest(_request, cancellationToken); + cancellationToken.ThrowIfCancellationRequested(); + return GetPropertiesAsync_CreateResponse(_response); + } + } + catch (System.Exception ex) + { + _scope.Failed(ex); + throw; + } + finally { - Azure.Response _response = async ? - // Send the request asynchronously if we're being called via an async path - await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : - // Send the request synchronously through the API that blocks if we're being called via a sync path - // (this is safe because the Task will complete before the user can call Wait) - pipeline.SendRequest(_request, cancellationToken); - cancellationToken.ThrowIfCancellationRequested(); - return GetPropertiesAsync_CreateResponse(_response); + _scope.Dispose(); } } @@ -244,6 +278,7 @@ internal static Azure.Core.Http.Request GetPropertiesAsync_CreateRequest( /// Include this parameter to specify one or more datasets to include in the response. /// The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for File Service Operations. /// Whether to invoke the operation asynchronously. The default value is true. + /// Operation name. /// Cancellation token. /// An enumeration of shares. public static async System.Threading.Tasks.Task> ListSharesSegmentAsync( @@ -255,25 +290,41 @@ internal static Azure.Core.Http.Request GetPropertiesAsync_CreateRequest( System.Collections.Generic.IEnumerable include = default, int? timeout = default, bool async = true, + string operationName = "Azure.Storage.Files.ServiceClient.ListSharesSegment", System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.Request _request = ListSharesSegmentAsync_CreateRequest( - pipeline, - resourceUri, - prefix, - marker, - maxresults, - include, - timeout)) + Azure.Core.Pipeline.DiagnosticScope _scope = pipeline.Diagnostics.CreateScope(operationName); + try { - Azure.Response _response = async ? - // Send the request asynchronously if we're being called via an async path - await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : - // Send the request synchronously through the API that blocks if we're being called via a sync path - // (this is safe because the Task will complete before the user can call Wait) - pipeline.SendRequest(_request, cancellationToken); - cancellationToken.ThrowIfCancellationRequested(); - return ListSharesSegmentAsync_CreateResponse(_response); + _scope.AddAttribute("url", resourceUri); + _scope.Start(); + using (Azure.Core.Http.Request _request = ListSharesSegmentAsync_CreateRequest( + pipeline, + resourceUri, + prefix, + marker, + maxresults, + include, + timeout)) + { + Azure.Response _response = async ? + // Send the request asynchronously if we're being called via an async path + await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : + // Send the request synchronously through the API that blocks if we're being called via a sync path + // (this is safe because the Task will complete before the user can call Wait) + pipeline.SendRequest(_request, cancellationToken); + cancellationToken.ThrowIfCancellationRequested(); + return ListSharesSegmentAsync_CreateResponse(_response); + } + } + catch (System.Exception ex) + { + _scope.Failed(ex); + throw; + } + finally + { + _scope.Dispose(); } } @@ -377,6 +428,7 @@ public static partial class Share /// A name-value pair to associate with a file storage object. /// Specifies the maximum size of the share, in gigabytes. /// Whether to invoke the operation asynchronously. The default value is true. + /// Operation name. /// Cancellation token. /// Azure.Response{Azure.Storage.Files.Models.ShareInfo} public static async System.Threading.Tasks.Task> CreateAsync( @@ -386,23 +438,39 @@ public static partial class Share System.Collections.Generic.IDictionary metadata = default, int? quota = default, bool async = true, + string operationName = "Azure.Storage.Files.ShareClient.Create", System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.Request _request = CreateAsync_CreateRequest( - pipeline, - resourceUri, - timeout, - metadata, - quota)) + Azure.Core.Pipeline.DiagnosticScope _scope = pipeline.Diagnostics.CreateScope(operationName); + try + { + _scope.AddAttribute("url", resourceUri); + _scope.Start(); + using (Azure.Core.Http.Request _request = CreateAsync_CreateRequest( + pipeline, + resourceUri, + timeout, + metadata, + quota)) + { + Azure.Response _response = async ? + // Send the request asynchronously if we're being called via an async path + await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : + // Send the request synchronously through the API that blocks if we're being called via a sync path + // (this is safe because the Task will complete before the user can call Wait) + pipeline.SendRequest(_request, cancellationToken); + cancellationToken.ThrowIfCancellationRequested(); + return CreateAsync_CreateResponse(_response); + } + } + catch (System.Exception ex) + { + _scope.Failed(ex); + throw; + } + finally { - Azure.Response _response = async ? - // Send the request asynchronously if we're being called via an async path - await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : - // Send the request synchronously through the API that blocks if we're being called via a sync path - // (this is safe because the Task will complete before the user can call Wait) - pipeline.SendRequest(_request, cancellationToken); - cancellationToken.ThrowIfCancellationRequested(); - return CreateAsync_CreateResponse(_response); + _scope.Dispose(); } } @@ -506,6 +574,7 @@ internal static Azure.Core.Http.Request CreateAsync_CreateRequest( /// The snapshot parameter is an opaque DateTime value that, when present, specifies the share snapshot to query. /// The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for File Service Operations. /// Whether to invoke the operation asynchronously. The default value is true. + /// Operation name. /// Cancellation token. /// Azure.Response{Azure.Storage.Files.Models.ShareProperties} public static async System.Threading.Tasks.Task> GetPropertiesAsync( @@ -514,22 +583,38 @@ internal static Azure.Core.Http.Request CreateAsync_CreateRequest( string sharesnapshot = default, int? timeout = default, bool async = true, + string operationName = "Azure.Storage.Files.ShareClient.GetProperties", System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.Request _request = GetPropertiesAsync_CreateRequest( - pipeline, - resourceUri, - sharesnapshot, - timeout)) + Azure.Core.Pipeline.DiagnosticScope _scope = pipeline.Diagnostics.CreateScope(operationName); + try { - Azure.Response _response = async ? - // Send the request asynchronously if we're being called via an async path - await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : - // Send the request synchronously through the API that blocks if we're being called via a sync path - // (this is safe because the Task will complete before the user can call Wait) - pipeline.SendRequest(_request, cancellationToken); - cancellationToken.ThrowIfCancellationRequested(); - return GetPropertiesAsync_CreateResponse(_response); + _scope.AddAttribute("url", resourceUri); + _scope.Start(); + using (Azure.Core.Http.Request _request = GetPropertiesAsync_CreateRequest( + pipeline, + resourceUri, + sharesnapshot, + timeout)) + { + Azure.Response _response = async ? + // Send the request asynchronously if we're being called via an async path + await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : + // Send the request synchronously through the API that blocks if we're being called via a sync path + // (this is safe because the Task will complete before the user can call Wait) + pipeline.SendRequest(_request, cancellationToken); + cancellationToken.ThrowIfCancellationRequested(); + return GetPropertiesAsync_CreateResponse(_response); + } + } + catch (System.Exception ex) + { + _scope.Failed(ex); + throw; + } + finally + { + _scope.Dispose(); } } @@ -638,6 +723,7 @@ internal static Azure.Core.Http.Request GetPropertiesAsync_CreateRequest( /// The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for File Service Operations. /// Specifies the option include to delete the base share and all of its snapshots. /// Whether to invoke the operation asynchronously. The default value is true. + /// Operation name. /// Cancellation token. /// Azure.Response public static async System.Threading.Tasks.Task DeleteAsync( @@ -647,23 +733,39 @@ internal static Azure.Core.Http.Request GetPropertiesAsync_CreateRequest( int? timeout = default, Azure.Storage.Files.Models.DeleteSnapshotsOptionType? deleteSnapshots = default, bool async = true, + string operationName = "Azure.Storage.Files.ShareClient.Delete", System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.Request _request = DeleteAsync_CreateRequest( - pipeline, - resourceUri, - sharesnapshot, - timeout, - deleteSnapshots)) + Azure.Core.Pipeline.DiagnosticScope _scope = pipeline.Diagnostics.CreateScope(operationName); + try + { + _scope.AddAttribute("url", resourceUri); + _scope.Start(); + using (Azure.Core.Http.Request _request = DeleteAsync_CreateRequest( + pipeline, + resourceUri, + sharesnapshot, + timeout, + deleteSnapshots)) + { + Azure.Response _response = async ? + // Send the request asynchronously if we're being called via an async path + await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : + // Send the request synchronously through the API that blocks if we're being called via a sync path + // (this is safe because the Task will complete before the user can call Wait) + pipeline.SendRequest(_request, cancellationToken); + cancellationToken.ThrowIfCancellationRequested(); + return DeleteAsync_CreateResponse(_response); + } + } + catch (System.Exception ex) + { + _scope.Failed(ex); + throw; + } + finally { - Azure.Response _response = async ? - // Send the request asynchronously if we're being called via an async path - await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : - // Send the request synchronously through the API that blocks if we're being called via a sync path - // (this is safe because the Task will complete before the user can call Wait) - pipeline.SendRequest(_request, cancellationToken); - cancellationToken.ThrowIfCancellationRequested(); - return DeleteAsync_CreateResponse(_response); + _scope.Dispose(); } } @@ -742,6 +844,7 @@ internal static Azure.Response DeleteAsync_CreateResponse( /// The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for File Service Operations. /// A name-value pair to associate with a file storage object. /// Whether to invoke the operation asynchronously. The default value is true. + /// Operation name. /// Cancellation token. /// Azure.Response{Azure.Storage.Files.Models.ShareSnapshotInfo} public static async System.Threading.Tasks.Task> CreateSnapshotAsync( @@ -750,22 +853,38 @@ internal static Azure.Response DeleteAsync_CreateResponse( int? timeout = default, System.Collections.Generic.IDictionary metadata = default, bool async = true, + string operationName = "Azure.Storage.Files.ShareClient.CreateSnapshot", System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.Request _request = CreateSnapshotAsync_CreateRequest( - pipeline, - resourceUri, - timeout, - metadata)) + Azure.Core.Pipeline.DiagnosticScope _scope = pipeline.Diagnostics.CreateScope(operationName); + try { - Azure.Response _response = async ? - // Send the request asynchronously if we're being called via an async path - await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : - // Send the request synchronously through the API that blocks if we're being called via a sync path - // (this is safe because the Task will complete before the user can call Wait) - pipeline.SendRequest(_request, cancellationToken); - cancellationToken.ThrowIfCancellationRequested(); - return CreateSnapshotAsync_CreateResponse(_response); + _scope.AddAttribute("url", resourceUri); + _scope.Start(); + using (Azure.Core.Http.Request _request = CreateSnapshotAsync_CreateRequest( + pipeline, + resourceUri, + timeout, + metadata)) + { + Azure.Response _response = async ? + // Send the request asynchronously if we're being called via an async path + await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : + // Send the request synchronously through the API that blocks if we're being called via a sync path + // (this is safe because the Task will complete before the user can call Wait) + pipeline.SendRequest(_request, cancellationToken); + cancellationToken.ThrowIfCancellationRequested(); + return CreateSnapshotAsync_CreateResponse(_response); + } + } + catch (System.Exception ex) + { + _scope.Failed(ex); + throw; + } + finally + { + _scope.Dispose(); } } @@ -871,6 +990,7 @@ internal static Azure.Core.Http.Request CreateSnapshotAsync_CreateRequest( /// The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for File Service Operations. /// Specifies the maximum size of the share, in gigabytes. /// Whether to invoke the operation asynchronously. The default value is true. + /// Operation name. /// Cancellation token. /// Azure.Response{Azure.Storage.Files.Models.ShareInfo} public static async System.Threading.Tasks.Task> SetQuotaAsync( @@ -879,22 +999,38 @@ internal static Azure.Core.Http.Request CreateSnapshotAsync_CreateRequest( int? timeout = default, int? quota = default, bool async = true, + string operationName = "Azure.Storage.Files.ShareClient.SetQuota", System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.Request _request = SetQuotaAsync_CreateRequest( - pipeline, - resourceUri, - timeout, - quota)) + Azure.Core.Pipeline.DiagnosticScope _scope = pipeline.Diagnostics.CreateScope(operationName); + try + { + _scope.AddAttribute("url", resourceUri); + _scope.Start(); + using (Azure.Core.Http.Request _request = SetQuotaAsync_CreateRequest( + pipeline, + resourceUri, + timeout, + quota)) + { + Azure.Response _response = async ? + // Send the request asynchronously if we're being called via an async path + await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : + // Send the request synchronously through the API that blocks if we're being called via a sync path + // (this is safe because the Task will complete before the user can call Wait) + pipeline.SendRequest(_request, cancellationToken); + cancellationToken.ThrowIfCancellationRequested(); + return SetQuotaAsync_CreateResponse(_response); + } + } + catch (System.Exception ex) + { + _scope.Failed(ex); + throw; + } + finally { - Azure.Response _response = async ? - // Send the request asynchronously if we're being called via an async path - await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : - // Send the request synchronously through the API that blocks if we're being called via a sync path - // (this is safe because the Task will complete before the user can call Wait) - pipeline.SendRequest(_request, cancellationToken); - cancellationToken.ThrowIfCancellationRequested(); - return SetQuotaAsync_CreateResponse(_response); + _scope.Dispose(); } } @@ -991,6 +1127,7 @@ internal static Azure.Core.Http.Request SetQuotaAsync_CreateRequest( /// The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for File Service Operations. /// A name-value pair to associate with a file storage object. /// Whether to invoke the operation asynchronously. The default value is true. + /// Operation name. /// Cancellation token. /// Azure.Response{Azure.Storage.Files.Models.ShareInfo} public static async System.Threading.Tasks.Task> SetMetadataAsync( @@ -999,22 +1136,38 @@ internal static Azure.Core.Http.Request SetQuotaAsync_CreateRequest( int? timeout = default, System.Collections.Generic.IDictionary metadata = default, bool async = true, + string operationName = "Azure.Storage.Files.ShareClient.SetMetadata", System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.Request _request = SetMetadataAsync_CreateRequest( - pipeline, - resourceUri, - timeout, - metadata)) + Azure.Core.Pipeline.DiagnosticScope _scope = pipeline.Diagnostics.CreateScope(operationName); + try { - Azure.Response _response = async ? - // Send the request asynchronously if we're being called via an async path - await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : - // Send the request synchronously through the API that blocks if we're being called via a sync path - // (this is safe because the Task will complete before the user can call Wait) - pipeline.SendRequest(_request, cancellationToken); - cancellationToken.ThrowIfCancellationRequested(); - return SetMetadataAsync_CreateResponse(_response); + _scope.AddAttribute("url", resourceUri); + _scope.Start(); + using (Azure.Core.Http.Request _request = SetMetadataAsync_CreateRequest( + pipeline, + resourceUri, + timeout, + metadata)) + { + Azure.Response _response = async ? + // Send the request asynchronously if we're being called via an async path + await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : + // Send the request synchronously through the API that blocks if we're being called via a sync path + // (this is safe because the Task will complete before the user can call Wait) + pipeline.SendRequest(_request, cancellationToken); + cancellationToken.ThrowIfCancellationRequested(); + return SetMetadataAsync_CreateResponse(_response); + } + } + catch (System.Exception ex) + { + _scope.Failed(ex); + throw; + } + finally + { + _scope.Dispose(); } } @@ -1115,6 +1268,7 @@ internal static Azure.Core.Http.Request SetMetadataAsync_CreateRequest( /// The URL of the service account, share, directory or file that is the target of the desired operation. /// The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for File Service Operations. /// Whether to invoke the operation asynchronously. The default value is true. + /// Operation name. /// Cancellation token. /// A collection of signed identifiers. public static async System.Threading.Tasks.Task>> GetAccessPolicyAsync( @@ -1122,21 +1276,37 @@ internal static Azure.Core.Http.Request SetMetadataAsync_CreateRequest( System.Uri resourceUri, int? timeout = default, bool async = true, + string operationName = "Azure.Storage.Files.ShareClient.GetAccessPolicy", System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.Request _request = GetAccessPolicyAsync_CreateRequest( - pipeline, - resourceUri, - timeout)) + Azure.Core.Pipeline.DiagnosticScope _scope = pipeline.Diagnostics.CreateScope(operationName); + try + { + _scope.AddAttribute("url", resourceUri); + _scope.Start(); + using (Azure.Core.Http.Request _request = GetAccessPolicyAsync_CreateRequest( + pipeline, + resourceUri, + timeout)) + { + Azure.Response _response = async ? + // Send the request asynchronously if we're being called via an async path + await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : + // Send the request synchronously through the API that blocks if we're being called via a sync path + // (this is safe because the Task will complete before the user can call Wait) + pipeline.SendRequest(_request, cancellationToken); + cancellationToken.ThrowIfCancellationRequested(); + return GetAccessPolicyAsync_CreateResponse(_response); + } + } + catch (System.Exception ex) + { + _scope.Failed(ex); + throw; + } + finally { - Azure.Response _response = async ? - // Send the request asynchronously if we're being called via an async path - await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : - // Send the request synchronously through the API that blocks if we're being called via a sync path - // (this is safe because the Task will complete before the user can call Wait) - pipeline.SendRequest(_request, cancellationToken); - cancellationToken.ThrowIfCancellationRequested(); - return GetAccessPolicyAsync_CreateResponse(_response); + _scope.Dispose(); } } @@ -1224,6 +1394,7 @@ internal static Azure.Core.Http.Request GetAccessPolicyAsync_CreateRequest( /// The ACL for the share. /// The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for File Service Operations. /// Whether to invoke the operation asynchronously. The default value is true. + /// Operation name. /// Cancellation token. /// Azure.Response{Azure.Storage.Files.Models.ShareInfo} public static async System.Threading.Tasks.Task> SetAccessPolicyAsync( @@ -1232,22 +1403,38 @@ internal static Azure.Core.Http.Request GetAccessPolicyAsync_CreateRequest( System.Collections.Generic.IEnumerable permissions = default, int? timeout = default, bool async = true, + string operationName = "Azure.Storage.Files.ShareClient.SetAccessPolicy", System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.Request _request = SetAccessPolicyAsync_CreateRequest( - pipeline, - resourceUri, - permissions, - timeout)) + Azure.Core.Pipeline.DiagnosticScope _scope = pipeline.Diagnostics.CreateScope(operationName); + try { - Azure.Response _response = async ? - // Send the request asynchronously if we're being called via an async path - await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : - // Send the request synchronously through the API that blocks if we're being called via a sync path - // (this is safe because the Task will complete before the user can call Wait) - pipeline.SendRequest(_request, cancellationToken); - cancellationToken.ThrowIfCancellationRequested(); - return SetAccessPolicyAsync_CreateResponse(_response); + _scope.AddAttribute("url", resourceUri); + _scope.Start(); + using (Azure.Core.Http.Request _request = SetAccessPolicyAsync_CreateRequest( + pipeline, + resourceUri, + permissions, + timeout)) + { + Azure.Response _response = async ? + // Send the request asynchronously if we're being called via an async path + await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : + // Send the request synchronously through the API that blocks if we're being called via a sync path + // (this is safe because the Task will complete before the user can call Wait) + pipeline.SendRequest(_request, cancellationToken); + cancellationToken.ThrowIfCancellationRequested(); + return SetAccessPolicyAsync_CreateResponse(_response); + } + } + catch (System.Exception ex) + { + _scope.Failed(ex); + throw; + } + finally + { + _scope.Dispose(); } } @@ -1356,6 +1543,7 @@ internal static Azure.Core.Http.Request SetAccessPolicyAsync_CreateRequest( /// The URL of the service account, share, directory or file that is the target of the desired operation. /// The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for File Service Operations. /// Whether to invoke the operation asynchronously. The default value is true. + /// Operation name. /// Cancellation token. /// Stats for the share. public static async System.Threading.Tasks.Task> GetStatisticsAsync( @@ -1363,21 +1551,37 @@ internal static Azure.Core.Http.Request SetAccessPolicyAsync_CreateRequest( System.Uri resourceUri, int? timeout = default, bool async = true, + string operationName = "Azure.Storage.Files.ShareClient.GetStatistics", System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.Request _request = GetStatisticsAsync_CreateRequest( - pipeline, - resourceUri, - timeout)) + Azure.Core.Pipeline.DiagnosticScope _scope = pipeline.Diagnostics.CreateScope(operationName); + try + { + _scope.AddAttribute("url", resourceUri); + _scope.Start(); + using (Azure.Core.Http.Request _request = GetStatisticsAsync_CreateRequest( + pipeline, + resourceUri, + timeout)) + { + Azure.Response _response = async ? + // Send the request asynchronously if we're being called via an async path + await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : + // Send the request synchronously through the API that blocks if we're being called via a sync path + // (this is safe because the Task will complete before the user can call Wait) + pipeline.SendRequest(_request, cancellationToken); + cancellationToken.ThrowIfCancellationRequested(); + return GetStatisticsAsync_CreateResponse(_response); + } + } + catch (System.Exception ex) + { + _scope.Failed(ex); + throw; + } + finally { - Azure.Response _response = async ? - // Send the request asynchronously if we're being called via an async path - await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : - // Send the request synchronously through the API that blocks if we're being called via a sync path - // (this is safe because the Task will complete before the user can call Wait) - pipeline.SendRequest(_request, cancellationToken); - cancellationToken.ThrowIfCancellationRequested(); - return GetStatisticsAsync_CreateResponse(_response); + _scope.Dispose(); } } @@ -1469,6 +1673,7 @@ public static partial class Directory /// The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for File Service Operations. /// A name-value pair to associate with a file storage object. /// Whether to invoke the operation asynchronously. The default value is true. + /// Operation name. /// Cancellation token. /// Azure.Response{Azure.Storage.Files.Models.StorageDirectoryInfo} public static async System.Threading.Tasks.Task> CreateAsync( @@ -1477,22 +1682,38 @@ public static partial class Directory int? timeout = default, System.Collections.Generic.IDictionary metadata = default, bool async = true, + string operationName = "Azure.Storage.Files.DirectoryClient.Create", System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.Request _request = CreateAsync_CreateRequest( - pipeline, - resourceUri, - timeout, - metadata)) + Azure.Core.Pipeline.DiagnosticScope _scope = pipeline.Diagnostics.CreateScope(operationName); + try { - Azure.Response _response = async ? - // Send the request asynchronously if we're being called via an async path - await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : - // Send the request synchronously through the API that blocks if we're being called via a sync path - // (this is safe because the Task will complete before the user can call Wait) - pipeline.SendRequest(_request, cancellationToken); - cancellationToken.ThrowIfCancellationRequested(); - return CreateAsync_CreateResponse(_response); + _scope.AddAttribute("url", resourceUri); + _scope.Start(); + using (Azure.Core.Http.Request _request = CreateAsync_CreateRequest( + pipeline, + resourceUri, + timeout, + metadata)) + { + Azure.Response _response = async ? + // Send the request asynchronously if we're being called via an async path + await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : + // Send the request synchronously through the API that blocks if we're being called via a sync path + // (this is safe because the Task will complete before the user can call Wait) + pipeline.SendRequest(_request, cancellationToken); + cancellationToken.ThrowIfCancellationRequested(); + return CreateAsync_CreateResponse(_response); + } + } + catch (System.Exception ex) + { + _scope.Failed(ex); + throw; + } + finally + { + _scope.Dispose(); } } @@ -1593,6 +1814,7 @@ internal static Azure.Core.Http.Request CreateAsync_CreateRequest( /// The snapshot parameter is an opaque DateTime value that, when present, specifies the share snapshot to query. /// The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for File Service Operations. /// Whether to invoke the operation asynchronously. The default value is true. + /// Operation name. /// Cancellation token. /// Azure.Response{Azure.Storage.Files.Models.StorageDirectoryProperties} public static async System.Threading.Tasks.Task> GetPropertiesAsync( @@ -1601,22 +1823,38 @@ internal static Azure.Core.Http.Request CreateAsync_CreateRequest( string sharesnapshot = default, int? timeout = default, bool async = true, + string operationName = "Azure.Storage.Files.DirectoryClient.GetProperties", System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.Request _request = GetPropertiesAsync_CreateRequest( - pipeline, - resourceUri, - sharesnapshot, - timeout)) + Azure.Core.Pipeline.DiagnosticScope _scope = pipeline.Diagnostics.CreateScope(operationName); + try + { + _scope.AddAttribute("url", resourceUri); + _scope.Start(); + using (Azure.Core.Http.Request _request = GetPropertiesAsync_CreateRequest( + pipeline, + resourceUri, + sharesnapshot, + timeout)) + { + Azure.Response _response = async ? + // Send the request asynchronously if we're being called via an async path + await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : + // Send the request synchronously through the API that blocks if we're being called via a sync path + // (this is safe because the Task will complete before the user can call Wait) + pipeline.SendRequest(_request, cancellationToken); + cancellationToken.ThrowIfCancellationRequested(); + return GetPropertiesAsync_CreateResponse(_response); + } + } + catch (System.Exception ex) + { + _scope.Failed(ex); + throw; + } + finally { - Azure.Response _response = async ? - // Send the request asynchronously if we're being called via an async path - await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : - // Send the request synchronously through the API that blocks if we're being called via a sync path - // (this is safe because the Task will complete before the user can call Wait) - pipeline.SendRequest(_request, cancellationToken); - cancellationToken.ThrowIfCancellationRequested(); - return GetPropertiesAsync_CreateResponse(_response); + _scope.Dispose(); } } @@ -1723,6 +1961,7 @@ internal static Azure.Core.Http.Request GetPropertiesAsync_CreateRequest( /// The URL of the service account, share, directory or file that is the target of the desired operation. /// The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for File Service Operations. /// Whether to invoke the operation asynchronously. The default value is true. + /// Operation name. /// Cancellation token. /// Azure.Response public static async System.Threading.Tasks.Task DeleteAsync( @@ -1730,21 +1969,37 @@ internal static Azure.Core.Http.Request GetPropertiesAsync_CreateRequest( System.Uri resourceUri, int? timeout = default, bool async = true, + string operationName = "Azure.Storage.Files.DirectoryClient.Delete", System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.Request _request = DeleteAsync_CreateRequest( - pipeline, - resourceUri, - timeout)) + Azure.Core.Pipeline.DiagnosticScope _scope = pipeline.Diagnostics.CreateScope(operationName); + try { - Azure.Response _response = async ? - // Send the request asynchronously if we're being called via an async path - await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : - // Send the request synchronously through the API that blocks if we're being called via a sync path - // (this is safe because the Task will complete before the user can call Wait) - pipeline.SendRequest(_request, cancellationToken); - cancellationToken.ThrowIfCancellationRequested(); - return DeleteAsync_CreateResponse(_response); + _scope.AddAttribute("url", resourceUri); + _scope.Start(); + using (Azure.Core.Http.Request _request = DeleteAsync_CreateRequest( + pipeline, + resourceUri, + timeout)) + { + Azure.Response _response = async ? + // Send the request asynchronously if we're being called via an async path + await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : + // Send the request synchronously through the API that blocks if we're being called via a sync path + // (this is safe because the Task will complete before the user can call Wait) + pipeline.SendRequest(_request, cancellationToken); + cancellationToken.ThrowIfCancellationRequested(); + return DeleteAsync_CreateResponse(_response); + } + } + catch (System.Exception ex) + { + _scope.Failed(ex); + throw; + } + finally + { + _scope.Dispose(); } } @@ -1817,6 +2072,7 @@ internal static Azure.Response DeleteAsync_CreateResponse( /// The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for File Service Operations. /// A name-value pair to associate with a file storage object. /// Whether to invoke the operation asynchronously. The default value is true. + /// Operation name. /// Cancellation token. /// Azure.Response{Azure.Storage.Files.Models.StorageDirectoryInfo} public static async System.Threading.Tasks.Task> SetMetadataAsync( @@ -1825,22 +2081,38 @@ internal static Azure.Response DeleteAsync_CreateResponse( int? timeout = default, System.Collections.Generic.IDictionary metadata = default, bool async = true, + string operationName = "Azure.Storage.Files.DirectoryClient.SetMetadata", System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.Request _request = SetMetadataAsync_CreateRequest( - pipeline, - resourceUri, - timeout, - metadata)) + Azure.Core.Pipeline.DiagnosticScope _scope = pipeline.Diagnostics.CreateScope(operationName); + try { - Azure.Response _response = async ? - // Send the request asynchronously if we're being called via an async path - await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : - // Send the request synchronously through the API that blocks if we're being called via a sync path - // (this is safe because the Task will complete before the user can call Wait) - pipeline.SendRequest(_request, cancellationToken); - cancellationToken.ThrowIfCancellationRequested(); - return SetMetadataAsync_CreateResponse(_response); + _scope.AddAttribute("url", resourceUri); + _scope.Start(); + using (Azure.Core.Http.Request _request = SetMetadataAsync_CreateRequest( + pipeline, + resourceUri, + timeout, + metadata)) + { + Azure.Response _response = async ? + // Send the request asynchronously if we're being called via an async path + await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : + // Send the request synchronously through the API that blocks if we're being called via a sync path + // (this is safe because the Task will complete before the user can call Wait) + pipeline.SendRequest(_request, cancellationToken); + cancellationToken.ThrowIfCancellationRequested(); + return SetMetadataAsync_CreateResponse(_response); + } + } + catch (System.Exception ex) + { + _scope.Failed(ex); + throw; + } + finally + { + _scope.Dispose(); } } @@ -1945,6 +2217,7 @@ internal static Azure.Core.Http.Request SetMetadataAsync_CreateRequest( /// Specifies the maximum number of entries to return. If the request does not specify maxresults, or specifies a value greater than 5,000, the server will return up to 5,000 items. /// The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for File Service Operations. /// Whether to invoke the operation asynchronously. The default value is true. + /// Operation name. /// Cancellation token. /// An enumeration of directories and files. public static async System.Threading.Tasks.Task> ListFilesAndDirectoriesSegmentAsync( @@ -1956,25 +2229,41 @@ internal static Azure.Core.Http.Request SetMetadataAsync_CreateRequest( int? maxresults = default, int? timeout = default, bool async = true, + string operationName = "Azure.Storage.Files.DirectoryClient.ListFilesAndDirectoriesSegment", System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.Request _request = ListFilesAndDirectoriesSegmentAsync_CreateRequest( - pipeline, - resourceUri, - prefix, - sharesnapshot, - marker, - maxresults, - timeout)) + Azure.Core.Pipeline.DiagnosticScope _scope = pipeline.Diagnostics.CreateScope(operationName); + try + { + _scope.AddAttribute("url", resourceUri); + _scope.Start(); + using (Azure.Core.Http.Request _request = ListFilesAndDirectoriesSegmentAsync_CreateRequest( + pipeline, + resourceUri, + prefix, + sharesnapshot, + marker, + maxresults, + timeout)) + { + Azure.Response _response = async ? + // Send the request asynchronously if we're being called via an async path + await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : + // Send the request synchronously through the API that blocks if we're being called via a sync path + // (this is safe because the Task will complete before the user can call Wait) + pipeline.SendRequest(_request, cancellationToken); + cancellationToken.ThrowIfCancellationRequested(); + return ListFilesAndDirectoriesSegmentAsync_CreateResponse(_response); + } + } + catch (System.Exception ex) + { + _scope.Failed(ex); + throw; + } + finally { - Azure.Response _response = async ? - // Send the request asynchronously if we're being called via an async path - await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : - // Send the request synchronously through the API that blocks if we're being called via a sync path - // (this is safe because the Task will complete before the user can call Wait) - pipeline.SendRequest(_request, cancellationToken); - cancellationToken.ThrowIfCancellationRequested(); - return ListFilesAndDirectoriesSegmentAsync_CreateResponse(_response); + _scope.Dispose(); } } @@ -2073,6 +2362,7 @@ internal static Azure.Core.Http.Request ListFilesAndDirectoriesSegmentAsync_Crea /// The snapshot parameter is an opaque DateTime value that, when present, specifies the share snapshot to query. /// Specifies operation should apply to the directory specified in the URI, its files, its subdirectories and their files. /// Whether to invoke the operation asynchronously. The default value is true. + /// Operation name. /// Cancellation token. /// An enumeration of handles. public static async System.Threading.Tasks.Task> ListHandlesAsync( @@ -2084,25 +2374,41 @@ internal static Azure.Core.Http.Request ListFilesAndDirectoriesSegmentAsync_Crea string sharesnapshot = default, bool? recursive = default, bool async = true, + string operationName = "Azure.Storage.Files.DirectoryClient.ListHandles", System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.Request _request = ListHandlesAsync_CreateRequest( - pipeline, - resourceUri, - marker, - maxresults, - timeout, - sharesnapshot, - recursive)) + Azure.Core.Pipeline.DiagnosticScope _scope = pipeline.Diagnostics.CreateScope(operationName); + try + { + _scope.AddAttribute("url", resourceUri); + _scope.Start(); + using (Azure.Core.Http.Request _request = ListHandlesAsync_CreateRequest( + pipeline, + resourceUri, + marker, + maxresults, + timeout, + sharesnapshot, + recursive)) + { + Azure.Response _response = async ? + // Send the request asynchronously if we're being called via an async path + await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : + // Send the request synchronously through the API that blocks if we're being called via a sync path + // (this is safe because the Task will complete before the user can call Wait) + pipeline.SendRequest(_request, cancellationToken); + cancellationToken.ThrowIfCancellationRequested(); + return ListHandlesAsync_CreateResponse(_response); + } + } + catch (System.Exception ex) + { + _scope.Failed(ex); + throw; + } + finally { - Azure.Response _response = async ? - // Send the request asynchronously if we're being called via an async path - await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : - // Send the request synchronously through the API that blocks if we're being called via a sync path - // (this is safe because the Task will complete before the user can call Wait) - pipeline.SendRequest(_request, cancellationToken); - cancellationToken.ThrowIfCancellationRequested(); - return ListHandlesAsync_CreateResponse(_response); + _scope.Dispose(); } } @@ -2204,6 +2510,7 @@ internal static Azure.Core.Http.Request ListHandlesAsync_CreateRequest( /// The snapshot parameter is an opaque DateTime value that, when present, specifies the share snapshot to query. /// Specifies operation should apply to the directory specified in the URI, its files, its subdirectories and their files. /// Whether to invoke the operation asynchronously. The default value is true. + /// Operation name. /// Cancellation token. /// Azure.Response{Azure.Storage.Files.Models.StorageClosedHandlesSegment} public static async System.Threading.Tasks.Task> ForceCloseHandlesAsync( @@ -2215,25 +2522,41 @@ internal static Azure.Core.Http.Request ListHandlesAsync_CreateRequest( string sharesnapshot = default, bool? recursive = default, bool async = true, + string operationName = "Azure.Storage.Files.DirectoryClient.ForceCloseHandles", System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.Request _request = ForceCloseHandlesAsync_CreateRequest( - pipeline, - resourceUri, - handleId, - timeout, - marker, - sharesnapshot, - recursive)) + Azure.Core.Pipeline.DiagnosticScope _scope = pipeline.Diagnostics.CreateScope(operationName); + try + { + _scope.AddAttribute("url", resourceUri); + _scope.Start(); + using (Azure.Core.Http.Request _request = ForceCloseHandlesAsync_CreateRequest( + pipeline, + resourceUri, + handleId, + timeout, + marker, + sharesnapshot, + recursive)) + { + Azure.Response _response = async ? + // Send the request asynchronously if we're being called via an async path + await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : + // Send the request synchronously through the API that blocks if we're being called via a sync path + // (this is safe because the Task will complete before the user can call Wait) + pipeline.SendRequest(_request, cancellationToken); + cancellationToken.ThrowIfCancellationRequested(); + return ForceCloseHandlesAsync_CreateResponse(_response); + } + } + catch (System.Exception ex) + { + _scope.Failed(ex); + throw; + } + finally { - Azure.Response _response = async ? - // Send the request asynchronously if we're being called via an async path - await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : - // Send the request synchronously through the API that blocks if we're being called via a sync path - // (this is safe because the Task will complete before the user can call Wait) - pipeline.SendRequest(_request, cancellationToken); - cancellationToken.ThrowIfCancellationRequested(); - return ForceCloseHandlesAsync_CreateResponse(_response); + _scope.Dispose(); } } @@ -2361,6 +2684,7 @@ public static partial class File /// Sets the file's Content-Disposition header. /// A name-value pair to associate with a file storage object. /// Whether to invoke the operation asynchronously. The default value is true. + /// Operation name. /// Cancellation token. /// Azure.Response{Azure.Storage.Files.Models.StorageFileInfo} public static async System.Threading.Tasks.Task> CreateAsync( @@ -2376,29 +2700,45 @@ public static partial class File string fileContentDisposition = default, System.Collections.Generic.IDictionary metadata = default, bool async = true, + string operationName = "Azure.Storage.Files.FileClient.Create", System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.Request _request = CreateAsync_CreateRequest( - pipeline, - resourceUri, - fileContentLength, - timeout, - fileContentType, - fileContentEncoding, - fileContentLanguage, - fileCacheControl, - fileContentHash, - fileContentDisposition, - metadata)) - { - Azure.Response _response = async ? - // Send the request asynchronously if we're being called via an async path - await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : - // Send the request synchronously through the API that blocks if we're being called via a sync path - // (this is safe because the Task will complete before the user can call Wait) - pipeline.SendRequest(_request, cancellationToken); - cancellationToken.ThrowIfCancellationRequested(); - return CreateAsync_CreateResponse(_response); + Azure.Core.Pipeline.DiagnosticScope _scope = pipeline.Diagnostics.CreateScope(operationName); + try + { + _scope.AddAttribute("url", resourceUri); + _scope.Start(); + using (Azure.Core.Http.Request _request = CreateAsync_CreateRequest( + pipeline, + resourceUri, + fileContentLength, + timeout, + fileContentType, + fileContentEncoding, + fileContentLanguage, + fileCacheControl, + fileContentHash, + fileContentDisposition, + metadata)) + { + Azure.Response _response = async ? + // Send the request asynchronously if we're being called via an async path + await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : + // Send the request synchronously through the API that blocks if we're being called via a sync path + // (this is safe because the Task will complete before the user can call Wait) + pipeline.SendRequest(_request, cancellationToken); + cancellationToken.ThrowIfCancellationRequested(); + return CreateAsync_CreateResponse(_response); + } + } + catch (System.Exception ex) + { + _scope.Failed(ex); + throw; + } + finally + { + _scope.Dispose(); } } @@ -2535,6 +2875,7 @@ internal static Azure.Core.Http.Request CreateAsync_CreateRequest( /// Return file data only from the specified byte range. /// When this header is set to true and specified together with the Range header, the service returns the MD5 hash for the range, as long as the range is less than or equal to 4 MB in size. /// Whether to invoke the operation asynchronously. The default value is true. + /// Operation name. /// Cancellation token. /// Azure.Response{Azure.Storage.Files.Models.FlattenedStorageFileProperties} public static async System.Threading.Tasks.Task> DownloadAsync( @@ -2544,23 +2885,39 @@ internal static Azure.Core.Http.Request CreateAsync_CreateRequest( string range = default, bool? rangeGetContentHash = default, bool async = true, + string operationName = "Azure.Storage.Files.FileClient.Download", System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.Request _request = DownloadAsync_CreateRequest( - pipeline, - resourceUri, - timeout, - range, - rangeGetContentHash)) + Azure.Core.Pipeline.DiagnosticScope _scope = pipeline.Diagnostics.CreateScope(operationName); + try + { + _scope.AddAttribute("url", resourceUri); + _scope.Start(); + using (Azure.Core.Http.Request _request = DownloadAsync_CreateRequest( + pipeline, + resourceUri, + timeout, + range, + rangeGetContentHash)) + { + Azure.Response _response = async ? + // Send the request asynchronously if we're being called via an async path + await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : + // Send the request synchronously through the API that blocks if we're being called via a sync path + // (this is safe because the Task will complete before the user can call Wait) + pipeline.SendRequest(_request, cancellationToken); + cancellationToken.ThrowIfCancellationRequested(); + return DownloadAsync_CreateResponse(_response); + } + } + catch (System.Exception ex) { - Azure.Response _response = async ? - // Send the request asynchronously if we're being called via an async path - await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : - // Send the request synchronously through the API that blocks if we're being called via a sync path - // (this is safe because the Task will complete before the user can call Wait) - pipeline.SendRequest(_request, cancellationToken); - cancellationToken.ThrowIfCancellationRequested(); - return DownloadAsync_CreateResponse(_response); + _scope.Failed(ex); + throw; + } + finally + { + _scope.Dispose(); } } @@ -2864,6 +3221,7 @@ internal static Azure.Core.Http.Request DownloadAsync_CreateRequest( /// The snapshot parameter is an opaque DateTime value that, when present, specifies the share snapshot to query. /// The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for File Service Operations. /// Whether to invoke the operation asynchronously. The default value is true. + /// Operation name. /// Cancellation token. /// Azure.Response{Azure.Storage.Files.Models.StorageFileProperties} public static async System.Threading.Tasks.Task> GetPropertiesAsync( @@ -2872,22 +3230,38 @@ internal static Azure.Core.Http.Request DownloadAsync_CreateRequest( string sharesnapshot = default, int? timeout = default, bool async = true, + string operationName = "Azure.Storage.Files.FileClient.GetProperties", System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.Request _request = GetPropertiesAsync_CreateRequest( - pipeline, - resourceUri, - sharesnapshot, - timeout)) + Azure.Core.Pipeline.DiagnosticScope _scope = pipeline.Diagnostics.CreateScope(operationName); + try + { + _scope.AddAttribute("url", resourceUri); + _scope.Start(); + using (Azure.Core.Http.Request _request = GetPropertiesAsync_CreateRequest( + pipeline, + resourceUri, + sharesnapshot, + timeout)) + { + Azure.Response _response = async ? + // Send the request asynchronously if we're being called via an async path + await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : + // Send the request synchronously through the API that blocks if we're being called via a sync path + // (this is safe because the Task will complete before the user can call Wait) + pipeline.SendRequest(_request, cancellationToken); + cancellationToken.ThrowIfCancellationRequested(); + return GetPropertiesAsync_CreateResponse(_response); + } + } + catch (System.Exception ex) { - Azure.Response _response = async ? - // Send the request asynchronously if we're being called via an async path - await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : - // Send the request synchronously through the API that blocks if we're being called via a sync path - // (this is safe because the Task will complete before the user can call Wait) - pipeline.SendRequest(_request, cancellationToken); - cancellationToken.ThrowIfCancellationRequested(); - return GetPropertiesAsync_CreateResponse(_response); + _scope.Failed(ex); + throw; + } + finally + { + _scope.Dispose(); } } @@ -3055,6 +3429,7 @@ internal static Azure.Core.Http.Request GetPropertiesAsync_CreateRequest( /// The URL of the service account, share, directory or file that is the target of the desired operation. /// The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for File Service Operations. /// Whether to invoke the operation asynchronously. The default value is true. + /// Operation name. /// Cancellation token. /// Azure.Response public static async System.Threading.Tasks.Task DeleteAsync( @@ -3062,21 +3437,37 @@ internal static Azure.Core.Http.Request GetPropertiesAsync_CreateRequest( System.Uri resourceUri, int? timeout = default, bool async = true, + string operationName = "Azure.Storage.Files.FileClient.Delete", System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.Request _request = DeleteAsync_CreateRequest( - pipeline, - resourceUri, - timeout)) + Azure.Core.Pipeline.DiagnosticScope _scope = pipeline.Diagnostics.CreateScope(operationName); + try + { + _scope.AddAttribute("url", resourceUri); + _scope.Start(); + using (Azure.Core.Http.Request _request = DeleteAsync_CreateRequest( + pipeline, + resourceUri, + timeout)) + { + Azure.Response _response = async ? + // Send the request asynchronously if we're being called via an async path + await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : + // Send the request synchronously through the API that blocks if we're being called via a sync path + // (this is safe because the Task will complete before the user can call Wait) + pipeline.SendRequest(_request, cancellationToken); + cancellationToken.ThrowIfCancellationRequested(); + return DeleteAsync_CreateResponse(_response); + } + } + catch (System.Exception ex) { - Azure.Response _response = async ? - // Send the request asynchronously if we're being called via an async path - await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : - // Send the request synchronously through the API that blocks if we're being called via a sync path - // (this is safe because the Task will complete before the user can call Wait) - pipeline.SendRequest(_request, cancellationToken); - cancellationToken.ThrowIfCancellationRequested(); - return DeleteAsync_CreateResponse(_response); + _scope.Failed(ex); + throw; + } + finally + { + _scope.Dispose(); } } @@ -3154,6 +3545,7 @@ internal static Azure.Response DeleteAsync_CreateResponse( /// Sets the file's MD5 hash. /// Sets the file's Content-Disposition header. /// Whether to invoke the operation asynchronously. The default value is true. + /// Operation name. /// Cancellation token. /// Azure.Response{Azure.Storage.Files.Models.StorageFileInfo} public static async System.Threading.Tasks.Task> SetPropertiesAsync( @@ -3168,28 +3560,44 @@ internal static Azure.Response DeleteAsync_CreateResponse( byte[] fileContentHash = default, string fileContentDisposition = default, bool async = true, + string operationName = "Azure.Storage.Files.FileClient.SetProperties", System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.Request _request = SetPropertiesAsync_CreateRequest( - pipeline, - resourceUri, - timeout, - fileContentLength, - fileContentType, - fileContentEncoding, - fileContentLanguage, - fileCacheControl, - fileContentHash, - fileContentDisposition)) - { - Azure.Response _response = async ? - // Send the request asynchronously if we're being called via an async path - await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : - // Send the request synchronously through the API that blocks if we're being called via a sync path - // (this is safe because the Task will complete before the user can call Wait) - pipeline.SendRequest(_request, cancellationToken); - cancellationToken.ThrowIfCancellationRequested(); - return SetPropertiesAsync_CreateResponse(_response); + Azure.Core.Pipeline.DiagnosticScope _scope = pipeline.Diagnostics.CreateScope(operationName); + try + { + _scope.AddAttribute("url", resourceUri); + _scope.Start(); + using (Azure.Core.Http.Request _request = SetPropertiesAsync_CreateRequest( + pipeline, + resourceUri, + timeout, + fileContentLength, + fileContentType, + fileContentEncoding, + fileContentLanguage, + fileCacheControl, + fileContentHash, + fileContentDisposition)) + { + Azure.Response _response = async ? + // Send the request asynchronously if we're being called via an async path + await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : + // Send the request synchronously through the API that blocks if we're being called via a sync path + // (this is safe because the Task will complete before the user can call Wait) + pipeline.SendRequest(_request, cancellationToken); + cancellationToken.ThrowIfCancellationRequested(); + return SetPropertiesAsync_CreateResponse(_response); + } + } + catch (System.Exception ex) + { + _scope.Failed(ex); + throw; + } + finally + { + _scope.Dispose(); } } @@ -3317,6 +3725,7 @@ internal static Azure.Core.Http.Request SetPropertiesAsync_CreateRequest( /// The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for File Service Operations. /// A name-value pair to associate with a file storage object. /// Whether to invoke the operation asynchronously. The default value is true. + /// Operation name. /// Cancellation token. /// Azure.Response{Azure.Storage.Files.Models.StorageFileInfo} public static async System.Threading.Tasks.Task> SetMetadataAsync( @@ -3325,22 +3734,38 @@ internal static Azure.Core.Http.Request SetPropertiesAsync_CreateRequest( int? timeout = default, System.Collections.Generic.IDictionary metadata = default, bool async = true, + string operationName = "Azure.Storage.Files.FileClient.SetMetadata", System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.Request _request = SetMetadataAsync_CreateRequest( - pipeline, - resourceUri, - timeout, - metadata)) + Azure.Core.Pipeline.DiagnosticScope _scope = pipeline.Diagnostics.CreateScope(operationName); + try + { + _scope.AddAttribute("url", resourceUri); + _scope.Start(); + using (Azure.Core.Http.Request _request = SetMetadataAsync_CreateRequest( + pipeline, + resourceUri, + timeout, + metadata)) + { + Azure.Response _response = async ? + // Send the request asynchronously if we're being called via an async path + await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : + // Send the request synchronously through the API that blocks if we're being called via a sync path + // (this is safe because the Task will complete before the user can call Wait) + pipeline.SendRequest(_request, cancellationToken); + cancellationToken.ThrowIfCancellationRequested(); + return SetMetadataAsync_CreateResponse(_response); + } + } + catch (System.Exception ex) + { + _scope.Failed(ex); + throw; + } + finally { - Azure.Response _response = async ? - // Send the request asynchronously if we're being called via an async path - await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : - // Send the request synchronously through the API that blocks if we're being called via a sync path - // (this is safe because the Task will complete before the user can call Wait) - pipeline.SendRequest(_request, cancellationToken); - cancellationToken.ThrowIfCancellationRequested(); - return SetMetadataAsync_CreateResponse(_response); + _scope.Dispose(); } } @@ -3449,6 +3874,7 @@ internal static Azure.Core.Http.Request SetMetadataAsync_CreateRequest( /// The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for File Service Operations. /// An MD5 hash of the content. This hash is used to verify the integrity of the data during transport. When the Content-MD5 header is specified, the File service compares the hash of the content that has arrived with the header value that was sent. If the two hashes do not match, the operation will fail with error code 400 (Bad Request). /// Whether to invoke the operation asynchronously. The default value is true. + /// Operation name. /// Cancellation token. /// Azure.Response{Azure.Storage.Files.Models.StorageFileUploadInfo} public static async System.Threading.Tasks.Task> UploadRangeAsync( @@ -3461,26 +3887,42 @@ internal static Azure.Core.Http.Request SetMetadataAsync_CreateRequest( int? timeout = default, byte[] contentHash = default, bool async = true, + string operationName = "Azure.Storage.Files.FileClient.UploadRange", System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.Request _request = UploadRangeAsync_CreateRequest( - pipeline, - resourceUri, - range, - fileRangeWrite, - contentLength, - optionalbody, - timeout, - contentHash)) + Azure.Core.Pipeline.DiagnosticScope _scope = pipeline.Diagnostics.CreateScope(operationName); + try + { + _scope.AddAttribute("url", resourceUri); + _scope.Start(); + using (Azure.Core.Http.Request _request = UploadRangeAsync_CreateRequest( + pipeline, + resourceUri, + range, + fileRangeWrite, + contentLength, + optionalbody, + timeout, + contentHash)) + { + Azure.Response _response = async ? + // Send the request asynchronously if we're being called via an async path + await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : + // Send the request synchronously through the API that blocks if we're being called via a sync path + // (this is safe because the Task will complete before the user can call Wait) + pipeline.SendRequest(_request, cancellationToken); + cancellationToken.ThrowIfCancellationRequested(); + return UploadRangeAsync_CreateResponse(_response); + } + } + catch (System.Exception ex) + { + _scope.Failed(ex); + throw; + } + finally { - Azure.Response _response = async ? - // Send the request asynchronously if we're being called via an async path - await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : - // Send the request synchronously through the API that blocks if we're being called via a sync path - // (this is safe because the Task will complete before the user can call Wait) - pipeline.SendRequest(_request, cancellationToken); - cancellationToken.ThrowIfCancellationRequested(); - return UploadRangeAsync_CreateResponse(_response); + _scope.Dispose(); } } @@ -3603,6 +4045,7 @@ internal static Azure.Core.Http.Request UploadRangeAsync_CreateRequest( /// The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for File Service Operations. /// Specifies the range of bytes over which to list ranges, inclusively. /// Whether to invoke the operation asynchronously. The default value is true. + /// Operation name. /// Cancellation token. /// Azure.Response{Azure.Storage.Files.Models.StorageFileRangeInfo} public static async System.Threading.Tasks.Task> GetRangeListAsync( @@ -3612,23 +4055,39 @@ internal static Azure.Core.Http.Request UploadRangeAsync_CreateRequest( int? timeout = default, string range = default, bool async = true, + string operationName = "Azure.Storage.Files.FileClient.GetRangeList", System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.Request _request = GetRangeListAsync_CreateRequest( - pipeline, - resourceUri, - sharesnapshot, - timeout, - range)) + Azure.Core.Pipeline.DiagnosticScope _scope = pipeline.Diagnostics.CreateScope(operationName); + try + { + _scope.AddAttribute("url", resourceUri); + _scope.Start(); + using (Azure.Core.Http.Request _request = GetRangeListAsync_CreateRequest( + pipeline, + resourceUri, + sharesnapshot, + timeout, + range)) + { + Azure.Response _response = async ? + // Send the request asynchronously if we're being called via an async path + await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : + // Send the request synchronously through the API that blocks if we're being called via a sync path + // (this is safe because the Task will complete before the user can call Wait) + pipeline.SendRequest(_request, cancellationToken); + cancellationToken.ThrowIfCancellationRequested(); + return GetRangeListAsync_CreateResponse(_response); + } + } + catch (System.Exception ex) + { + _scope.Failed(ex); + throw; + } + finally { - Azure.Response _response = async ? - // Send the request asynchronously if we're being called via an async path - await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : - // Send the request synchronously through the API that blocks if we're being called via a sync path - // (this is safe because the Task will complete before the user can call Wait) - pipeline.SendRequest(_request, cancellationToken); - cancellationToken.ThrowIfCancellationRequested(); - return GetRangeListAsync_CreateResponse(_response); + _scope.Dispose(); } } @@ -3738,6 +4197,7 @@ internal static Azure.Core.Http.Request GetRangeListAsync_CreateRequest( /// The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for File Service Operations. /// A name-value pair to associate with a file storage object. /// Whether to invoke the operation asynchronously. The default value is true. + /// Operation name. /// Cancellation token. /// Azure.Response{Azure.Storage.Files.Models.StorageFileCopyInfo} public static async System.Threading.Tasks.Task> StartCopyAsync( @@ -3747,23 +4207,39 @@ internal static Azure.Core.Http.Request GetRangeListAsync_CreateRequest( int? timeout = default, System.Collections.Generic.IDictionary metadata = default, bool async = true, + string operationName = "Azure.Storage.Files.FileClient.StartCopy", System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.Request _request = StartCopyAsync_CreateRequest( - pipeline, - resourceUri, - copySource, - timeout, - metadata)) + Azure.Core.Pipeline.DiagnosticScope _scope = pipeline.Diagnostics.CreateScope(operationName); + try { - Azure.Response _response = async ? - // Send the request asynchronously if we're being called via an async path - await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : - // Send the request synchronously through the API that blocks if we're being called via a sync path - // (this is safe because the Task will complete before the user can call Wait) - pipeline.SendRequest(_request, cancellationToken); - cancellationToken.ThrowIfCancellationRequested(); - return StartCopyAsync_CreateResponse(_response); + _scope.AddAttribute("url", resourceUri); + _scope.Start(); + using (Azure.Core.Http.Request _request = StartCopyAsync_CreateRequest( + pipeline, + resourceUri, + copySource, + timeout, + metadata)) + { + Azure.Response _response = async ? + // Send the request asynchronously if we're being called via an async path + await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : + // Send the request synchronously through the API that blocks if we're being called via a sync path + // (this is safe because the Task will complete before the user can call Wait) + pipeline.SendRequest(_request, cancellationToken); + cancellationToken.ThrowIfCancellationRequested(); + return StartCopyAsync_CreateResponse(_response); + } + } + catch (System.Exception ex) + { + _scope.Failed(ex); + throw; + } + finally + { + _scope.Dispose(); } } @@ -3878,6 +4354,7 @@ internal static Azure.Core.Http.Request StartCopyAsync_CreateRequest( /// The copy identifier provided in the x-ms-copy-id header of the original Copy File operation. /// The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for File Service Operations. /// Whether to invoke the operation asynchronously. The default value is true. + /// Operation name. /// Cancellation token. /// Azure.Response public static async System.Threading.Tasks.Task AbortCopyAsync( @@ -3886,22 +4363,38 @@ internal static Azure.Core.Http.Request StartCopyAsync_CreateRequest( string copyId, int? timeout = default, bool async = true, + string operationName = "Azure.Storage.Files.FileClient.AbortCopy", System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.Request _request = AbortCopyAsync_CreateRequest( - pipeline, - resourceUri, - copyId, - timeout)) + Azure.Core.Pipeline.DiagnosticScope _scope = pipeline.Diagnostics.CreateScope(operationName); + try + { + _scope.AddAttribute("url", resourceUri); + _scope.Start(); + using (Azure.Core.Http.Request _request = AbortCopyAsync_CreateRequest( + pipeline, + resourceUri, + copyId, + timeout)) + { + Azure.Response _response = async ? + // Send the request asynchronously if we're being called via an async path + await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : + // Send the request synchronously through the API that blocks if we're being called via a sync path + // (this is safe because the Task will complete before the user can call Wait) + pipeline.SendRequest(_request, cancellationToken); + cancellationToken.ThrowIfCancellationRequested(); + return AbortCopyAsync_CreateResponse(_response); + } + } + catch (System.Exception ex) + { + _scope.Failed(ex); + throw; + } + finally { - Azure.Response _response = async ? - // Send the request asynchronously if we're being called via an async path - await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : - // Send the request synchronously through the API that blocks if we're being called via a sync path - // (this is safe because the Task will complete before the user can call Wait) - pipeline.SendRequest(_request, cancellationToken); - cancellationToken.ThrowIfCancellationRequested(); - return AbortCopyAsync_CreateResponse(_response); + _scope.Dispose(); } } @@ -3984,6 +4477,7 @@ internal static Azure.Response AbortCopyAsync_CreateResponse( /// The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for File Service Operations. /// The snapshot parameter is an opaque DateTime value that, when present, specifies the share snapshot to query. /// Whether to invoke the operation asynchronously. The default value is true. + /// Operation name. /// Cancellation token. /// An enumeration of handles. public static async System.Threading.Tasks.Task> ListHandlesAsync( @@ -3994,24 +4488,40 @@ internal static Azure.Response AbortCopyAsync_CreateResponse( int? timeout = default, string sharesnapshot = default, bool async = true, + string operationName = "Azure.Storage.Files.FileClient.ListHandles", System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.Request _request = ListHandlesAsync_CreateRequest( - pipeline, - resourceUri, - marker, - maxresults, - timeout, - sharesnapshot)) + Azure.Core.Pipeline.DiagnosticScope _scope = pipeline.Diagnostics.CreateScope(operationName); + try { - Azure.Response _response = async ? - // Send the request asynchronously if we're being called via an async path - await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : - // Send the request synchronously through the API that blocks if we're being called via a sync path - // (this is safe because the Task will complete before the user can call Wait) - pipeline.SendRequest(_request, cancellationToken); - cancellationToken.ThrowIfCancellationRequested(); - return ListHandlesAsync_CreateResponse(_response); + _scope.AddAttribute("url", resourceUri); + _scope.Start(); + using (Azure.Core.Http.Request _request = ListHandlesAsync_CreateRequest( + pipeline, + resourceUri, + marker, + maxresults, + timeout, + sharesnapshot)) + { + Azure.Response _response = async ? + // Send the request asynchronously if we're being called via an async path + await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : + // Send the request synchronously through the API that blocks if we're being called via a sync path + // (this is safe because the Task will complete before the user can call Wait) + pipeline.SendRequest(_request, cancellationToken); + cancellationToken.ThrowIfCancellationRequested(); + return ListHandlesAsync_CreateResponse(_response); + } + } + catch (System.Exception ex) + { + _scope.Failed(ex); + throw; + } + finally + { + _scope.Dispose(); } } @@ -4105,6 +4615,7 @@ internal static Azure.Core.Http.Request ListHandlesAsync_CreateRequest( /// A string value that identifies the portion of the list to be returned with the next list operation. The operation returns a marker value within the response body if the list returned was not complete. The marker value may then be used in a subsequent call to request the next set of list items. The marker value is opaque to the client. /// The snapshot parameter is an opaque DateTime value that, when present, specifies the share snapshot to query. /// Whether to invoke the operation asynchronously. The default value is true. + /// Operation name. /// Cancellation token. /// Azure.Response{Azure.Storage.Files.Models.StorageClosedHandlesSegment} public static async System.Threading.Tasks.Task> ForceCloseHandlesAsync( @@ -4115,24 +4626,40 @@ internal static Azure.Core.Http.Request ListHandlesAsync_CreateRequest( string marker = default, string sharesnapshot = default, bool async = true, + string operationName = "Azure.Storage.Files.FileClient.ForceCloseHandles", System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.Request _request = ForceCloseHandlesAsync_CreateRequest( - pipeline, - resourceUri, - handleId, - timeout, - marker, - sharesnapshot)) - { - Azure.Response _response = async ? - // Send the request asynchronously if we're being called via an async path - await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : - // Send the request synchronously through the API that blocks if we're being called via a sync path - // (this is safe because the Task will complete before the user can call Wait) - pipeline.SendRequest(_request, cancellationToken); - cancellationToken.ThrowIfCancellationRequested(); - return ForceCloseHandlesAsync_CreateResponse(_response); + Azure.Core.Pipeline.DiagnosticScope _scope = pipeline.Diagnostics.CreateScope(operationName); + try + { + _scope.AddAttribute("url", resourceUri); + _scope.Start(); + using (Azure.Core.Http.Request _request = ForceCloseHandlesAsync_CreateRequest( + pipeline, + resourceUri, + handleId, + timeout, + marker, + sharesnapshot)) + { + Azure.Response _response = async ? + // Send the request asynchronously if we're being called via an async path + await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : + // Send the request synchronously through the API that blocks if we're being called via a sync path + // (this is safe because the Task will complete before the user can call Wait) + pipeline.SendRequest(_request, cancellationToken); + cancellationToken.ThrowIfCancellationRequested(); + return ForceCloseHandlesAsync_CreateResponse(_response); + } + } + catch (System.Exception ex) + { + _scope.Failed(ex); + throw; + } + finally + { + _scope.Dispose(); } } diff --git a/sdk/storage/Azure.Storage.Files/src/ShareClient.cs b/sdk/storage/Azure.Storage.Files/src/ShareClient.cs index cc0443dc2a677..6ed5d3bdf036f 100644 --- a/sdk/storage/Azure.Storage.Files/src/ShareClient.cs +++ b/sdk/storage/Azure.Storage.Files/src/ShareClient.cs @@ -6,6 +6,7 @@ using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; +using Azure.Core; using Azure.Core.Pipeline; using Azure.Storage.Common; using Azure.Storage.Files.Models; @@ -339,6 +340,7 @@ private async Task> CreateInternal( metadata: metadata, quota: quotaInBytes, async: async, + operationName: "Azure.Storage.Files.ShareClient.Create", cancellationToken: cancellationToken) .ConfigureAwait(false); } @@ -454,6 +456,7 @@ private async Task> CreateSnapshotInternal( this.Uri, metadata: metadata, async: async, + operationName: "Azure.Storage.Files.ShareClient.CreateSnapshot", cancellationToken: cancellationToken) .ConfigureAwait(false); } @@ -577,6 +580,7 @@ private async Task DeleteInternal( this.Uri, sharesnapshot: shareSnapshot, async: async, + operationName: "Azure.Storage.Files.ShareClient.Delete", cancellationToken: cancellationToken) .ConfigureAwait(false); } @@ -700,6 +704,7 @@ private async Task> GetPropertiesInternal( this.Uri, sharesnapshot: shareSnapshot, async: async, + operationName: "Azure.Storage.Files.ShareClient.GetProperties", cancellationToken: cancellationToken) .ConfigureAwait(false); } @@ -811,6 +816,7 @@ public virtual async Task> SetQuotaInternal( this.Uri, quota: quotaInBytes, async: async, + operationName: "Azure.Storage.Files.ShareClient.SetQuota", cancellationToken: cancellationToken) .ConfigureAwait(false); } @@ -929,6 +935,7 @@ private async Task> SetMetadataInternal( this.Uri, metadata: metadata, async: async, + operationName: "Azure.Storage.Files.ShareClient.SetMetadata", cancellationToken: cancellationToken) .ConfigureAwait(false); } @@ -1035,6 +1042,7 @@ private async Task>> GetAccessPolicyInter this.Pipeline, this.Uri, async: async, + operationName: "Azure.Storage.Files.ShareClient.GetAccessPolicy", cancellationToken: cancellationToken) .ConfigureAwait(false); } @@ -1159,6 +1167,7 @@ private async Task> SetAccessPolicyInternal( this.Uri, permissions: permissions, async: async, + operationName: "Azure.Storage.Files.ShareClient.SetAccessPolicy", cancellationToken: cancellationToken) .ConfigureAwait(false); } @@ -1259,6 +1268,7 @@ private async Task> GetStatisticsInternal( this.Pipeline, this.Uri, async: async, + operationName: "Azure.Storage.Files.ShareClient.GetStatistics", cancellationToken: cancellationToken) .ConfigureAwait(false); } @@ -1300,6 +1310,7 @@ private async Task> GetStatisticsInternal( /// A will be thrown if /// a failure occurs. /// + [ForwardsClientCalls] public virtual Response CreateDirectory( string directoryName, IDictionary metadata = default, @@ -1334,6 +1345,7 @@ public virtual Response CreateDirectory( /// A will be thrown if /// a failure occurs. /// + [ForwardsClientCalls] public virtual async Task> CreateDirectoryAsync( string directoryName, IDictionary metadata = default, @@ -1365,6 +1377,7 @@ public virtual async Task> CreateDirectoryAsync( /// /// Note that the directory must be empty before it can be deleted. /// + [ForwardsClientCalls] public virtual Response DeleteDirectory( string directoryName, CancellationToken cancellationToken = default) => @@ -1389,6 +1402,7 @@ public virtual Response DeleteDirectory( /// /// Note that the directory must be empty before it can be deleted. /// + [ForwardsClientCalls] public virtual async Task DeleteDirectoryAsync( string directoryName, CancellationToken cancellationToken = default) => diff --git a/sdk/storage/Azure.Storage.Files/swagger/file.json b/sdk/storage/Azure.Storage.Files/swagger/file.json index 8c1659e2b26ad..68483a0eacc4c 100644 --- a/sdk/storage/Azure.Storage.Files/swagger/file.json +++ b/sdk/storage/Azure.Storage.Files/swagger/file.json @@ -3306,7 +3306,8 @@ "required": true, "type": "string", "format": "url", - "x-ms-skip-url-encoding": true + "x-ms-skip-url-encoding": true, + "x-ms-trace": true }, "ShareAcl": { "name": "shareAcl", diff --git a/sdk/storage/Azure.Storage.Files/tests/ServiceClientTests.cs b/sdk/storage/Azure.Storage.Files/tests/ServiceClientTests.cs index 407303c7fce8e..53bcc31630a95 100644 --- a/sdk/storage/Azure.Storage.Files/tests/ServiceClientTests.cs +++ b/sdk/storage/Azure.Storage.Files/tests/ServiceClientTests.cs @@ -129,14 +129,14 @@ public async Task ListSharesSegmentAsync() var service = this.GetServiceClient_SharedKey(); // Ensure at least one share - using (this.GetNewShare(out var share, service: service)) + using (this.GetNewShare(out var share, service: service)) { var shares = new List(); await foreach (var page in service.GetSharesAsync().ByPage()) { shares.AddRange(page.Values); } - + // Assert Assert.AreNotEqual(0, shares.Count); Assert.AreEqual(shares.Count, shares.Select(c => c.Name).Distinct().Count()); diff --git a/sdk/storage/Azure.Storage.Queues/src/Generated/QueueRestClient.cs b/sdk/storage/Azure.Storage.Queues/src/Generated/QueueRestClient.cs index c08c890bd9d5a..18b86d3755f3f 100644 --- a/sdk/storage/Azure.Storage.Queues/src/Generated/QueueRestClient.cs +++ b/sdk/storage/Azure.Storage.Queues/src/Generated/QueueRestClient.cs @@ -28,6 +28,7 @@ public static partial class Service /// The The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Queue Service Operations. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// Whether to invoke the operation asynchronously. The default value is true. + /// Operation name. /// Cancellation token. /// Azure.Response public static async System.Threading.Tasks.Task SetPropertiesAsync( @@ -37,23 +38,39 @@ public static partial class Service int? timeout = default, string requestId = default, bool async = true, + string operationName = "Azure.Storage.Queues.ServiceClient.SetProperties", System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.Request _request = SetPropertiesAsync_CreateRequest( - pipeline, - resourceUri, - properties, - timeout, - requestId)) + Azure.Core.Pipeline.DiagnosticScope _scope = pipeline.Diagnostics.CreateScope(operationName); + try { - Azure.Response _response = async ? - // Send the request asynchronously if we're being called via an async path - await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : - // Send the request synchronously through the API that blocks if we're being called via a sync path - // (this is safe because the Task will complete before the user can call Wait) - pipeline.SendRequest(_request, cancellationToken); - cancellationToken.ThrowIfCancellationRequested(); - return SetPropertiesAsync_CreateResponse(_response); + _scope.AddAttribute("url", resourceUri); + _scope.Start(); + using (Azure.Core.Http.Request _request = SetPropertiesAsync_CreateRequest( + pipeline, + resourceUri, + properties, + timeout, + requestId)) + { + Azure.Response _response = async ? + // Send the request asynchronously if we're being called via an async path + await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : + // Send the request synchronously through the API that blocks if we're being called via a sync path + // (this is safe because the Task will complete before the user can call Wait) + pipeline.SendRequest(_request, cancellationToken); + cancellationToken.ThrowIfCancellationRequested(); + return SetPropertiesAsync_CreateResponse(_response); + } + } + catch (System.Exception ex) + { + _scope.Failed(ex); + throw; + } + finally + { + _scope.Dispose(); } } @@ -143,6 +160,7 @@ internal static Azure.Response SetPropertiesAsync_CreateResponse( /// The The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Queue Service Operations. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// Whether to invoke the operation asynchronously. The default value is true. + /// Operation name. /// Cancellation token. /// Storage Service Properties. public static async System.Threading.Tasks.Task> GetPropertiesAsync( @@ -151,22 +169,38 @@ internal static Azure.Response SetPropertiesAsync_CreateResponse( int? timeout = default, string requestId = default, bool async = true, + string operationName = "Azure.Storage.Queues.ServiceClient.GetProperties", System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.Request _request = GetPropertiesAsync_CreateRequest( - pipeline, - resourceUri, - timeout, - requestId)) + Azure.Core.Pipeline.DiagnosticScope _scope = pipeline.Diagnostics.CreateScope(operationName); + try { - Azure.Response _response = async ? - // Send the request asynchronously if we're being called via an async path - await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : - // Send the request synchronously through the API that blocks if we're being called via a sync path - // (this is safe because the Task will complete before the user can call Wait) - pipeline.SendRequest(_request, cancellationToken); - cancellationToken.ThrowIfCancellationRequested(); - return GetPropertiesAsync_CreateResponse(_response); + _scope.AddAttribute("url", resourceUri); + _scope.Start(); + using (Azure.Core.Http.Request _request = GetPropertiesAsync_CreateRequest( + pipeline, + resourceUri, + timeout, + requestId)) + { + Azure.Response _response = async ? + // Send the request asynchronously if we're being called via an async path + await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : + // Send the request synchronously through the API that blocks if we're being called via a sync path + // (this is safe because the Task will complete before the user can call Wait) + pipeline.SendRequest(_request, cancellationToken); + cancellationToken.ThrowIfCancellationRequested(); + return GetPropertiesAsync_CreateResponse(_response); + } + } + catch (System.Exception ex) + { + _scope.Failed(ex); + throw; + } + finally + { + _scope.Dispose(); } } @@ -253,6 +287,7 @@ internal static Azure.Core.Http.Request GetPropertiesAsync_CreateRequest( /// The The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Queue Service Operations. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// Whether to invoke the operation asynchronously. The default value is true. + /// Operation name. /// Cancellation token. /// Statistics for the storage service. public static async System.Threading.Tasks.Task> GetStatisticsAsync( @@ -261,22 +296,38 @@ internal static Azure.Core.Http.Request GetPropertiesAsync_CreateRequest( int? timeout = default, string requestId = default, bool async = true, + string operationName = "Azure.Storage.Queues.ServiceClient.GetStatistics", System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.Request _request = GetStatisticsAsync_CreateRequest( - pipeline, - resourceUri, - timeout, - requestId)) + Azure.Core.Pipeline.DiagnosticScope _scope = pipeline.Diagnostics.CreateScope(operationName); + try { - Azure.Response _response = async ? - // Send the request asynchronously if we're being called via an async path - await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : - // Send the request synchronously through the API that blocks if we're being called via a sync path - // (this is safe because the Task will complete before the user can call Wait) - pipeline.SendRequest(_request, cancellationToken); - cancellationToken.ThrowIfCancellationRequested(); - return GetStatisticsAsync_CreateResponse(_response); + _scope.AddAttribute("url", resourceUri); + _scope.Start(); + using (Azure.Core.Http.Request _request = GetStatisticsAsync_CreateRequest( + pipeline, + resourceUri, + timeout, + requestId)) + { + Azure.Response _response = async ? + // Send the request asynchronously if we're being called via an async path + await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : + // Send the request synchronously through the API that blocks if we're being called via a sync path + // (this is safe because the Task will complete before the user can call Wait) + pipeline.SendRequest(_request, cancellationToken); + cancellationToken.ThrowIfCancellationRequested(); + return GetStatisticsAsync_CreateResponse(_response); + } + } + catch (System.Exception ex) + { + _scope.Failed(ex); + throw; + } + finally + { + _scope.Dispose(); } } @@ -367,6 +418,7 @@ internal static Azure.Core.Http.Request GetStatisticsAsync_CreateRequest( /// The The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Queue Service Operations. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// Whether to invoke the operation asynchronously. The default value is true. + /// Operation name. /// Cancellation token. /// The object returned when calling List Queues on a Queue Service. public static async System.Threading.Tasks.Task> ListQueuesSegmentAsync( @@ -379,26 +431,42 @@ internal static Azure.Core.Http.Request GetStatisticsAsync_CreateRequest( int? timeout = default, string requestId = default, bool async = true, + string operationName = "Azure.Storage.Queues.ServiceClient.ListQueuesSegment", System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.Request _request = ListQueuesSegmentAsync_CreateRequest( - pipeline, - resourceUri, - prefix, - marker, - maxresults, - include, - timeout, - requestId)) + Azure.Core.Pipeline.DiagnosticScope _scope = pipeline.Diagnostics.CreateScope(operationName); + try + { + _scope.AddAttribute("url", resourceUri); + _scope.Start(); + using (Azure.Core.Http.Request _request = ListQueuesSegmentAsync_CreateRequest( + pipeline, + resourceUri, + prefix, + marker, + maxresults, + include, + timeout, + requestId)) + { + Azure.Response _response = async ? + // Send the request asynchronously if we're being called via an async path + await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : + // Send the request synchronously through the API that blocks if we're being called via a sync path + // (this is safe because the Task will complete before the user can call Wait) + pipeline.SendRequest(_request, cancellationToken); + cancellationToken.ThrowIfCancellationRequested(); + return ListQueuesSegmentAsync_CreateResponse(_response); + } + } + catch (System.Exception ex) { - Azure.Response _response = async ? - // Send the request asynchronously if we're being called via an async path - await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : - // Send the request synchronously through the API that blocks if we're being called via a sync path - // (this is safe because the Task will complete before the user can call Wait) - pipeline.SendRequest(_request, cancellationToken); - cancellationToken.ThrowIfCancellationRequested(); - return ListQueuesSegmentAsync_CreateResponse(_response); + _scope.Failed(ex); + throw; + } + finally + { + _scope.Dispose(); } } @@ -505,6 +573,7 @@ public static partial class Queue /// Optional. Include this parameter to specify that the queue's metadata be returned as part of the response body. Note that metadata requested with this parameter must be stored in accordance with the naming restrictions imposed by the 2009-09-19 version of the Queue service. Beginning with this version, all metadata names must adhere to the naming conventions for C# identifiers. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// Whether to invoke the operation asynchronously. The default value is true. + /// Operation name. /// Cancellation token. /// Azure.Response public static async System.Threading.Tasks.Task CreateAsync( @@ -514,23 +583,39 @@ public static partial class Queue System.Collections.Generic.IDictionary metadata = default, string requestId = default, bool async = true, + string operationName = "Azure.Storage.Queues.QueueClient.Create", System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.Request _request = CreateAsync_CreateRequest( - pipeline, - resourceUri, - timeout, - metadata, - requestId)) + Azure.Core.Pipeline.DiagnosticScope _scope = pipeline.Diagnostics.CreateScope(operationName); + try { - Azure.Response _response = async ? - // Send the request asynchronously if we're being called via an async path - await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : - // Send the request synchronously through the API that blocks if we're being called via a sync path - // (this is safe because the Task will complete before the user can call Wait) - pipeline.SendRequest(_request, cancellationToken); - cancellationToken.ThrowIfCancellationRequested(); - return CreateAsync_CreateResponse(_response); + _scope.AddAttribute("url", resourceUri); + _scope.Start(); + using (Azure.Core.Http.Request _request = CreateAsync_CreateRequest( + pipeline, + resourceUri, + timeout, + metadata, + requestId)) + { + Azure.Response _response = async ? + // Send the request asynchronously if we're being called via an async path + await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : + // Send the request synchronously through the API that blocks if we're being called via a sync path + // (this is safe because the Task will complete before the user can call Wait) + pipeline.SendRequest(_request, cancellationToken); + cancellationToken.ThrowIfCancellationRequested(); + return CreateAsync_CreateResponse(_response); + } + } + catch (System.Exception ex) + { + _scope.Failed(ex); + throw; + } + finally + { + _scope.Dispose(); } } @@ -617,6 +702,7 @@ internal static Azure.Response CreateAsync_CreateResponse( /// The The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Queue Service Operations. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// Whether to invoke the operation asynchronously. The default value is true. + /// Operation name. /// Cancellation token. /// Azure.Response public static async System.Threading.Tasks.Task DeleteAsync( @@ -625,22 +711,38 @@ internal static Azure.Response CreateAsync_CreateResponse( int? timeout = default, string requestId = default, bool async = true, + string operationName = "Azure.Storage.Queues.QueueClient.Delete", System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.Request _request = DeleteAsync_CreateRequest( - pipeline, - resourceUri, - timeout, - requestId)) + Azure.Core.Pipeline.DiagnosticScope _scope = pipeline.Diagnostics.CreateScope(operationName); + try + { + _scope.AddAttribute("url", resourceUri); + _scope.Start(); + using (Azure.Core.Http.Request _request = DeleteAsync_CreateRequest( + pipeline, + resourceUri, + timeout, + requestId)) + { + Azure.Response _response = async ? + // Send the request asynchronously if we're being called via an async path + await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : + // Send the request synchronously through the API that blocks if we're being called via a sync path + // (this is safe because the Task will complete before the user can call Wait) + pipeline.SendRequest(_request, cancellationToken); + cancellationToken.ThrowIfCancellationRequested(); + return DeleteAsync_CreateResponse(_response); + } + } + catch (System.Exception ex) { - Azure.Response _response = async ? - // Send the request asynchronously if we're being called via an async path - await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : - // Send the request synchronously through the API that blocks if we're being called via a sync path - // (this is safe because the Task will complete before the user can call Wait) - pipeline.SendRequest(_request, cancellationToken); - cancellationToken.ThrowIfCancellationRequested(); - return DeleteAsync_CreateResponse(_response); + _scope.Failed(ex); + throw; + } + finally + { + _scope.Dispose(); } } @@ -715,6 +817,7 @@ internal static Azure.Response DeleteAsync_CreateResponse( /// The The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Queue Service Operations. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// Whether to invoke the operation asynchronously. The default value is true. + /// Operation name. /// Cancellation token. /// Azure.Response{Azure.Storage.Queues.Models.QueueProperties} public static async System.Threading.Tasks.Task> GetPropertiesAsync( @@ -723,22 +826,38 @@ internal static Azure.Response DeleteAsync_CreateResponse( int? timeout = default, string requestId = default, bool async = true, + string operationName = "Azure.Storage.Queues.QueueClient.GetProperties", System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.Request _request = GetPropertiesAsync_CreateRequest( - pipeline, - resourceUri, - timeout, - requestId)) + Azure.Core.Pipeline.DiagnosticScope _scope = pipeline.Diagnostics.CreateScope(operationName); + try + { + _scope.AddAttribute("url", resourceUri); + _scope.Start(); + using (Azure.Core.Http.Request _request = GetPropertiesAsync_CreateRequest( + pipeline, + resourceUri, + timeout, + requestId)) + { + Azure.Response _response = async ? + // Send the request asynchronously if we're being called via an async path + await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : + // Send the request synchronously through the API that blocks if we're being called via a sync path + // (this is safe because the Task will complete before the user can call Wait) + pipeline.SendRequest(_request, cancellationToken); + cancellationToken.ThrowIfCancellationRequested(); + return GetPropertiesAsync_CreateResponse(_response); + } + } + catch (System.Exception ex) { - Azure.Response _response = async ? - // Send the request asynchronously if we're being called via an async path - await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : - // Send the request synchronously through the API that blocks if we're being called via a sync path - // (this is safe because the Task will complete before the user can call Wait) - pipeline.SendRequest(_request, cancellationToken); - cancellationToken.ThrowIfCancellationRequested(); - return GetPropertiesAsync_CreateResponse(_response); + _scope.Failed(ex); + throw; + } + finally + { + _scope.Dispose(); } } @@ -839,6 +958,7 @@ internal static Azure.Core.Http.Request GetPropertiesAsync_CreateRequest( /// Optional. Include this parameter to specify that the queue's metadata be returned as part of the response body. Note that metadata requested with this parameter must be stored in accordance with the naming restrictions imposed by the 2009-09-19 version of the Queue service. Beginning with this version, all metadata names must adhere to the naming conventions for C# identifiers. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// Whether to invoke the operation asynchronously. The default value is true. + /// Operation name. /// Cancellation token. /// Azure.Response public static async System.Threading.Tasks.Task SetMetadataAsync( @@ -848,23 +968,39 @@ internal static Azure.Core.Http.Request GetPropertiesAsync_CreateRequest( System.Collections.Generic.IDictionary metadata = default, string requestId = default, bool async = true, + string operationName = "Azure.Storage.Queues.QueueClient.SetMetadata", System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.Request _request = SetMetadataAsync_CreateRequest( - pipeline, - resourceUri, - timeout, - metadata, - requestId)) + Azure.Core.Pipeline.DiagnosticScope _scope = pipeline.Diagnostics.CreateScope(operationName); + try + { + _scope.AddAttribute("url", resourceUri); + _scope.Start(); + using (Azure.Core.Http.Request _request = SetMetadataAsync_CreateRequest( + pipeline, + resourceUri, + timeout, + metadata, + requestId)) + { + Azure.Response _response = async ? + // Send the request asynchronously if we're being called via an async path + await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : + // Send the request synchronously through the API that blocks if we're being called via a sync path + // (this is safe because the Task will complete before the user can call Wait) + pipeline.SendRequest(_request, cancellationToken); + cancellationToken.ThrowIfCancellationRequested(); + return SetMetadataAsync_CreateResponse(_response); + } + } + catch (System.Exception ex) { - Azure.Response _response = async ? - // Send the request asynchronously if we're being called via an async path - await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : - // Send the request synchronously through the API that blocks if we're being called via a sync path - // (this is safe because the Task will complete before the user can call Wait) - pipeline.SendRequest(_request, cancellationToken); - cancellationToken.ThrowIfCancellationRequested(); - return SetMetadataAsync_CreateResponse(_response); + _scope.Failed(ex); + throw; + } + finally + { + _scope.Dispose(); } } @@ -948,6 +1084,7 @@ internal static Azure.Response SetMetadataAsync_CreateResponse( /// The The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Queue Service Operations. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// Whether to invoke the operation asynchronously. The default value is true. + /// Operation name. /// Cancellation token. /// a collection of signed identifiers public static async System.Threading.Tasks.Task>> GetAccessPolicyAsync( @@ -956,22 +1093,38 @@ internal static Azure.Response SetMetadataAsync_CreateResponse( int? timeout = default, string requestId = default, bool async = true, + string operationName = "Azure.Storage.Queues.QueueClient.GetAccessPolicy", System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.Request _request = GetAccessPolicyAsync_CreateRequest( - pipeline, - resourceUri, - timeout, - requestId)) + Azure.Core.Pipeline.DiagnosticScope _scope = pipeline.Diagnostics.CreateScope(operationName); + try { - Azure.Response _response = async ? - // Send the request asynchronously if we're being called via an async path - await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : - // Send the request synchronously through the API that blocks if we're being called via a sync path - // (this is safe because the Task will complete before the user can call Wait) - pipeline.SendRequest(_request, cancellationToken); - cancellationToken.ThrowIfCancellationRequested(); - return GetAccessPolicyAsync_CreateResponse(_response); + _scope.AddAttribute("url", resourceUri); + _scope.Start(); + using (Azure.Core.Http.Request _request = GetAccessPolicyAsync_CreateRequest( + pipeline, + resourceUri, + timeout, + requestId)) + { + Azure.Response _response = async ? + // Send the request asynchronously if we're being called via an async path + await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : + // Send the request synchronously through the API that blocks if we're being called via a sync path + // (this is safe because the Task will complete before the user can call Wait) + pipeline.SendRequest(_request, cancellationToken); + cancellationToken.ThrowIfCancellationRequested(); + return GetAccessPolicyAsync_CreateResponse(_response); + } + } + catch (System.Exception ex) + { + _scope.Failed(ex); + throw; + } + finally + { + _scope.Dispose(); } } @@ -1062,6 +1215,7 @@ internal static Azure.Core.Http.Request GetAccessPolicyAsync_CreateRequest( /// The The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Queue Service Operations. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// Whether to invoke the operation asynchronously. The default value is true. + /// Operation name. /// Cancellation token. /// Azure.Response public static async System.Threading.Tasks.Task SetAccessPolicyAsync( @@ -1071,23 +1225,39 @@ internal static Azure.Core.Http.Request GetAccessPolicyAsync_CreateRequest( int? timeout = default, string requestId = default, bool async = true, + string operationName = "Azure.Storage.Queues.QueueClient.SetAccessPolicy", System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.Request _request = SetAccessPolicyAsync_CreateRequest( - pipeline, - resourceUri, - permissions, - timeout, - requestId)) + Azure.Core.Pipeline.DiagnosticScope _scope = pipeline.Diagnostics.CreateScope(operationName); + try + { + _scope.AddAttribute("url", resourceUri); + _scope.Start(); + using (Azure.Core.Http.Request _request = SetAccessPolicyAsync_CreateRequest( + pipeline, + resourceUri, + permissions, + timeout, + requestId)) + { + Azure.Response _response = async ? + // Send the request asynchronously if we're being called via an async path + await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : + // Send the request synchronously through the API that blocks if we're being called via a sync path + // (this is safe because the Task will complete before the user can call Wait) + pipeline.SendRequest(_request, cancellationToken); + cancellationToken.ThrowIfCancellationRequested(); + return SetAccessPolicyAsync_CreateResponse(_response); + } + } + catch (System.Exception ex) { - Azure.Response _response = async ? - // Send the request asynchronously if we're being called via an async path - await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : - // Send the request synchronously through the API that blocks if we're being called via a sync path - // (this is safe because the Task will complete before the user can call Wait) - pipeline.SendRequest(_request, cancellationToken); - cancellationToken.ThrowIfCancellationRequested(); - return SetAccessPolicyAsync_CreateResponse(_response); + _scope.Failed(ex); + throw; + } + finally + { + _scope.Dispose(); } } @@ -1189,6 +1359,7 @@ public static partial class Messages /// The The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Queue Service Operations. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// Whether to invoke the operation asynchronously. The default value is true. + /// Operation name. /// Cancellation token. /// The object returned when calling Get Messages on a Queue public static async System.Threading.Tasks.Task>> DequeueAsync( @@ -1199,24 +1370,40 @@ public static partial class Messages int? timeout = default, string requestId = default, bool async = true, + string operationName = "Azure.Storage.Queues.MessagesClient.Dequeue", System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.Request _request = DequeueAsync_CreateRequest( - pipeline, - resourceUri, - numberOfMessages, - visibilitytimeout, - timeout, - requestId)) + Azure.Core.Pipeline.DiagnosticScope _scope = pipeline.Diagnostics.CreateScope(operationName); + try + { + _scope.AddAttribute("url", resourceUri); + _scope.Start(); + using (Azure.Core.Http.Request _request = DequeueAsync_CreateRequest( + pipeline, + resourceUri, + numberOfMessages, + visibilitytimeout, + timeout, + requestId)) + { + Azure.Response _response = async ? + // Send the request asynchronously if we're being called via an async path + await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : + // Send the request synchronously through the API that blocks if we're being called via a sync path + // (this is safe because the Task will complete before the user can call Wait) + pipeline.SendRequest(_request, cancellationToken); + cancellationToken.ThrowIfCancellationRequested(); + return DequeueAsync_CreateResponse(_response); + } + } + catch (System.Exception ex) { - Azure.Response _response = async ? - // Send the request asynchronously if we're being called via an async path - await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : - // Send the request synchronously through the API that blocks if we're being called via a sync path - // (this is safe because the Task will complete before the user can call Wait) - pipeline.SendRequest(_request, cancellationToken); - cancellationToken.ThrowIfCancellationRequested(); - return DequeueAsync_CreateResponse(_response); + _scope.Failed(ex); + throw; + } + finally + { + _scope.Dispose(); } } @@ -1311,6 +1498,7 @@ internal static Azure.Core.Http.Request DequeueAsync_CreateRequest( /// The The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Queue Service Operations. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// Whether to invoke the operation asynchronously. The default value is true. + /// Operation name. /// Cancellation token. /// Azure.Response public static async System.Threading.Tasks.Task ClearAsync( @@ -1319,22 +1507,38 @@ internal static Azure.Core.Http.Request DequeueAsync_CreateRequest( int? timeout = default, string requestId = default, bool async = true, + string operationName = "Azure.Storage.Queues.MessagesClient.Clear", System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.Request _request = ClearAsync_CreateRequest( - pipeline, - resourceUri, - timeout, - requestId)) + Azure.Core.Pipeline.DiagnosticScope _scope = pipeline.Diagnostics.CreateScope(operationName); + try + { + _scope.AddAttribute("url", resourceUri); + _scope.Start(); + using (Azure.Core.Http.Request _request = ClearAsync_CreateRequest( + pipeline, + resourceUri, + timeout, + requestId)) + { + Azure.Response _response = async ? + // Send the request asynchronously if we're being called via an async path + await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : + // Send the request synchronously through the API that blocks if we're being called via a sync path + // (this is safe because the Task will complete before the user can call Wait) + pipeline.SendRequest(_request, cancellationToken); + cancellationToken.ThrowIfCancellationRequested(); + return ClearAsync_CreateResponse(_response); + } + } + catch (System.Exception ex) { - Azure.Response _response = async ? - // Send the request asynchronously if we're being called via an async path - await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : - // Send the request synchronously through the API that blocks if we're being called via a sync path - // (this is safe because the Task will complete before the user can call Wait) - pipeline.SendRequest(_request, cancellationToken); - cancellationToken.ThrowIfCancellationRequested(); - return ClearAsync_CreateResponse(_response); + _scope.Failed(ex); + throw; + } + finally + { + _scope.Dispose(); } } @@ -1412,6 +1616,7 @@ internal static Azure.Response ClearAsync_CreateResponse( /// The The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Queue Service Operations. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// Whether to invoke the operation asynchronously. The default value is true. + /// Operation name. /// Cancellation token. /// The object returned when calling Put Message on a Queue public static async System.Threading.Tasks.Task>> EnqueueAsync( @@ -1423,25 +1628,41 @@ internal static Azure.Response ClearAsync_CreateResponse( int? timeout = default, string requestId = default, bool async = true, + string operationName = "Azure.Storage.Queues.MessagesClient.Enqueue", System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.Request _request = EnqueueAsync_CreateRequest( - pipeline, - resourceUri, - message, - visibilitytimeout, - messageTimeToLive, - timeout, - requestId)) + Azure.Core.Pipeline.DiagnosticScope _scope = pipeline.Diagnostics.CreateScope(operationName); + try + { + _scope.AddAttribute("url", resourceUri); + _scope.Start(); + using (Azure.Core.Http.Request _request = EnqueueAsync_CreateRequest( + pipeline, + resourceUri, + message, + visibilitytimeout, + messageTimeToLive, + timeout, + requestId)) + { + Azure.Response _response = async ? + // Send the request asynchronously if we're being called via an async path + await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : + // Send the request synchronously through the API that blocks if we're being called via a sync path + // (this is safe because the Task will complete before the user can call Wait) + pipeline.SendRequest(_request, cancellationToken); + cancellationToken.ThrowIfCancellationRequested(); + return EnqueueAsync_CreateResponse(_response); + } + } + catch (System.Exception ex) { - Azure.Response _response = async ? - // Send the request asynchronously if we're being called via an async path - await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : - // Send the request synchronously through the API that blocks if we're being called via a sync path - // (this is safe because the Task will complete before the user can call Wait) - pipeline.SendRequest(_request, cancellationToken); - cancellationToken.ThrowIfCancellationRequested(); - return EnqueueAsync_CreateResponse(_response); + _scope.Failed(ex); + throw; + } + finally + { + _scope.Dispose(); } } @@ -1550,6 +1771,7 @@ internal static Azure.Core.Http.Request EnqueueAsync_CreateRequest( /// The The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Queue Service Operations. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// Whether to invoke the operation asynchronously. The default value is true. + /// Operation name. /// Cancellation token. /// The object returned when calling Peek Messages on a Queue public static async System.Threading.Tasks.Task>> PeekAsync( @@ -1559,23 +1781,39 @@ internal static Azure.Core.Http.Request EnqueueAsync_CreateRequest( int? timeout = default, string requestId = default, bool async = true, + string operationName = "Azure.Storage.Queues.MessagesClient.Peek", System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.Request _request = PeekAsync_CreateRequest( - pipeline, - resourceUri, - numberOfMessages, - timeout, - requestId)) + Azure.Core.Pipeline.DiagnosticScope _scope = pipeline.Diagnostics.CreateScope(operationName); + try + { + _scope.AddAttribute("url", resourceUri); + _scope.Start(); + using (Azure.Core.Http.Request _request = PeekAsync_CreateRequest( + pipeline, + resourceUri, + numberOfMessages, + timeout, + requestId)) + { + Azure.Response _response = async ? + // Send the request asynchronously if we're being called via an async path + await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : + // Send the request synchronously through the API that blocks if we're being called via a sync path + // (this is safe because the Task will complete before the user can call Wait) + pipeline.SendRequest(_request, cancellationToken); + cancellationToken.ThrowIfCancellationRequested(); + return PeekAsync_CreateResponse(_response); + } + } + catch (System.Exception ex) { - Azure.Response _response = async ? - // Send the request asynchronously if we're being called via an async path - await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : - // Send the request synchronously through the API that blocks if we're being called via a sync path - // (this is safe because the Task will complete before the user can call Wait) - pipeline.SendRequest(_request, cancellationToken); - cancellationToken.ThrowIfCancellationRequested(); - return PeekAsync_CreateResponse(_response); + _scope.Failed(ex); + throw; + } + finally + { + _scope.Dispose(); } } @@ -1679,6 +1917,7 @@ public static partial class MessageId /// The The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Queue Service Operations. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// Whether to invoke the operation asynchronously. The default value is true. + /// Operation name. /// Cancellation token. /// Azure.Response{Azure.Storage.Queues.Models.UpdatedMessage} public static async System.Threading.Tasks.Task> UpdateAsync( @@ -1690,25 +1929,41 @@ public static partial class MessageId int? timeout = default, string requestId = default, bool async = true, + string operationName = "Azure.Storage.Queues.MessageIdClient.Update", System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.Request _request = UpdateAsync_CreateRequest( - pipeline, - resourceUri, - message, - popReceipt, - visibilitytimeout, - timeout, - requestId)) + Azure.Core.Pipeline.DiagnosticScope _scope = pipeline.Diagnostics.CreateScope(operationName); + try + { + _scope.AddAttribute("url", resourceUri); + _scope.Start(); + using (Azure.Core.Http.Request _request = UpdateAsync_CreateRequest( + pipeline, + resourceUri, + message, + popReceipt, + visibilitytimeout, + timeout, + requestId)) + { + Azure.Response _response = async ? + // Send the request asynchronously if we're being called via an async path + await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : + // Send the request synchronously through the API that blocks if we're being called via a sync path + // (this is safe because the Task will complete before the user can call Wait) + pipeline.SendRequest(_request, cancellationToken); + cancellationToken.ThrowIfCancellationRequested(); + return UpdateAsync_CreateResponse(_response); + } + } + catch (System.Exception ex) { - Azure.Response _response = async ? - // Send the request asynchronously if we're being called via an async path - await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : - // Send the request synchronously through the API that blocks if we're being called via a sync path - // (this is safe because the Task will complete before the user can call Wait) - pipeline.SendRequest(_request, cancellationToken); - cancellationToken.ThrowIfCancellationRequested(); - return UpdateAsync_CreateResponse(_response); + _scope.Failed(ex); + throw; + } + finally + { + _scope.Dispose(); } } @@ -1827,6 +2082,7 @@ internal static Azure.Core.Http.Request UpdateAsync_CreateRequest( /// The The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Queue Service Operations. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// Whether to invoke the operation asynchronously. The default value is true. + /// Operation name. /// Cancellation token. /// Azure.Response public static async System.Threading.Tasks.Task DeleteAsync( @@ -1836,23 +2092,39 @@ internal static Azure.Core.Http.Request UpdateAsync_CreateRequest( int? timeout = default, string requestId = default, bool async = true, + string operationName = "Azure.Storage.Queues.MessageIdClient.Delete", System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.Request _request = DeleteAsync_CreateRequest( - pipeline, - resourceUri, - popReceipt, - timeout, - requestId)) - { - Azure.Response _response = async ? - // Send the request asynchronously if we're being called via an async path - await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : - // Send the request synchronously through the API that blocks if we're being called via a sync path - // (this is safe because the Task will complete before the user can call Wait) - pipeline.SendRequest(_request, cancellationToken); - cancellationToken.ThrowIfCancellationRequested(); - return DeleteAsync_CreateResponse(_response); + Azure.Core.Pipeline.DiagnosticScope _scope = pipeline.Diagnostics.CreateScope(operationName); + try + { + _scope.AddAttribute("url", resourceUri); + _scope.Start(); + using (Azure.Core.Http.Request _request = DeleteAsync_CreateRequest( + pipeline, + resourceUri, + popReceipt, + timeout, + requestId)) + { + Azure.Response _response = async ? + // Send the request asynchronously if we're being called via an async path + await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(false) : + // Send the request synchronously through the API that blocks if we're being called via a sync path + // (this is safe because the Task will complete before the user can call Wait) + pipeline.SendRequest(_request, cancellationToken); + cancellationToken.ThrowIfCancellationRequested(); + return DeleteAsync_CreateResponse(_response); + } + } + catch (System.Exception ex) + { + _scope.Failed(ex); + throw; + } + finally + { + _scope.Dispose(); } } diff --git a/sdk/storage/Azure.Storage.Queues/src/QueueClient.cs b/sdk/storage/Azure.Storage.Queues/src/QueueClient.cs index a0246176a12ab..7bee4a38323f3 100644 --- a/sdk/storage/Azure.Storage.Queues/src/QueueClient.cs +++ b/sdk/storage/Azure.Storage.Queues/src/QueueClient.cs @@ -821,6 +821,7 @@ private async Task ClearMessagesInternal( this.Pipeline, this.MessagesUri, async: async, + operationName: "Azure.Storage.Queues.QueueClient.ClearMessages", cancellationToken: cancellationToken) .ConfigureAwait(false); } @@ -952,6 +953,7 @@ await QueueRestClient.Messages.EnqueueAsync( visibilitytimeout: (int?)visibilityTimeout?.TotalSeconds, messageTimeToLive: (int?)timeToLive?.TotalSeconds, async: async, + operationName: "Azure.Storage.Queues.QueueClient.EnqueueMessage", cancellationToken: cancellationToken) .ConfigureAwait(false); // The service returns a sequence of messages, but the @@ -1072,6 +1074,7 @@ private async Task>> DequeueMessagesIntern numberOfMessages: maxMessages, visibilitytimeout: (int?)visibilityTimeout?.TotalSeconds, async: async, + operationName: "Azure.Storage.Queues.QueueClient.DequeueMessages", cancellationToken: cancellationToken) .ConfigureAwait(false); } @@ -1171,6 +1174,7 @@ private async Task>> PeekMessagesInternal( this.MessagesUri, numberOfMessages: maxMessages, async: async, + operationName: "Azure.Storage.Queues.QueueClient.PeekMessages", cancellationToken: cancellationToken) .ConfigureAwait(false); } @@ -1284,6 +1288,7 @@ private async Task DeleteMessageInternal( uri, popReceipt: popReceipt, async: async, + operationName: "Azure.Storage.Queues.QueueClient.DeleteMessage", cancellationToken: cancellationToken) .ConfigureAwait(false); } @@ -1426,6 +1431,7 @@ private async Task> UpdateMessageInternal( popReceipt: popReceipt, visibilitytimeout: (int)visibilityTimeout.TotalSeconds, async: async, + operationName: "Azure.Storage.Queues.QueueClient.UpdateMessage", cancellationToken: cancellationToken) .ConfigureAwait(false); } diff --git a/sdk/storage/Azure.Storage.Queues/src/QueueServiceClient.cs b/sdk/storage/Azure.Storage.Queues/src/QueueServiceClient.cs index 3317954c45fa7..92dd200724e4c 100644 --- a/sdk/storage/Azure.Storage.Queues/src/QueueServiceClient.cs +++ b/sdk/storage/Azure.Storage.Queues/src/QueueServiceClient.cs @@ -590,6 +590,7 @@ private async Task> GetStatisticsInternal( /// /// A newly created . /// + [ForwardsClientCalls] public virtual Response CreateQueue( string queueName, IDictionary metadata = default, @@ -617,6 +618,7 @@ public virtual Response CreateQueue( /// /// A newly created . /// + [ForwardsClientCalls] public virtual async Task> CreateQueueAsync( string queueName, IDictionary metadata = default, @@ -643,6 +645,7 @@ public virtual async Task> CreateQueueAsync( /// /// /// + [ForwardsClientCalls] public virtual Response DeleteQueue( string queueName, CancellationToken cancellationToken = default) => @@ -662,6 +665,7 @@ public virtual Response DeleteQueue( /// /// /// + [ForwardsClientCalls] public virtual async Task DeleteQueueAsync( string queueName, CancellationToken cancellationToken = default) => diff --git a/sdk/storage/Azure.Storage.Queues/swagger/queue.json b/sdk/storage/Azure.Storage.Queues/swagger/queue.json index 012e15cff577d..2123834e4f1b1 100644 --- a/sdk/storage/Azure.Storage.Queues/swagger/queue.json +++ b/sdk/storage/Azure.Storage.Queues/swagger/queue.json @@ -1594,7 +1594,8 @@ "type": "string", "format": "url", "in": "path", - "x-ms-skip-url-encoding": true + "x-ms-skip-url-encoding": true, + "x-ms-trace": true }, "ApiVersionParameter": { "name": "x-ms-version",