diff --git a/common/ManagementCoreShared/ClientContext.cs b/common/ManagementCoreShared/ClientContext.cs index 3d155cc977543..5ac7d226aa55b 100644 --- a/common/ManagementCoreShared/ClientContext.cs +++ b/common/ManagementCoreShared/ClientContext.cs @@ -3,6 +3,7 @@ using System; using Azure.Core; +using Azure.Core.Pipeline; namespace Azure.ResourceManager.Core { diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/src/ApiVersions.cs b/sdk/resourcemanager/Azure.ResourceManager.Core/src/ApiVersions.cs index e4709fb347e9e..cab1678202a32 100644 --- a/sdk/resourcemanager/Azure.ResourceManager.Core/src/ApiVersions.cs +++ b/sdk/resourcemanager/Azure.ResourceManager.Core/src/ApiVersions.cs @@ -185,5 +185,24 @@ public void SetApiVersion(ResourceType resourceType, string apiVersion) _nonLoadedResourceToApiVersion[resourceType.ToString()] = apiVersion; } } + + internal ApiVersions Clone() + { + ApiVersions copy = new ApiVersions(_clientOptions); + copy.ProviderOperations = ProviderOperations; + + copy._loadedResourceToApiVersions = new Dictionary(); + foreach (var property in _loadedResourceToApiVersions) + { + copy._loadedResourceToApiVersions.Add(property.Key, property.Value); + } + + copy._nonLoadedResourceToApiVersion = new Dictionary(); + foreach (var property in _nonLoadedResourceToApiVersion) + { + copy._nonLoadedResourceToApiVersion.Add(property.Key, property.Value); + } + return copy; + } } } diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/src/ArmClient.cs b/sdk/resourcemanager/Azure.ResourceManager.Core/src/ArmClient.cs index f470ba1bac7eb..93e75815bc2c2 100644 --- a/sdk/resourcemanager/Azure.ResourceManager.Core/src/ArmClient.cs +++ b/sdk/resourcemanager/Azure.ResourceManager.Core/src/ArmClient.cs @@ -91,7 +91,7 @@ private ArmClient( if (credential is null) throw new ArgumentNullException(nameof(credential)); - ClientOptions = options ?? new ArmClientOptions(); + ClientOptions = options?.Clone() ?? new ArmClientOptions(); DefaultSubscription = string.IsNullOrWhiteSpace(defaultSubscriptionId) ? GetDefaultSubscription() : GetSubscriptions().TryGet(defaultSubscriptionId); diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/src/ArmClientOptions.cs b/sdk/resourcemanager/Azure.ResourceManager.Core/src/ArmClientOptions.cs index ab1ff49ced015..76d72ad712a1d 100644 --- a/sdk/resourcemanager/Azure.ResourceManager.Core/src/ArmClientOptions.cs +++ b/sdk/resourcemanager/Azure.ResourceManager.Core/src/ArmClientOptions.cs @@ -23,7 +23,7 @@ public sealed class ArmClientOptions : ClientOptions /// /// Gets the ApiVersions object /// - public ApiVersions ApiVersions { get; } + public ApiVersions ApiVersions { get; private set; } /// /// Initializes a new instance of the class. @@ -53,18 +53,31 @@ internal ArmClientOptions(LocationData defaultLocation, ArmClientOptions other = if (defaultLocation is null) throw new ArgumentNullException(nameof(defaultLocation)); - // Will go away when moved into core since we will have directy acces the policies and transport, so just need to set those + // Will go away when moved into core since we will have directly access the policies and transport, so just need to set those if (!ReferenceEquals(other, null)) Copy(other); DefaultLocation = defaultLocation; - ApiVersionOverrides = new Dictionary(); ApiVersions = new ApiVersions(this); } - /// - /// Gets the Api version overrides. - /// - public Dictionary ApiVersionOverrides { get; private set; } + private ArmClientOptions(LocationData location, IList perCallPolicies, IList perRetryPolicies) + { + if (location is null) + throw new ArgumentNullException(nameof(location)); + + DefaultLocation = location; + PerCallPolicies = new List(); + foreach (var call in perCallPolicies) + { + PerCallPolicies.Add(call); + } + PerRetryPolicies = new List(); + foreach (var retry in perRetryPolicies) + { + PerCallPolicies.Add(retry); + } + ApiVersions = new ApiVersions(this); + } /// /// Gets the default location to use if can't be inherited from parent. @@ -163,5 +176,13 @@ private void Copy(ArmClientOptions other) AddPolicy(pol, HttpPipelinePosition.PerRetry); } } + + internal ArmClientOptions Clone() + { + ArmClientOptions copy = new ArmClientOptions(DefaultLocation, PerCallPolicies, PerRetryPolicies); + copy.ApiVersions = ApiVersions.Clone(); + copy.Transport = Transport; + return copy; + } } } diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/src/GenericResourceOperations.cs b/sdk/resourcemanager/Azure.ResourceManager.Core/src/GenericResourceOperations.cs index 185201af7588e..cd23bc129417d 100644 --- a/sdk/resourcemanager/Azure.ResourceManager.Core/src/GenericResourceOperations.cs +++ b/sdk/resourcemanager/Azure.ResourceManager.Core/src/GenericResourceOperations.cs @@ -105,8 +105,9 @@ public ArmResponse AddTag(string key, string value, Cancellatio GenericResource resource = GetResource(); // Potential optimization on tags set, remove NOOP to bypass the call. resource.Data.Tags[key] = value; + var apiVersion = GetApiVersion(cancellationToken); return new PhArmResponse( - Operations.StartUpdateById(Id, GetApiVersion(cancellationToken), resource.Data, cancellationToken).WaitForCompletionAsync(cancellationToken).EnsureCompleted(), + Operations.StartUpdateById(Id, apiVersion, resource.Data, cancellationToken).WaitForCompletionAsync(cancellationToken).EnsureCompleted(), v => new GenericResource(this, new GenericResourceData(v))); } @@ -115,7 +116,8 @@ public async Task> AddTagAsync(string key, string v { GenericResource resource = await GetResourceAsync(cancellationToken).ConfigureAwait(false); resource.Data.Tags[key] = value; - var op = await Operations.StartUpdateByIdAsync(Id, await GetApiVersionAsync(cancellationToken).ConfigureAwait(false), resource.Data, cancellationToken).ConfigureAwait(false); + var apiVersion = await GetApiVersionAsync(cancellationToken).ConfigureAwait(false); + var op = await Operations.StartUpdateByIdAsync(Id, apiVersion, resource.Data, cancellationToken).ConfigureAwait(false); return new PhArmResponse( await op.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false), v => new GenericResource(this, new GenericResourceData(v))); @@ -126,8 +128,9 @@ public ArmOperation StartAddTag(string key, string value, Cance { GenericResource resource = GetResource(); resource.Data.Tags[key] = value; + var apiVersion = GetApiVersion(cancellationToken); return new PhArmOperation( - Operations.StartUpdateById(Id, GetApiVersion(cancellationToken), resource.Data, cancellationToken).WaitForCompletionAsync(cancellationToken).EnsureCompleted(), + Operations.StartUpdateById(Id, apiVersion, resource.Data, cancellationToken).WaitForCompletionAsync(cancellationToken).EnsureCompleted(), v => new GenericResource(this, new GenericResourceData(v))); } @@ -136,7 +139,8 @@ public async Task> StartAddTagAsync(string key, st { GenericResource resource = await GetResourceAsync(cancellationToken).ConfigureAwait(false); resource.Data.Tags[key] = value; - var op = await Operations.StartUpdateByIdAsync(Id, await GetApiVersionAsync(cancellationToken).ConfigureAwait(false), resource.Data, cancellationToken).ConfigureAwait(false); + var apiVersion = await GetApiVersionAsync(cancellationToken).ConfigureAwait(false); + var op = await Operations.StartUpdateByIdAsync(Id, apiVersion, resource.Data, cancellationToken).ConfigureAwait(false); return new PhArmOperation( await op.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false), v => new GenericResource(this, new GenericResourceData(v))); @@ -145,16 +149,18 @@ await op.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false), /// public override ArmResponse Get(CancellationToken cancellationToken = default) { + var apiVersion = GetApiVersion(cancellationToken); return new PhArmResponse( - Operations.GetById(Id, GetApiVersion(cancellationToken), cancellationToken), + Operations.GetById(Id, apiVersion, cancellationToken), v => new GenericResource(this, new GenericResourceData(v))); } /// public override async Task> GetAsync(CancellationToken cancellationToken = default) { + var apiVersion = await GetApiVersionAsync(cancellationToken).ConfigureAwait(false); return new PhArmResponse( - await Operations.GetByIdAsync(Id, await GetApiVersionAsync(cancellationToken).ConfigureAwait(false), cancellationToken).ConfigureAwait(false), + await Operations.GetByIdAsync(Id, apiVersion, cancellationToken).ConfigureAwait(false), v => new GenericResource(this, new GenericResourceData(v))); } @@ -173,8 +179,9 @@ public ArmResponse SetTags(IDictionary tags, Ca { GenericResource resource = GetResource(); resource.Data.Tags.ReplaceWith(tags); + var apiVersion = GetApiVersion(cancellationToken); return new PhArmResponse( - Operations.StartUpdateById(Id, GetApiVersion(cancellationToken), resource.Data, cancellationToken).WaitForCompletionAsync(cancellationToken).EnsureCompleted(), + Operations.StartUpdateById(Id, apiVersion, resource.Data, cancellationToken).WaitForCompletionAsync(cancellationToken).EnsureCompleted(), v => new GenericResource(this, new GenericResourceData(v))); } @@ -183,7 +190,8 @@ public async Task> SetTagsAsync(IDictionary( await op.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false), v => new GenericResource(this, new GenericResourceData(v))); @@ -194,8 +202,9 @@ public ArmOperation StartSetTags(IDictionary ta { GenericResource resource = GetResource(); resource.Data.Tags.ReplaceWith(tags); + var apiVersion = GetApiVersion(cancellationToken); return new PhArmOperation( - Operations.StartUpdateById(Id, GetApiVersion(cancellationToken), resource.Data, cancellationToken).WaitForCompletionAsync(cancellationToken).EnsureCompleted(), + Operations.StartUpdateById(Id, apiVersion, resource.Data, cancellationToken).WaitForCompletionAsync(cancellationToken).EnsureCompleted(), v => new GenericResource(this, new GenericResourceData(v))); } @@ -204,7 +213,8 @@ public async Task> StartSetTagsAsync(IDictionary( await op.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false), v => new GenericResource(this, new GenericResourceData(v))); @@ -215,8 +225,9 @@ public ArmResponse RemoveTag(string key, CancellationToken canc { GenericResource resource = GetResource(); resource.Data.Tags.Remove(key); + var apiVersion = GetApiVersion(cancellationToken); return new PhArmResponse( - Operations.StartUpdateById(Id, GetApiVersion(cancellationToken), resource.Data, cancellationToken).WaitForCompletionAsync(cancellationToken).EnsureCompleted(), + Operations.StartUpdateById(Id, apiVersion, resource.Data, cancellationToken).WaitForCompletionAsync(cancellationToken).EnsureCompleted(), v => new GenericResource(this, new GenericResourceData(v))); } @@ -225,7 +236,8 @@ public async Task> RemoveTagAsync(string key, Cance { GenericResource resource = await GetResourceAsync(cancellationToken).ConfigureAwait(false); resource.Data.Tags.Remove(key); - var op = await Operations.StartUpdateByIdAsync(Id, await GetApiVersionAsync(cancellationToken).ConfigureAwait(false), resource.Data, cancellationToken).ConfigureAwait(false); + var apiVersion = await GetApiVersionAsync(cancellationToken).ConfigureAwait(false); + var op = await Operations.StartUpdateByIdAsync(Id, apiVersion, resource.Data, cancellationToken).ConfigureAwait(false); return new PhArmResponse( await op.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false), v => new GenericResource(this, new GenericResourceData(v))); @@ -236,8 +248,9 @@ public ArmOperation StartRemoveTag(string key, CancellationToke { GenericResource resource = GetResource(); resource.Data.Tags.Remove(key); + var apiVersion = GetApiVersion(cancellationToken); return new PhArmOperation( - Operations.StartUpdateById(Id, GetApiVersion(cancellationToken), resource.Data, cancellationToken).WaitForCompletionAsync(cancellationToken).EnsureCompleted(), + Operations.StartUpdateById(Id, apiVersion, resource.Data, cancellationToken).WaitForCompletionAsync(cancellationToken).EnsureCompleted(), v => new GenericResource(this, new GenericResourceData(v))); } @@ -246,7 +259,8 @@ public async Task> StartRemoveTagAsync(string key, { GenericResource resource = await GetResourceAsync(cancellationToken).ConfigureAwait(false); resource.Data.Tags.Remove(key); - var op = await Operations.StartUpdateByIdAsync(Id, await GetApiVersionAsync(cancellationToken).ConfigureAwait(false), resource.Data, cancellationToken).ConfigureAwait(false); + var apiVersion = await GetApiVersionAsync(cancellationToken).ConfigureAwait(false); + var op = await Operations.StartUpdateByIdAsync(Id, apiVersion, resource.Data, cancellationToken).ConfigureAwait(false); return new PhArmOperation( await op.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false), v => new GenericResource(this, new GenericResourceData(v))); diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/src/OperationsBase.cs b/sdk/resourcemanager/Azure.ResourceManager.Core/src/OperationsBase.cs index 77534e2ef82e9..ce6e75437012c 100644 --- a/sdk/resourcemanager/Azure.ResourceManager.Core/src/OperationsBase.cs +++ b/sdk/resourcemanager/Azure.ResourceManager.Core/src/OperationsBase.cs @@ -32,6 +32,7 @@ internal OperationsBase(ClientContext clientContext, ResourceIdentifier id) Credential = clientContext.Credential; BaseUri = clientContext.BaseUri; Diagnostics = new ClientDiagnostics(ClientOptions); + Validate(id); } diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/tests/Scenario/ClientContextTests.cs b/sdk/resourcemanager/Azure.ResourceManager.Core/tests/Scenario/ClientContextTests.cs index c9ba3617138c1..b1fd4433c21c3 100644 --- a/sdk/resourcemanager/Azure.ResourceManager.Core/tests/Scenario/ClientContextTests.cs +++ b/sdk/resourcemanager/Azure.ResourceManager.Core/tests/Scenario/ClientContextTests.cs @@ -27,20 +27,15 @@ public async Task TestClientContextPolicy() var client1 = GetArmClient(options1); Console.WriteLine("-----Client 1-----"); - await foreach (var sub in client1.GetSubscriptions().ListAsync()) - { - Console.WriteLine($"Check 1: Found {sub.Data.DisplayName}"); - } + _ = await client1.DefaultSubscription.GetResourceGroups().Construct(LocationData.WestUS2).CreateOrUpdateAsync(Recording.GenerateAssetName("testrg")); Assert.AreEqual(2, dummyPolicy1.numMsgGot); options1.AddPolicy(dummyPolicy2, HttpPipelinePosition.PerCall); - await foreach (var sub in client1.GetSubscriptions().ListAsync()) - { - Console.WriteLine($"Check 2: Found {sub.Data.DisplayName}"); - } + _ = await client1.DefaultSubscription.GetResourceGroups().Construct(LocationData.WestUS2).CreateOrUpdateAsync(Recording.GenerateAssetName("test2Rg-")); + Assert.AreEqual(3, dummyPolicy1.numMsgGot); - //Assert.AreEqual(0, dummyPolicy2.numMsgGot); uncomment for ADO #5572 + Assert.AreEqual(0, dummyPolicy2.numMsgGot); } private class dummyPolicy : HttpPipelineSynchronousPolicy @@ -62,5 +57,28 @@ public override void OnReceivedResponse(HttpMessage message) Interlocked.Add(ref numMsgGot, 2); } } + + [TestCase] + [RecordedTest] + public void ValidateOptionsTestLocation() + { + var x = new ArmClientOptions(); + var y = x.Clone(); + Assert.IsTrue(ReferenceEquals(x.DefaultLocation, y.DefaultLocation)); + } + + [TestCase] + [RecordedTest] + public void ValidateOptionsTestApiVersions() + { + var x = new ArmClientOptions(); + var y = x.Clone(); + Assert.IsFalse(ReferenceEquals(x.ApiVersions, y.ApiVersions)); + Assert.AreEqual(x.ApiVersions.TryGetApiVersion("{Microsoft.Resources/subscriptions/resourceGroups}"), y.ApiVersions.TryGetApiVersion("{Microsoft.Resources/subscriptions/resourceGroups}")); + + x.ApiVersions.SetApiVersion("{Microsoft.Resources/subscriptions/resourceGroups}", "1500-10-10"); + Assert.IsFalse(ReferenceEquals(x.ApiVersions, y.ApiVersions)); + Assert.AreNotEqual(x.ApiVersions, y.ApiVersions); + } } } diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/ArmClientOptionsTests/MultiClientSeparateVersions().json b/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/ArmClientOptionsTests/MultiClientSeparateVersions().json new file mode 100644 index 0000000000000..2c834817f5d5b --- /dev/null +++ b/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/ArmClientOptionsTests/MultiClientSeparateVersions().json @@ -0,0 +1,52 @@ +{ + "Entries": [ + { + "RequestUri": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c?api-version=2019-11-01", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": [ + "azsdk-net-ResourceManager.Resources/1.0.0-preview.2", + "(.NET Core 4.6.29812.02; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "099919ee9991164e5a30c175fb11f871", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "397", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 09 Apr 2021 19:42:05 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "c1c40e96-f821-4aea-84a4-4639310c7dba", + "x-ms-ratelimit-remaining-subscription-reads": "11996", + "x-ms-request-id": "c1c40e96-f821-4aea-84a4-4639310c7dba", + "x-ms-routing-request-id": "WESTUS:20210409T194205Z:c1c40e96-f821-4aea-84a4-4639310c7dba" + }, + "ResponseBody": { + "id": "/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c", + "authorizationSource": "RoleBased", + "managedByTenants": [], + "subscriptionId": "db1ab6f0-4769-4b27-930e-01e2ef9c123c", + "tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47", + "displayName": "Azure SDK sandbox", + "state": "Enabled", + "subscriptionPolicies": { + "locationPlacementId": "Internal_2014-09-01", + "quotaId": "Internal_2014-09-01", + "spendingLimit": "Off" + } + } + } + ], + "Variables": { + "RandomSeed": "919451465", + "SUBSCRIPTION_ID": "db1ab6f0-4769-4b27-930e-01e2ef9c123c" + } +} \ No newline at end of file diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/ArmClientOptionsTests/MultiClientSeparateVersions()Async.json b/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/ArmClientOptionsTests/MultiClientSeparateVersions()Async.json new file mode 100644 index 0000000000000..289f769727ae1 --- /dev/null +++ b/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/ArmClientOptionsTests/MultiClientSeparateVersions()Async.json @@ -0,0 +1,52 @@ +{ + "Entries": [ + { + "RequestUri": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c?api-version=2019-11-01", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": [ + "azsdk-net-ResourceManager.Resources/1.0.0-preview.2", + "(.NET Core 4.6.29812.02; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "70f6b0e8b5c9f7be442a46a63e608bdd", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "397", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 09 Apr 2021 19:42:05 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "8fa47380-4ee2-463d-9b30-b5cd573076bb", + "x-ms-ratelimit-remaining-subscription-reads": "11998", + "x-ms-request-id": "8fa47380-4ee2-463d-9b30-b5cd573076bb", + "x-ms-routing-request-id": "WESTUS:20210409T194205Z:8fa47380-4ee2-463d-9b30-b5cd573076bb" + }, + "ResponseBody": { + "id": "/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c", + "authorizationSource": "RoleBased", + "managedByTenants": [], + "subscriptionId": "db1ab6f0-4769-4b27-930e-01e2ef9c123c", + "tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47", + "displayName": "Azure SDK sandbox", + "state": "Enabled", + "subscriptionPolicies": { + "locationPlacementId": "Internal_2014-09-01", + "quotaId": "Internal_2014-09-01", + "spendingLimit": "Off" + } + } + } + ], + "Variables": { + "RandomSeed": "2109135430", + "SUBSCRIPTION_ID": "db1ab6f0-4769-4b27-930e-01e2ef9c123c" + } +} \ No newline at end of file diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/ArmClientOptionsTests/TestClientOptionsParamCheck().json b/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/ArmClientOptionsTests/TestClientOptionsParamCheck().json new file mode 100644 index 0000000000000..387b3d6719ebf --- /dev/null +++ b/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/ArmClientOptionsTests/TestClientOptionsParamCheck().json @@ -0,0 +1,53 @@ +{ + "Entries": [ + { + "RequestUri": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c?api-version=2019-11-01", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "Request-Id": "|852fdfd3-4c97a68acea18ff5.", + "User-Agent": [ + "azsdk-net-ResourceManager.Resources/1.0.0-preview.2", + "(.NET Core 4.6.29812.02; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "a632fe16e604e1afe3a72e944145efec", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "397", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 09 Apr 2021 20:34:25 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "be780178-1313-4692-a54e-a633d8592622", + "x-ms-ratelimit-remaining-subscription-reads": "11996", + "x-ms-request-id": "be780178-1313-4692-a54e-a633d8592622", + "x-ms-routing-request-id": "WESTUS:20210409T203425Z:be780178-1313-4692-a54e-a633d8592622" + }, + "ResponseBody": { + "id": "/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c", + "authorizationSource": "RoleBased", + "managedByTenants": [], + "subscriptionId": "db1ab6f0-4769-4b27-930e-01e2ef9c123c", + "tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47", + "displayName": "Azure SDK sandbox", + "state": "Enabled", + "subscriptionPolicies": { + "locationPlacementId": "Internal_2014-09-01", + "quotaId": "Internal_2014-09-01", + "spendingLimit": "Off" + } + } + } + ], + "Variables": { + "RandomSeed": "1093016711", + "SUBSCRIPTION_ID": "db1ab6f0-4769-4b27-930e-01e2ef9c123c" + } +} \ No newline at end of file diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/ArmClientOptionsTests/TestClientOptionsParamCheck()Async.json b/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/ArmClientOptionsTests/TestClientOptionsParamCheck()Async.json new file mode 100644 index 0000000000000..b85a1112f6a9b --- /dev/null +++ b/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/ArmClientOptionsTests/TestClientOptionsParamCheck()Async.json @@ -0,0 +1,53 @@ +{ + "Entries": [ + { + "RequestUri": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c?api-version=2019-11-01", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "Request-Id": "|852fdfd4-4c97a68acea18ff5.", + "User-Agent": [ + "azsdk-net-ResourceManager.Resources/1.0.0-preview.2", + "(.NET Core 4.6.29812.02; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "a632fe16e604e1afe3a72e944145efec", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "397", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 09 Apr 2021 20:34:24 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "9974c9c1-dd06-4f61-81fc-84e6feceff95", + "x-ms-ratelimit-remaining-subscription-reads": "11948", + "x-ms-request-id": "9974c9c1-dd06-4f61-81fc-84e6feceff95", + "x-ms-routing-request-id": "WESTUS:20210409T203425Z:9974c9c1-dd06-4f61-81fc-84e6feceff95" + }, + "ResponseBody": { + "id": "/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c", + "authorizationSource": "RoleBased", + "managedByTenants": [], + "subscriptionId": "db1ab6f0-4769-4b27-930e-01e2ef9c123c", + "tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47", + "displayName": "Azure SDK sandbox", + "state": "Enabled", + "subscriptionPolicies": { + "locationPlacementId": "Internal_2014-09-01", + "quotaId": "Internal_2014-09-01", + "spendingLimit": "Off" + } + } + } + ], + "Variables": { + "RandomSeed": "1093016711", + "SUBSCRIPTION_ID": "db1ab6f0-4769-4b27-930e-01e2ef9c123c" + } +} \ No newline at end of file diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/ArmClientOptionsTests/TestKeyDoesNotExist().json b/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/ArmClientOptionsTests/TestKeyDoesNotExist().json new file mode 100644 index 0000000000000..c2b4fb4252939 --- /dev/null +++ b/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/ArmClientOptionsTests/TestKeyDoesNotExist().json @@ -0,0 +1,53 @@ +{ + "Entries": [ + { + "RequestUri": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c?api-version=2019-11-01", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "traceparent": "00-911d6bde15655140b0edb797d22931c7-9b94005be149af4a-00", + "User-Agent": [ + "azsdk-net-ResourceManager.Resources/1.0.0-preview.2", + "(.NET Core 4.6.29812.02; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "f0bf4d18430e5cdc35e9c020df221ff9", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "397", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 09 Apr 2021 20:34:24 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "9805099a-ef23-45e1-9af0-fb079959b0c0", + "x-ms-ratelimit-remaining-subscription-reads": "11947", + "x-ms-request-id": "9805099a-ef23-45e1-9af0-fb079959b0c0", + "x-ms-routing-request-id": "WESTUS:20210409T203425Z:9805099a-ef23-45e1-9af0-fb079959b0c0" + }, + "ResponseBody": { + "id": "/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c", + "authorizationSource": "RoleBased", + "managedByTenants": [], + "subscriptionId": "db1ab6f0-4769-4b27-930e-01e2ef9c123c", + "tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47", + "displayName": "Azure SDK sandbox", + "state": "Enabled", + "subscriptionPolicies": { + "locationPlacementId": "Internal_2014-09-01", + "quotaId": "Internal_2014-09-01", + "spendingLimit": "Off" + } + } + } + ], + "Variables": { + "RandomSeed": "1055663228", + "SUBSCRIPTION_ID": "db1ab6f0-4769-4b27-930e-01e2ef9c123c" + } +} \ No newline at end of file diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/ArmClientOptionsTests/TestKeyDoesNotExist()Async.json b/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/ArmClientOptionsTests/TestKeyDoesNotExist()Async.json new file mode 100644 index 0000000000000..5f2e83b56b0bb --- /dev/null +++ b/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/ArmClientOptionsTests/TestKeyDoesNotExist()Async.json @@ -0,0 +1,53 @@ +{ + "Entries": [ + { + "RequestUri": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c?api-version=2019-11-01", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "traceparent": "00-0a106ecef7be5e43be0f2105bd0a87d0-0e2b99ce9db0d544-00", + "User-Agent": [ + "azsdk-net-ResourceManager.Resources/1.0.0-preview.2", + "(.NET Core 4.6.29812.02; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "66d84677842b609e7e92acc4637d64c5", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "397", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 09 Apr 2021 20:34:24 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "2eec3fc0-9133-47d4-8154-49df4a8353b0", + "x-ms-ratelimit-remaining-subscription-reads": "11973", + "x-ms-request-id": "2eec3fc0-9133-47d4-8154-49df4a8353b0", + "x-ms-routing-request-id": "WESTUS:20210409T203425Z:2eec3fc0-9133-47d4-8154-49df4a8353b0" + }, + "ResponseBody": { + "id": "/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c", + "authorizationSource": "RoleBased", + "managedByTenants": [], + "subscriptionId": "db1ab6f0-4769-4b27-930e-01e2ef9c123c", + "tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47", + "displayName": "Azure SDK sandbox", + "state": "Enabled", + "subscriptionPolicies": { + "locationPlacementId": "Internal_2014-09-01", + "quotaId": "Internal_2014-09-01", + "spendingLimit": "Off" + } + } + } + ], + "Variables": { + "RandomSeed": "1242934982", + "SUBSCRIPTION_ID": "db1ab6f0-4769-4b27-930e-01e2ef9c123c" + } +} \ No newline at end of file diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/ArmClientOptionsTests/TestTransportInClone().json b/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/ArmClientOptionsTests/TestTransportInClone().json new file mode 100644 index 0000000000000..6fdefed7b76f3 --- /dev/null +++ b/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/ArmClientOptionsTests/TestTransportInClone().json @@ -0,0 +1,98 @@ +{ + "Entries": [ + { + "RequestUri": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c?api-version=2019-11-01", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "traceparent": "00-1e7614cc78e07b4a9417c65a5acaf4bc-2bb601e42909d748-00", + "User-Agent": [ + "azsdk-net-ResourceManager.Resources/1.0.0-preview.2", + "(.NET Core 4.6.29812.02; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "4026b55fb4905c94a85957ced50468ec", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "397", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 09 Apr 2021 00:54:51 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "fa15b941-0158-44ca-9852-b23ad55103e8", + "x-ms-ratelimit-remaining-subscription-reads": "11995", + "x-ms-request-id": "fa15b941-0158-44ca-9852-b23ad55103e8", + "x-ms-routing-request-id": "WESTUS:20210409T005452Z:fa15b941-0158-44ca-9852-b23ad55103e8" + }, + "ResponseBody": { + "id": "/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c", + "authorizationSource": "RoleBased", + "managedByTenants": [], + "subscriptionId": "db1ab6f0-4769-4b27-930e-01e2ef9c123c", + "tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47", + "displayName": "Azure SDK sandbox", + "state": "Enabled", + "subscriptionPolicies": { + "locationPlacementId": "Internal_2014-09-01", + "quotaId": "Internal_2014-09-01", + "spendingLimit": "Off" + } + } + }, + { + "RequestUri": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c?api-version=2019-11-01", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "traceparent": "00-511fbd2a25051f4cbc7989aa8e374acc-463e1b489af6d347-00", + "User-Agent": [ + "azsdk-net-ResourceManager.Resources/1.0.0-preview.2", + "(.NET Core 4.6.29812.02; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "37387da285dc777ac797e018b749f770", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "397", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 09 Apr 2021 00:54:51 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "25acb2c3-1cac-4754-8c02-2f62ab80d5e3", + "x-ms-ratelimit-remaining-subscription-reads": "11994", + "x-ms-request-id": "25acb2c3-1cac-4754-8c02-2f62ab80d5e3", + "x-ms-routing-request-id": "WESTUS:20210409T005452Z:25acb2c3-1cac-4754-8c02-2f62ab80d5e3" + }, + "ResponseBody": { + "id": "/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c", + "authorizationSource": "RoleBased", + "managedByTenants": [], + "subscriptionId": "db1ab6f0-4769-4b27-930e-01e2ef9c123c", + "tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47", + "displayName": "Azure SDK sandbox", + "state": "Enabled", + "subscriptionPolicies": { + "locationPlacementId": "Internal_2014-09-01", + "quotaId": "Internal_2014-09-01", + "spendingLimit": "Off" + } + } + } + ], + "Variables": { + "RandomSeed": "7388731", + "SUBSCRIPTION_ID": "db1ab6f0-4769-4b27-930e-01e2ef9c123c" + } +} \ No newline at end of file diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/ArmClientOptionsTests/TestTransportInClone()Async.json b/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/ArmClientOptionsTests/TestTransportInClone()Async.json new file mode 100644 index 0000000000000..01b1987e24776 --- /dev/null +++ b/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/ArmClientOptionsTests/TestTransportInClone()Async.json @@ -0,0 +1,98 @@ +{ + "Entries": [ + { + "RequestUri": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c?api-version=2019-11-01", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "traceparent": "00-814c39b7f5224246b1c66e729981b3b4-3afa7b15dab72948-00", + "User-Agent": [ + "azsdk-net-ResourceManager.Resources/1.0.0-preview.2", + "(.NET Core 4.6.29812.02; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "8bc19e9a2c058cbb18762394b11fae9e", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "397", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 09 Apr 2021 00:54:51 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "00159b3c-e0b7-4f7f-8e75-663207136115", + "x-ms-ratelimit-remaining-subscription-reads": "11996", + "x-ms-request-id": "00159b3c-e0b7-4f7f-8e75-663207136115", + "x-ms-routing-request-id": "WESTUS:20210409T005452Z:00159b3c-e0b7-4f7f-8e75-663207136115" + }, + "ResponseBody": { + "id": "/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c", + "authorizationSource": "RoleBased", + "managedByTenants": [], + "subscriptionId": "db1ab6f0-4769-4b27-930e-01e2ef9c123c", + "tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47", + "displayName": "Azure SDK sandbox", + "state": "Enabled", + "subscriptionPolicies": { + "locationPlacementId": "Internal_2014-09-01", + "quotaId": "Internal_2014-09-01", + "spendingLimit": "Off" + } + } + }, + { + "RequestUri": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c?api-version=2019-11-01", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "traceparent": "00-4df4ef1269447f4881b021ed81f94d25-6021216b448ff149-00", + "User-Agent": [ + "azsdk-net-ResourceManager.Resources/1.0.0-preview.2", + "(.NET Core 4.6.29812.02; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "66ec1dd564b06296913ecf3ff11c279d", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "397", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 09 Apr 2021 00:54:51 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "05dd54f0-1eb5-46d2-beb4-ff623becba72", + "x-ms-ratelimit-remaining-subscription-reads": "11995", + "x-ms-request-id": "05dd54f0-1eb5-46d2-beb4-ff623becba72", + "x-ms-routing-request-id": "WESTUS:20210409T005452Z:05dd54f0-1eb5-46d2-beb4-ff623becba72" + }, + "ResponseBody": { + "id": "/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c", + "authorizationSource": "RoleBased", + "managedByTenants": [], + "subscriptionId": "db1ab6f0-4769-4b27-930e-01e2ef9c123c", + "tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47", + "displayName": "Azure SDK sandbox", + "state": "Enabled", + "subscriptionPolicies": { + "locationPlacementId": "Internal_2014-09-01", + "quotaId": "Internal_2014-09-01", + "spendingLimit": "Off" + } + } + } + ], + "Variables": { + "RandomSeed": "2067438399", + "SUBSCRIPTION_ID": "db1ab6f0-4769-4b27-930e-01e2ef9c123c" + } +} \ No newline at end of file diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/ArmClientOptionsTests/ValidateClone().json b/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/ArmClientOptionsTests/ValidateClone().json new file mode 100644 index 0000000000000..afb4606aab949 --- /dev/null +++ b/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/ArmClientOptionsTests/ValidateClone().json @@ -0,0 +1,53 @@ +{ + "Entries": [ + { + "RequestUri": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c?api-version=2019-11-01", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "traceparent": "00-89a576a49f49fe41ae89a0bb5fb0d8a4-ed807c4bcbebca41-00", + "User-Agent": [ + "azsdk-net-ResourceManager.Resources/1.0.0-preview.2", + "(.NET Core 4.6.29812.02; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "952287e44bafc850837cc5142965fc3c", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "397", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 09 Apr 2021 00:54:52 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "11ae1482-54f4-450c-be6d-3ef6e1092887", + "x-ms-ratelimit-remaining-subscription-reads": "11994", + "x-ms-request-id": "11ae1482-54f4-450c-be6d-3ef6e1092887", + "x-ms-routing-request-id": "WESTUS:20210409T005452Z:11ae1482-54f4-450c-be6d-3ef6e1092887" + }, + "ResponseBody": { + "id": "/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c", + "authorizationSource": "RoleBased", + "managedByTenants": [], + "subscriptionId": "db1ab6f0-4769-4b27-930e-01e2ef9c123c", + "tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47", + "displayName": "Azure SDK sandbox", + "state": "Enabled", + "subscriptionPolicies": { + "locationPlacementId": "Internal_2014-09-01", + "quotaId": "Internal_2014-09-01", + "spendingLimit": "Off" + } + } + } + ], + "Variables": { + "RandomSeed": "1175631747", + "SUBSCRIPTION_ID": "db1ab6f0-4769-4b27-930e-01e2ef9c123c" + } +} \ No newline at end of file diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/ArmClientOptionsTests/ValidateClone()Async.json b/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/ArmClientOptionsTests/ValidateClone()Async.json new file mode 100644 index 0000000000000..5d1a07055ef92 --- /dev/null +++ b/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/ArmClientOptionsTests/ValidateClone()Async.json @@ -0,0 +1,53 @@ +{ + "Entries": [ + { + "RequestUri": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c?api-version=2019-11-01", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "traceparent": "00-f64fe15d72e6b64a8bf61c29799cd2c0-6ae762eb510c4541-00", + "User-Agent": [ + "azsdk-net-ResourceManager.Resources/1.0.0-preview.2", + "(.NET Core 4.6.29812.02; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "cb818bbb68a45acf5450c147f524b6b0", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "397", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 09 Apr 2021 00:54:52 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "a82f6ac9-09dd-472e-82f0-80392c70d6bb", + "x-ms-ratelimit-remaining-subscription-reads": "11989", + "x-ms-request-id": "a82f6ac9-09dd-472e-82f0-80392c70d6bb", + "x-ms-routing-request-id": "WESTUS:20210409T005452Z:a82f6ac9-09dd-472e-82f0-80392c70d6bb" + }, + "ResponseBody": { + "id": "/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c", + "authorizationSource": "RoleBased", + "managedByTenants": [], + "subscriptionId": "db1ab6f0-4769-4b27-930e-01e2ef9c123c", + "tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47", + "displayName": "Azure SDK sandbox", + "state": "Enabled", + "subscriptionPolicies": { + "locationPlacementId": "Internal_2014-09-01", + "quotaId": "Internal_2014-09-01", + "spendingLimit": "Off" + } + } + } + ], + "Variables": { + "RandomSeed": "981269060", + "SUBSCRIPTION_ID": "db1ab6f0-4769-4b27-930e-01e2ef9c123c" + } +} \ No newline at end of file diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/ArmClientOptionsTests/VersionExist().json b/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/ArmClientOptionsTests/VersionExist().json new file mode 100644 index 0000000000000..1377a25c6fba3 --- /dev/null +++ b/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/ArmClientOptionsTests/VersionExist().json @@ -0,0 +1,53 @@ +{ + "Entries": [ + { + "RequestUri": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c?api-version=2019-11-01", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "traceparent": "00-7dad01eaf61ed84fbd3f11499c8800f5-75a619d3c342a44b-00", + "User-Agent": [ + "azsdk-net-ResourceManager.Resources/1.0.0-preview.2", + "(.NET Core 4.6.29812.02; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "83c8740afca5d2696e512987d3f99b57", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "397", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 09 Apr 2021 20:34:26 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "f4a3f070-9cd6-4e42-9936-a8865e46d94b", + "x-ms-ratelimit-remaining-subscription-reads": "11995", + "x-ms-request-id": "f4a3f070-9cd6-4e42-9936-a8865e46d94b", + "x-ms-routing-request-id": "WESTUS:20210409T203426Z:f4a3f070-9cd6-4e42-9936-a8865e46d94b" + }, + "ResponseBody": { + "id": "/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c", + "authorizationSource": "RoleBased", + "managedByTenants": [], + "subscriptionId": "db1ab6f0-4769-4b27-930e-01e2ef9c123c", + "tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47", + "displayName": "Azure SDK sandbox", + "state": "Enabled", + "subscriptionPolicies": { + "locationPlacementId": "Internal_2014-09-01", + "quotaId": "Internal_2014-09-01", + "spendingLimit": "Off" + } + } + } + ], + "Variables": { + "RandomSeed": "390609155", + "SUBSCRIPTION_ID": "db1ab6f0-4769-4b27-930e-01e2ef9c123c" + } +} \ No newline at end of file diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/ArmClientOptionsTests/VersionExist()Async.json b/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/ArmClientOptionsTests/VersionExist()Async.json new file mode 100644 index 0000000000000..f85af0d9063e0 --- /dev/null +++ b/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/ArmClientOptionsTests/VersionExist()Async.json @@ -0,0 +1,53 @@ +{ + "Entries": [ + { + "RequestUri": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c?api-version=2019-11-01", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "traceparent": "00-03de4f9d469292409efefe58947908fc-c26d6c657af4c746-00", + "User-Agent": [ + "azsdk-net-ResourceManager.Resources/1.0.0-preview.2", + "(.NET Core 4.6.29812.02; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "c78f9c5d7631970a8bf21e8ce0f108fb", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "397", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 09 Apr 2021 20:34:26 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "66626d54-8b76-4c61-9e8f-4c74c8ba6038", + "x-ms-ratelimit-remaining-subscription-reads": "11971", + "x-ms-request-id": "66626d54-8b76-4c61-9e8f-4c74c8ba6038", + "x-ms-routing-request-id": "WESTUS:20210409T203426Z:66626d54-8b76-4c61-9e8f-4c74c8ba6038" + }, + "ResponseBody": { + "id": "/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c", + "authorizationSource": "RoleBased", + "managedByTenants": [], + "subscriptionId": "db1ab6f0-4769-4b27-930e-01e2ef9c123c", + "tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47", + "displayName": "Azure SDK sandbox", + "state": "Enabled", + "subscriptionPolicies": { + "locationPlacementId": "Internal_2014-09-01", + "quotaId": "Internal_2014-09-01", + "spendingLimit": "Off" + } + } + } + ], + "Variables": { + "RandomSeed": "809765192", + "SUBSCRIPTION_ID": "db1ab6f0-4769-4b27-930e-01e2ef9c123c" + } +} \ No newline at end of file diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/ArmClientOptionsTests/VersionIsDefault().json b/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/ArmClientOptionsTests/VersionIsDefault().json new file mode 100644 index 0000000000000..c416490cea09a --- /dev/null +++ b/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/ArmClientOptionsTests/VersionIsDefault().json @@ -0,0 +1,53 @@ +{ + "Entries": [ + { + "RequestUri": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c?api-version=2019-11-01", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "traceparent": "00-b133f33d6ae2db4fadfd6a15a518b856-7a6053b728dfdb4a-00", + "User-Agent": [ + "azsdk-net-ResourceManager.Resources/1.0.0-preview.2", + "(.NET Core 4.6.29812.02; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "67586afa01c45d57ea6ea4831f5a3728", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "397", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 09 Apr 2021 20:34:26 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "66e88d5a-07cf-4cad-8c3a-b49796c746f2", + "x-ms-ratelimit-remaining-subscription-reads": "11993", + "x-ms-request-id": "66e88d5a-07cf-4cad-8c3a-b49796c746f2", + "x-ms-routing-request-id": "WESTUS:20210409T203427Z:66e88d5a-07cf-4cad-8c3a-b49796c746f2" + }, + "ResponseBody": { + "id": "/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c", + "authorizationSource": "RoleBased", + "managedByTenants": [], + "subscriptionId": "db1ab6f0-4769-4b27-930e-01e2ef9c123c", + "tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47", + "displayName": "Azure SDK sandbox", + "state": "Enabled", + "subscriptionPolicies": { + "locationPlacementId": "Internal_2014-09-01", + "quotaId": "Internal_2014-09-01", + "spendingLimit": "Off" + } + } + } + ], + "Variables": { + "RandomSeed": "1842608066", + "SUBSCRIPTION_ID": "db1ab6f0-4769-4b27-930e-01e2ef9c123c" + } +} \ No newline at end of file diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/ArmClientOptionsTests/VersionIsDefault()Async.json b/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/ArmClientOptionsTests/VersionIsDefault()Async.json new file mode 100644 index 0000000000000..7844752830e5c --- /dev/null +++ b/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/ArmClientOptionsTests/VersionIsDefault()Async.json @@ -0,0 +1,53 @@ +{ + "Entries": [ + { + "RequestUri": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c?api-version=2019-11-01", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "traceparent": "00-8662555c7572c3479be2db2618d0fc6b-342fb20273b75345-00", + "User-Agent": [ + "azsdk-net-ResourceManager.Resources/1.0.0-preview.2", + "(.NET Core 4.6.29812.02; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "8b9c55722d0b5a88de7510f03d585e51", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "397", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 09 Apr 2021 20:34:26 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "bb44167c-f181-458a-9626-01a70b69d593", + "x-ms-ratelimit-remaining-subscription-reads": "11994", + "x-ms-request-id": "bb44167c-f181-458a-9626-01a70b69d593", + "x-ms-routing-request-id": "WESTUS:20210409T203426Z:bb44167c-f181-458a-9626-01a70b69d593" + }, + "ResponseBody": { + "id": "/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c", + "authorizationSource": "RoleBased", + "managedByTenants": [], + "subscriptionId": "db1ab6f0-4769-4b27-930e-01e2ef9c123c", + "tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47", + "displayName": "Azure SDK sandbox", + "state": "Enabled", + "subscriptionPolicies": { + "locationPlacementId": "Internal_2014-09-01", + "quotaId": "Internal_2014-09-01", + "spendingLimit": "Off" + } + } + } + ], + "Variables": { + "RandomSeed": "1528757771", + "SUBSCRIPTION_ID": "db1ab6f0-4769-4b27-930e-01e2ef9c123c" + } +} \ No newline at end of file diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/ArmClientOptionsTests/VersionLoadedChanges().json b/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/ArmClientOptionsTests/VersionLoadedChanges().json new file mode 100644 index 0000000000000..19df779a389e0 --- /dev/null +++ b/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/ArmClientOptionsTests/VersionLoadedChanges().json @@ -0,0 +1,53 @@ +{ + "Entries": [ + { + "RequestUri": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c?api-version=2019-11-01", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "traceparent": "00-2c807f5fc6a39f4aad6899e8bfe8d0b3-65437be3283bfd4c-00", + "User-Agent": [ + "azsdk-net-ResourceManager.Resources/1.0.0-preview.2", + "(.NET Core 4.6.29812.02; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "099ae7e28b478ff6c79ef641f8ebbc7c", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "397", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 09 Apr 2021 19:42:07 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "4b09c501-ebff-4002-aed4-a3562373e183", + "x-ms-ratelimit-remaining-subscription-reads": "11999", + "x-ms-request-id": "4b09c501-ebff-4002-aed4-a3562373e183", + "x-ms-routing-request-id": "WESTUS:20210409T194207Z:4b09c501-ebff-4002-aed4-a3562373e183" + }, + "ResponseBody": { + "id": "/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c", + "authorizationSource": "RoleBased", + "managedByTenants": [], + "subscriptionId": "db1ab6f0-4769-4b27-930e-01e2ef9c123c", + "tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47", + "displayName": "Azure SDK sandbox", + "state": "Enabled", + "subscriptionPolicies": { + "locationPlacementId": "Internal_2014-09-01", + "quotaId": "Internal_2014-09-01", + "spendingLimit": "Off" + } + } + } + ], + "Variables": { + "RandomSeed": "1528450526", + "SUBSCRIPTION_ID": "db1ab6f0-4769-4b27-930e-01e2ef9c123c" + } +} \ No newline at end of file diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/ArmClientOptionsTests/VersionLoadedChanges()Async.json b/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/ArmClientOptionsTests/VersionLoadedChanges()Async.json new file mode 100644 index 0000000000000..501f02369a483 --- /dev/null +++ b/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/ArmClientOptionsTests/VersionLoadedChanges()Async.json @@ -0,0 +1,53 @@ +{ + "Entries": [ + { + "RequestUri": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c?api-version=2019-11-01", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "traceparent": "00-96a46639c8794442996969f11bba032b-b867baa4a348e140-00", + "User-Agent": [ + "azsdk-net-ResourceManager.Resources/1.0.0-preview.2", + "(.NET Core 4.6.29812.02; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "612f1c78849b4c1351ed13fffd2d9e89", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "397", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 09 Apr 2021 19:42:07 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "35b107fd-27e6-4155-8bb3-53a3b1a25100", + "x-ms-ratelimit-remaining-subscription-reads": "11987", + "x-ms-request-id": "35b107fd-27e6-4155-8bb3-53a3b1a25100", + "x-ms-routing-request-id": "WESTUS:20210409T194207Z:35b107fd-27e6-4155-8bb3-53a3b1a25100" + }, + "ResponseBody": { + "id": "/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c", + "authorizationSource": "RoleBased", + "managedByTenants": [], + "subscriptionId": "db1ab6f0-4769-4b27-930e-01e2ef9c123c", + "tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47", + "displayName": "Azure SDK sandbox", + "state": "Enabled", + "subscriptionPolicies": { + "locationPlacementId": "Internal_2014-09-01", + "quotaId": "Internal_2014-09-01", + "spendingLimit": "Off" + } + } + } + ], + "Variables": { + "RandomSeed": "1573063055", + "SUBSCRIPTION_ID": "db1ab6f0-4769-4b27-930e-01e2ef9c123c" + } +} \ No newline at end of file diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/ArmClientOptionsTests/VersionNonLoadedChanges().json b/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/ArmClientOptionsTests/VersionNonLoadedChanges().json new file mode 100644 index 0000000000000..69c68612aa3d5 --- /dev/null +++ b/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/ArmClientOptionsTests/VersionNonLoadedChanges().json @@ -0,0 +1,52 @@ +{ + "Entries": [ + { + "RequestUri": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c?api-version=2019-11-01", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": [ + "azsdk-net-ResourceManager.Resources/1.0.0-preview.2", + "(.NET Core 4.6.29812.02; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "02a666e69cc9f4c2d72a75383c3dcd16", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "397", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 09 Apr 2021 19:42:07 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "9de177f7-c5f5-4b85-835a-c37cbd0ea05e", + "x-ms-ratelimit-remaining-subscription-reads": "11992", + "x-ms-request-id": "9de177f7-c5f5-4b85-835a-c37cbd0ea05e", + "x-ms-routing-request-id": "WESTUS:20210409T194208Z:9de177f7-c5f5-4b85-835a-c37cbd0ea05e" + }, + "ResponseBody": { + "id": "/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c", + "authorizationSource": "RoleBased", + "managedByTenants": [], + "subscriptionId": "db1ab6f0-4769-4b27-930e-01e2ef9c123c", + "tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47", + "displayName": "Azure SDK sandbox", + "state": "Enabled", + "subscriptionPolicies": { + "locationPlacementId": "Internal_2014-09-01", + "quotaId": "Internal_2014-09-01", + "spendingLimit": "Off" + } + } + } + ], + "Variables": { + "RandomSeed": "1521527706", + "SUBSCRIPTION_ID": "db1ab6f0-4769-4b27-930e-01e2ef9c123c" + } +} \ No newline at end of file diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/ArmClientOptionsTests/VersionNonLoadedChanges()Async.json b/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/ArmClientOptionsTests/VersionNonLoadedChanges()Async.json new file mode 100644 index 0000000000000..7a5fd4f9be815 --- /dev/null +++ b/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/ArmClientOptionsTests/VersionNonLoadedChanges()Async.json @@ -0,0 +1,53 @@ +{ + "Entries": [ + { + "RequestUri": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c?api-version=2019-11-01", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "traceparent": "00-990a54310a6e8a4ead0105675553fa84-812945a2c5b55c40-00", + "User-Agent": [ + "azsdk-net-ResourceManager.Resources/1.0.0-preview.2", + "(.NET Core 4.6.29812.02; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "be3f7c7be58a2052ce54eed4141960a2", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "397", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 09 Apr 2021 19:42:07 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "54faadcd-310a-43fe-95e4-6d12f01e8725", + "x-ms-ratelimit-remaining-subscription-reads": "11993", + "x-ms-request-id": "54faadcd-310a-43fe-95e4-6d12f01e8725", + "x-ms-routing-request-id": "WESTUS:20210409T194208Z:54faadcd-310a-43fe-95e4-6d12f01e8725" + }, + "ResponseBody": { + "id": "/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c", + "authorizationSource": "RoleBased", + "managedByTenants": [], + "subscriptionId": "db1ab6f0-4769-4b27-930e-01e2ef9c123c", + "tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47", + "displayName": "Azure SDK sandbox", + "state": "Enabled", + "subscriptionPolicies": { + "locationPlacementId": "Internal_2014-09-01", + "quotaId": "Internal_2014-09-01", + "spendingLimit": "Off" + } + } + } + ], + "Variables": { + "RandomSeed": "1633924381", + "SUBSCRIPTION_ID": "db1ab6f0-4769-4b27-930e-01e2ef9c123c" + } +} \ No newline at end of file diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/ArmClientOptionsTests/VersionsLoadedChangeSet().json b/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/ArmClientOptionsTests/VersionsLoadedChangeSet().json new file mode 100644 index 0000000000000..ba1e526dcf463 --- /dev/null +++ b/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/ArmClientOptionsTests/VersionsLoadedChangeSet().json @@ -0,0 +1,53 @@ +{ + "Entries": [ + { + "RequestUri": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c?api-version=2019-11-01", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "traceparent": "00-a327963a46b6114992d4a64949115d15-256f3f955d815944-00", + "User-Agent": [ + "azsdk-net-ResourceManager.Resources/1.0.0-preview.2", + "(.NET Core 4.6.29812.02; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "4de132b9856e51504f25e305cdc1fc84", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "397", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 09 Apr 2021 19:42:07 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "aeff3639-d461-4fb1-b8ac-b788932c6f9d", + "x-ms-ratelimit-remaining-subscription-reads": "11988", + "x-ms-request-id": "aeff3639-d461-4fb1-b8ac-b788932c6f9d", + "x-ms-routing-request-id": "WESTUS:20210409T194208Z:aeff3639-d461-4fb1-b8ac-b788932c6f9d" + }, + "ResponseBody": { + "id": "/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c", + "authorizationSource": "RoleBased", + "managedByTenants": [], + "subscriptionId": "db1ab6f0-4769-4b27-930e-01e2ef9c123c", + "tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47", + "displayName": "Azure SDK sandbox", + "state": "Enabled", + "subscriptionPolicies": { + "locationPlacementId": "Internal_2014-09-01", + "quotaId": "Internal_2014-09-01", + "spendingLimit": "Off" + } + } + } + ], + "Variables": { + "RandomSeed": "399796000", + "SUBSCRIPTION_ID": "db1ab6f0-4769-4b27-930e-01e2ef9c123c" + } +} \ No newline at end of file diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/ArmClientOptionsTests/VersionsLoadedChangeSet()Async.json b/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/ArmClientOptionsTests/VersionsLoadedChangeSet()Async.json new file mode 100644 index 0000000000000..12ed32d9bc869 --- /dev/null +++ b/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/ArmClientOptionsTests/VersionsLoadedChangeSet()Async.json @@ -0,0 +1,53 @@ +{ + "Entries": [ + { + "RequestUri": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c?api-version=2019-11-01", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "Request-Id": "|3bfc2190-42bedbe4e2a21cf4.", + "User-Agent": [ + "azsdk-net-ResourceManager.Resources/1.0.0-preview.2", + "(.NET Core 4.6.29812.02; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "d8227743099f3ebf1a5265023c39b6e8", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "397", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 09 Apr 2021 19:42:07 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "06fbc614-785a-4667-8ecf-349fc7339fb9", + "x-ms-ratelimit-remaining-subscription-reads": "11989", + "x-ms-request-id": "06fbc614-785a-4667-8ecf-349fc7339fb9", + "x-ms-routing-request-id": "WESTUS:20210409T194208Z:06fbc614-785a-4667-8ecf-349fc7339fb9" + }, + "ResponseBody": { + "id": "/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c", + "authorizationSource": "RoleBased", + "managedByTenants": [], + "subscriptionId": "db1ab6f0-4769-4b27-930e-01e2ef9c123c", + "tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47", + "displayName": "Azure SDK sandbox", + "state": "Enabled", + "subscriptionPolicies": { + "locationPlacementId": "Internal_2014-09-01", + "quotaId": "Internal_2014-09-01", + "spendingLimit": "Off" + } + } + } + ], + "Variables": { + "RandomSeed": "744076958", + "SUBSCRIPTION_ID": "db1ab6f0-4769-4b27-930e-01e2ef9c123c" + } +} \ No newline at end of file diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/ClientContextTests/TestClientContextPolicy().json b/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/ClientContextTests/TestClientContextPolicy().json index 592362382111f..1bbf660545d7d 100644 --- a/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/ClientContextTests/TestClientContextPolicy().json +++ b/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/ClientContextTests/TestClientContextPolicy().json @@ -16,15 +16,15 @@ "Cache-Control": "no-cache", "Content-Length": "397", "Content-Type": "application/json; charset=utf-8", - "Date": "Tue, 30 Mar 2021 18:02:51 GMT", + "Date": "Fri, 09 Apr 2021 19:06:12 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "eb160f33-a114-4495-bb60-d519acebc360", + "x-ms-correlation-request-id": "52cfc5eb-407c-4e30-b240-124b6321cbf3", "x-ms-ratelimit-remaining-subscription-reads": "11998", - "x-ms-request-id": "eb160f33-a114-4495-bb60-d519acebc360", - "x-ms-routing-request-id": "WESTUS:20210330T180252Z:eb160f33-a114-4495-bb60-d519acebc360" + "x-ms-request-id": "52cfc5eb-407c-4e30-b240-124b6321cbf3", + "x-ms-routing-request-id": "WESTUS:20210409T190612Z:52cfc5eb-407c-4e30-b240-124b6321cbf3" }, "ResponseBody": { "id": "/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c", @@ -57,15 +57,15 @@ "Cache-Control": "no-cache", "Content-Length": "397", "Content-Type": "application/json; charset=utf-8", - "Date": "Tue, 30 Mar 2021 18:02:51 GMT", + "Date": "Fri, 09 Apr 2021 19:06:12 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "c149cf69-a92c-44e2-82ec-2eb3a10e7cc2", - "x-ms-ratelimit-remaining-subscription-reads": "11997", - "x-ms-request-id": "c149cf69-a92c-44e2-82ec-2eb3a10e7cc2", - "x-ms-routing-request-id": "WESTUS:20210330T180252Z:c149cf69-a92c-44e2-82ec-2eb3a10e7cc2" + "x-ms-correlation-request-id": "8d03dff7-a3ec-4250-86f7-9f8d9e396c1e", + "x-ms-ratelimit-remaining-subscription-reads": "11995", + "x-ms-request-id": "8d03dff7-a3ec-4250-86f7-9f8d9e396c1e", + "x-ms-routing-request-id": "WESTUS:20210409T190612Z:8d03dff7-a3ec-4250-86f7-9f8d9e396c1e" }, "ResponseBody": { "id": "/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c", @@ -83,102 +83,88 @@ } }, { - "RequestUri": "https://management.azure.com/subscriptions?api-version=2019-11-01", - "RequestMethod": "GET", + "RequestUri": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourcegroups/testrg5465?api-version=2019-10-01", + "RequestMethod": "PUT", "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", - "traceparent": "00-d3f160780595d04596a9769af92e38f1-655d0e3902851b44-00", + "Content-Length": "34", + "Content-Type": "application/json", + "traceparent": "00-d83002a4d807124986d486d29fbf731c-08bda8786d2a5c42-00", "User-Agent": "azsdk-net-ResourceManager.Resources/1.0.0-preview.2 (.NET Framework 4.8.4300.0; Microsoft Windows 10.0.19042 )", - "x-ms-client-request-id": "6b45aa1bb79428db25fc8df27c72edbd", + "x-ms-client-request-id": "946b45aadbb72528fc8df27c72edbdad", "x-ms-return-client-request-id": "true" }, - "RequestBody": null, - "StatusCode": 200, + "RequestBody": { + "location": "West US 2", + "tags": {} + }, + "StatusCode": 201, "ResponseHeaders": { "Cache-Control": "no-cache", - "Content-Length": "444", + "Content-Length": "228", "Content-Type": "application/json; charset=utf-8", - "Date": "Tue, 30 Mar 2021 18:02:52 GMT", + "Date": "Fri, 09 Apr 2021 19:06:13 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "916a7cb8-b113-401c-812a-1672eac24110", - "x-ms-ratelimit-remaining-tenant-reads": "11999", - "x-ms-request-id": "916a7cb8-b113-401c-812a-1672eac24110", - "x-ms-routing-request-id": "WESTUS:20210330T180253Z:916a7cb8-b113-401c-812a-1672eac24110" + "x-ms-correlation-request-id": "bf2413f7-2ae8-4f7f-833f-d46f4a65026c", + "x-ms-ratelimit-remaining-subscription-writes": "1199", + "x-ms-request-id": "bf2413f7-2ae8-4f7f-833f-d46f4a65026c", + "x-ms-routing-request-id": "WESTUS:20210409T190613Z:bf2413f7-2ae8-4f7f-833f-d46f4a65026c" }, "ResponseBody": { - "value": [ - { - "id": "/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c", - "authorizationSource": "RoleBased", - "managedByTenants": [], - "subscriptionId": "db1ab6f0-4769-4b27-930e-01e2ef9c123c", - "tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47", - "displayName": "Azure SDK sandbox", - "state": "Enabled", - "subscriptionPolicies": { - "locationPlacementId": "Internal_2014-09-01", - "quotaId": "Internal_2014-09-01", - "spendingLimit": "Off" - } - } - ], - "count": { - "type": "Total", - "value": 1 + "id": "/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testrg5465", + "name": "testrg5465", + "type": "Microsoft.Resources/resourceGroups", + "location": "westus2", + "tags": {}, + "properties": { + "provisioningState": "Succeeded" } } }, { - "RequestUri": "https://management.azure.com/subscriptions?api-version=2019-11-01", - "RequestMethod": "GET", + "RequestUri": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourcegroups/test2Rg-7020?api-version=2019-10-01", + "RequestMethod": "PUT", "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", - "traceparent": "00-7a08ae1f156a6a4db2e3e331e7e4bdb7-a65cc6343040d54c-00", + "Content-Length": "34", + "Content-Type": "application/json", + "traceparent": "00-1958354d86297f40bb353616fdc00588-a3db6b4df3eaf246-00", "User-Agent": "azsdk-net-ResourceManager.Resources/1.0.0-preview.2 (.NET Framework 4.8.4300.0; Microsoft Windows 10.0.19042 )", - "x-ms-client-request-id": "18a4ebad66a1485f01fe05987684a436", + "x-ms-client-request-id": "66a118a4485ffe0105987684a436664f", "x-ms-return-client-request-id": "true" }, - "RequestBody": null, - "StatusCode": 200, + "RequestBody": { + "location": "West US 2", + "tags": {} + }, + "StatusCode": 201, "ResponseHeaders": { "Cache-Control": "no-cache", - "Content-Length": "444", + "Content-Length": "232", "Content-Type": "application/json; charset=utf-8", - "Date": "Tue, 30 Mar 2021 18:02:52 GMT", + "Date": "Fri, 09 Apr 2021 19:06:13 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "c9de31dc-c231-4a63-bf43-b8b3e624abef", - "x-ms-ratelimit-remaining-tenant-reads": "11998", - "x-ms-request-id": "c9de31dc-c231-4a63-bf43-b8b3e624abef", - "x-ms-routing-request-id": "WESTUS:20210330T180253Z:c9de31dc-c231-4a63-bf43-b8b3e624abef" + "x-ms-correlation-request-id": "4a4cb654-6503-40f9-b6b2-8d0eff9d5f7e", + "x-ms-ratelimit-remaining-subscription-writes": "1198", + "x-ms-request-id": "4a4cb654-6503-40f9-b6b2-8d0eff9d5f7e", + "x-ms-routing-request-id": "WESTUS:20210409T190614Z:4a4cb654-6503-40f9-b6b2-8d0eff9d5f7e" }, "ResponseBody": { - "value": [ - { - "id": "/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c", - "authorizationSource": "RoleBased", - "managedByTenants": [], - "subscriptionId": "db1ab6f0-4769-4b27-930e-01e2ef9c123c", - "tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47", - "displayName": "Azure SDK sandbox", - "state": "Enabled", - "subscriptionPolicies": { - "locationPlacementId": "Internal_2014-09-01", - "quotaId": "Internal_2014-09-01", - "spendingLimit": "Off" - } - } - ], - "count": { - "type": "Total", - "value": 1 + "id": "/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/test2Rg-7020", + "name": "test2Rg-7020", + "type": "Microsoft.Resources/resourceGroups", + "location": "westus2", + "tags": {}, + "properties": { + "provisioningState": "Succeeded" } } } diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/ClientContextTests/TestClientContextPolicy()Async.json b/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/ClientContextTests/TestClientContextPolicy()Async.json index d5ad165206cdc..64c04a143420a 100644 --- a/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/ClientContextTests/TestClientContextPolicy()Async.json +++ b/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/ClientContextTests/TestClientContextPolicy()Async.json @@ -6,10 +6,7 @@ "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", - "User-Agent": [ - "azsdk-net-ResourceManager.Resources/1.0.0-preview.2", - "(.NET Core 4.6.29812.02; Microsoft Windows 10.0.19042 )" - ], + "User-Agent": "azsdk-net-ResourceManager.Resources/1.0.0-preview.2 (.NET Framework 4.8.4300.0; Microsoft Windows 10.0.19042 )", "x-ms-client-request-id": "e96d9ac8512614d931e92300f67b3120", "x-ms-return-client-request-id": "true" }, @@ -19,15 +16,15 @@ "Cache-Control": "no-cache", "Content-Length": "397", "Content-Type": "application/json; charset=utf-8", - "Date": "Tue, 30 Mar 2021 07:42:15 GMT", + "Date": "Fri, 09 Apr 2021 19:06:11 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "7f33c549-551c-4cdb-a125-3cbe74735f13", - "x-ms-ratelimit-remaining-subscription-reads": "11998", - "x-ms-request-id": "7f33c549-551c-4cdb-a125-3cbe74735f13", - "x-ms-routing-request-id": "WESTUS:20210330T074216Z:7f33c549-551c-4cdb-a125-3cbe74735f13" + "x-ms-correlation-request-id": "e711acee-2fc9-4bd4-91ad-87fe7df78c9b", + "x-ms-ratelimit-remaining-subscription-reads": "11996", + "x-ms-request-id": "e711acee-2fc9-4bd4-91ad-87fe7df78c9b", + "x-ms-routing-request-id": "WESTUS:20210409T190612Z:e711acee-2fc9-4bd4-91ad-87fe7df78c9b" }, "ResponseBody": { "id": "/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c", @@ -50,10 +47,7 @@ "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", - "User-Agent": [ - "azsdk-net-ResourceManager.Resources/1.0.0-preview.2", - "(.NET Core 4.6.29812.02; Microsoft Windows 10.0.19042 )" - ], + "User-Agent": "azsdk-net-ResourceManager.Resources/1.0.0-preview.2 (.NET Framework 4.8.4300.0; Microsoft Windows 10.0.19042 )", "x-ms-client-request-id": "e09d8a5201e54fd1d4c2015378af5276", "x-ms-return-client-request-id": "true" }, @@ -63,15 +57,15 @@ "Cache-Control": "no-cache", "Content-Length": "397", "Content-Type": "application/json; charset=utf-8", - "Date": "Tue, 30 Mar 2021 07:42:15 GMT", + "Date": "Fri, 09 Apr 2021 19:06:11 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "0ec684a8-a103-4929-b5cb-570d6600c2b2", - "x-ms-ratelimit-remaining-subscription-reads": "11997", - "x-ms-request-id": "0ec684a8-a103-4929-b5cb-570d6600c2b2", - "x-ms-routing-request-id": "WESTUS:20210330T074216Z:0ec684a8-a103-4929-b5cb-570d6600c2b2" + "x-ms-correlation-request-id": "585e30f8-cae9-4a39-b199-216534f6d6da", + "x-ms-ratelimit-remaining-subscription-reads": "11998", + "x-ms-request-id": "585e30f8-cae9-4a39-b199-216534f6d6da", + "x-ms-routing-request-id": "WESTUS:20210409T190612Z:585e30f8-cae9-4a39-b199-216534f6d6da" }, "ResponseBody": { "id": "/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c", @@ -89,108 +83,88 @@ } }, { - "RequestUri": "https://management.azure.com/subscriptions?api-version=2019-11-01", - "RequestMethod": "GET", + "RequestUri": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourcegroups/testrg2078?api-version=2019-10-01", + "RequestMethod": "PUT", "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", - "traceparent": "00-b806b3ca910f704fad6c50fb87ca92d3-1f44187973c8d644-00", - "User-Agent": [ - "azsdk-net-ResourceManager.Resources/1.0.0-preview.2", - "(.NET Core 4.6.29812.02; Microsoft Windows 10.0.19042 )" - ], - "x-ms-client-request-id": "db6e8ace8f093a15c6ceb8a339234783", + "Content-Length": "34", + "Content-Type": "application/json", + "traceparent": "00-3924080252cb7a4ab03a9686bd737521-1f2abdca7652ae4d-00", + "User-Agent": "azsdk-net-ResourceManager.Resources/1.0.0-preview.2 (.NET Framework 4.8.4300.0; Microsoft Windows 10.0.19042 )", + "x-ms-client-request-id": "09db6e8a158fc63aceb8a339234783e8", "x-ms-return-client-request-id": "true" }, - "RequestBody": null, - "StatusCode": 200, + "RequestBody": { + "location": "West US 2", + "tags": {} + }, + "StatusCode": 201, "ResponseHeaders": { "Cache-Control": "no-cache", - "Content-Length": "444", + "Content-Length": "228", "Content-Type": "application/json; charset=utf-8", - "Date": "Tue, 30 Mar 2021 07:42:15 GMT", + "Date": "Fri, 09 Apr 2021 19:06:13 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "77d2aed5-2d0d-4146-b495-76564648d7f9", - "x-ms-ratelimit-remaining-tenant-reads": "11999", - "x-ms-request-id": "77d2aed5-2d0d-4146-b495-76564648d7f9", - "x-ms-routing-request-id": "WESTUS:20210330T074216Z:77d2aed5-2d0d-4146-b495-76564648d7f9" + "x-ms-correlation-request-id": "6b319d97-0681-4d36-be50-372265d551ab", + "x-ms-ratelimit-remaining-subscription-writes": "1199", + "x-ms-request-id": "6b319d97-0681-4d36-be50-372265d551ab", + "x-ms-routing-request-id": "WESTUS:20210409T190613Z:6b319d97-0681-4d36-be50-372265d551ab" }, "ResponseBody": { - "value": [ - { - "id": "/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c", - "authorizationSource": "RoleBased", - "managedByTenants": [], - "subscriptionId": "db1ab6f0-4769-4b27-930e-01e2ef9c123c", - "tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47", - "displayName": "Azure SDK sandbox", - "state": "Enabled", - "subscriptionPolicies": { - "locationPlacementId": "Internal_2014-09-01", - "quotaId": "Internal_2014-09-01", - "spendingLimit": "Off" - } - } - ], - "count": { - "type": "Total", - "value": 1 + "id": "/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testrg2078", + "name": "testrg2078", + "type": "Microsoft.Resources/resourceGroups", + "location": "westus2", + "tags": {}, + "properties": { + "provisioningState": "Succeeded" } } }, { - "RequestUri": "https://management.azure.com/subscriptions?api-version=2019-11-01", - "RequestMethod": "GET", + "RequestUri": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourcegroups/test2Rg-3351?api-version=2019-10-01", + "RequestMethod": "PUT", "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", - "traceparent": "00-40a57a933fdfd842a948888046064689-32a0969d5a527844-00", - "User-Agent": [ - "azsdk-net-ResourceManager.Resources/1.0.0-preview.2", - "(.NET Core 4.6.29812.02; Microsoft Windows 10.0.19042 )" - ], - "x-ms-client-request-id": "c73313e84b9ec69dc81e156350869c82", + "Content-Length": "34", + "Content-Type": "application/json", + "traceparent": "00-6dc40865157b9842893fdc9e9674aea0-33722b78a42edd4c-00", + "User-Agent": "azsdk-net-ResourceManager.Resources/1.0.0-preview.2 (.NET Framework 4.8.4300.0; Microsoft Windows 10.0.19042 )", + "x-ms-client-request-id": "4b9ec733c69d1ec8156350869c8297ad", "x-ms-return-client-request-id": "true" }, - "RequestBody": null, - "StatusCode": 200, + "RequestBody": { + "location": "West US 2", + "tags": {} + }, + "StatusCode": 201, "ResponseHeaders": { "Cache-Control": "no-cache", - "Content-Length": "444", + "Content-Length": "232", "Content-Type": "application/json; charset=utf-8", - "Date": "Tue, 30 Mar 2021 07:42:16 GMT", + "Date": "Fri, 09 Apr 2021 19:06:14 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "b772d3bf-7cdc-452e-b652-a56c168dde56", - "x-ms-ratelimit-remaining-tenant-reads": "11998", - "x-ms-request-id": "b772d3bf-7cdc-452e-b652-a56c168dde56", - "x-ms-routing-request-id": "WESTUS:20210330T074216Z:b772d3bf-7cdc-452e-b652-a56c168dde56" + "x-ms-correlation-request-id": "58441753-c4f0-4c61-a0d9-c28523f9e74a", + "x-ms-ratelimit-remaining-subscription-writes": "1198", + "x-ms-request-id": "58441753-c4f0-4c61-a0d9-c28523f9e74a", + "x-ms-routing-request-id": "WESTUS:20210409T190614Z:58441753-c4f0-4c61-a0d9-c28523f9e74a" }, "ResponseBody": { - "value": [ - { - "id": "/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c", - "authorizationSource": "RoleBased", - "managedByTenants": [], - "subscriptionId": "db1ab6f0-4769-4b27-930e-01e2ef9c123c", - "tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47", - "displayName": "Azure SDK sandbox", - "state": "Enabled", - "subscriptionPolicies": { - "locationPlacementId": "Internal_2014-09-01", - "quotaId": "Internal_2014-09-01", - "spendingLimit": "Off" - } - } - ], - "count": { - "type": "Total", - "value": 1 + "id": "/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/test2Rg-3351", + "name": "test2Rg-3351", + "type": "Microsoft.Resources/resourceGroups", + "location": "westus2", + "tags": {}, + "properties": { + "provisioningState": "Succeeded" } } } diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/ClientContextTests/ValidateOptionsTestApiVersions().json b/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/ClientContextTests/ValidateOptionsTestApiVersions().json new file mode 100644 index 0000000000000..07de6b975dbe1 --- /dev/null +++ b/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/ClientContextTests/ValidateOptionsTestApiVersions().json @@ -0,0 +1,53 @@ +{ + "Entries": [ + { + "RequestUri": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c?api-version=2019-11-01", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "traceparent": "00-9f9acd5dc9709e4fb2c52a8a9565a649-b7140c1f7f1f4d48-00", + "User-Agent": [ + "azsdk-net-ResourceManager.Resources/1.0.0-preview.2", + "(.NET Core 4.6.29812.02; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "4f94e0961852ba0a094e8a7b9e8e37d9", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "397", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 09 Apr 2021 19:42:08 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "6a88d13c-dddc-4a03-a0a8-4cdad1f7fecb", + "x-ms-ratelimit-remaining-subscription-reads": "11984", + "x-ms-request-id": "6a88d13c-dddc-4a03-a0a8-4cdad1f7fecb", + "x-ms-routing-request-id": "WESTUS:20210409T194208Z:6a88d13c-dddc-4a03-a0a8-4cdad1f7fecb" + }, + "ResponseBody": { + "id": "/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c", + "authorizationSource": "RoleBased", + "managedByTenants": [], + "subscriptionId": "db1ab6f0-4769-4b27-930e-01e2ef9c123c", + "tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47", + "displayName": "Azure SDK sandbox", + "state": "Enabled", + "subscriptionPolicies": { + "locationPlacementId": "Internal_2014-09-01", + "quotaId": "Internal_2014-09-01", + "spendingLimit": "Off" + } + } + } + ], + "Variables": { + "RandomSeed": "853902363", + "SUBSCRIPTION_ID": "db1ab6f0-4769-4b27-930e-01e2ef9c123c" + } +} \ No newline at end of file diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/ClientContextTests/ValidateOptionsTestApiVersions()Async.json b/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/ClientContextTests/ValidateOptionsTestApiVersions()Async.json new file mode 100644 index 0000000000000..7dced82eedc81 --- /dev/null +++ b/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/ClientContextTests/ValidateOptionsTestApiVersions()Async.json @@ -0,0 +1,53 @@ +{ + "Entries": [ + { + "RequestUri": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c?api-version=2019-11-01", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "traceparent": "00-696d324c9d2e494b815707d98305304f-202ff1d22865e04c-00", + "User-Agent": [ + "azsdk-net-ResourceManager.Resources/1.0.0-preview.2", + "(.NET Core 4.6.29812.02; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "95b4bfe35fa9f1a8a30fa9d21a3b8569", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "397", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 09 Apr 2021 19:42:08 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "80dde585-fbfb-4dc4-bbdd-60004341d977", + "x-ms-ratelimit-remaining-subscription-reads": "11987", + "x-ms-request-id": "80dde585-fbfb-4dc4-bbdd-60004341d977", + "x-ms-routing-request-id": "WESTUS:20210409T194208Z:80dde585-fbfb-4dc4-bbdd-60004341d977" + }, + "ResponseBody": { + "id": "/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c", + "authorizationSource": "RoleBased", + "managedByTenants": [], + "subscriptionId": "db1ab6f0-4769-4b27-930e-01e2ef9c123c", + "tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47", + "displayName": "Azure SDK sandbox", + "state": "Enabled", + "subscriptionPolicies": { + "locationPlacementId": "Internal_2014-09-01", + "quotaId": "Internal_2014-09-01", + "spendingLimit": "Off" + } + } + } + ], + "Variables": { + "RandomSeed": "247474572", + "SUBSCRIPTION_ID": "db1ab6f0-4769-4b27-930e-01e2ef9c123c" + } +} \ No newline at end of file diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/ClientContextTests/ValidateOptionsTestLocation().json b/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/ClientContextTests/ValidateOptionsTestLocation().json new file mode 100644 index 0000000000000..43f102157c6ff --- /dev/null +++ b/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/ClientContextTests/ValidateOptionsTestLocation().json @@ -0,0 +1,53 @@ +{ + "Entries": [ + { + "RequestUri": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c?api-version=2019-11-01", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "traceparent": "00-9cfd40bedae19f4f8d2fc55b00218075-8149bd5041f1614a-00", + "User-Agent": [ + "azsdk-net-ResourceManager.Resources/1.0.0-preview.2", + "(.NET Core 4.6.29812.02; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "4bb393657d397335bd9b0f05293c29c0", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "397", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 09 Apr 2021 19:42:09 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "b77e0172-1a21-4711-9621-9f2c81c556aa", + "x-ms-ratelimit-remaining-subscription-reads": "11997", + "x-ms-request-id": "b77e0172-1a21-4711-9621-9f2c81c556aa", + "x-ms-routing-request-id": "WESTUS:20210409T194210Z:b77e0172-1a21-4711-9621-9f2c81c556aa" + }, + "ResponseBody": { + "id": "/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c", + "authorizationSource": "RoleBased", + "managedByTenants": [], + "subscriptionId": "db1ab6f0-4769-4b27-930e-01e2ef9c123c", + "tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47", + "displayName": "Azure SDK sandbox", + "state": "Enabled", + "subscriptionPolicies": { + "locationPlacementId": "Internal_2014-09-01", + "quotaId": "Internal_2014-09-01", + "spendingLimit": "Off" + } + } + } + ], + "Variables": { + "RandomSeed": "884501139", + "SUBSCRIPTION_ID": "db1ab6f0-4769-4b27-930e-01e2ef9c123c" + } +} \ No newline at end of file diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/ClientContextTests/ValidateOptionsTestLocation()Async.json b/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/ClientContextTests/ValidateOptionsTestLocation()Async.json new file mode 100644 index 0000000000000..9a63c5c9815b0 --- /dev/null +++ b/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/ClientContextTests/ValidateOptionsTestLocation()Async.json @@ -0,0 +1,53 @@ +{ + "Entries": [ + { + "RequestUri": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c?api-version=2019-11-01", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "traceparent": "00-b7a52e143f5eed4c87304ab0a70ee8bb-f5e4adf9a9ee1344-00", + "User-Agent": [ + "azsdk-net-ResourceManager.Resources/1.0.0-preview.2", + "(.NET Core 4.6.29812.02; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "3d456fe91ea2401371c61533de037790", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "397", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 09 Apr 2021 19:42:09 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "a6477bcf-2da1-48bf-9cc0-474c125441d1", + "x-ms-ratelimit-remaining-subscription-reads": "11987", + "x-ms-request-id": "a6477bcf-2da1-48bf-9cc0-474c125441d1", + "x-ms-routing-request-id": "WESTUS:20210409T194210Z:a6477bcf-2da1-48bf-9cc0-474c125441d1" + }, + "ResponseBody": { + "id": "/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c", + "authorizationSource": "RoleBased", + "managedByTenants": [], + "subscriptionId": "db1ab6f0-4769-4b27-930e-01e2ef9c123c", + "tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47", + "displayName": "Azure SDK sandbox", + "state": "Enabled", + "subscriptionPolicies": { + "locationPlacementId": "Internal_2014-09-01", + "quotaId": "Internal_2014-09-01", + "spendingLimit": "Off" + } + } + } + ], + "Variables": { + "RandomSeed": "270982415", + "SUBSCRIPTION_ID": "db1ab6f0-4769-4b27-930e-01e2ef9c123c" + } +} \ No newline at end of file diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/tests/Unit/ApiVersionsBaseTests.cs b/sdk/resourcemanager/Azure.ResourceManager.Core/tests/Unit/ApiVersionsBaseTests.cs index 501b9216fae11..5c8e8b8f6ac55 100644 --- a/sdk/resourcemanager/Azure.ResourceManager.Core/tests/Unit/ApiVersionsBaseTests.cs +++ b/sdk/resourcemanager/Azure.ResourceManager.Core/tests/Unit/ApiVersionsBaseTests.cs @@ -253,5 +253,20 @@ public void TestLessThanFalse(string leftString, string rightString) FakeResourceApiVersions right = ConvertFromString(rightString); Assert.IsFalse(left < right); } + + [TestCase] + public void ValidateClone() + { + var options = new ArmClientOptions(); + var apiVersions1 = new ApiVersions(options); + var apiVersions2 = apiVersions1.Clone(); + + Assert.IsFalse(ReferenceEquals(apiVersions1, apiVersions2)); + Assert.AreEqual(apiVersions1.TryGetApiVersion("{Microsoft.Resources/subscriptions/resourceGroups}"), apiVersions2.TryGetApiVersion("{Microsoft.Resources/subscriptions/resourceGroups}")); + + apiVersions1.SetApiVersion("{Microsoft.Resources/subscriptions/resourceGroups}", "1500-10-10"); + Assert.IsFalse(ReferenceEquals(apiVersions1, apiVersions2)); + Assert.AreNotEqual(apiVersions1, apiVersions2); + } } } diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/tests/Unit/ArmClientOptionsTests.cs b/sdk/resourcemanager/Azure.ResourceManager.Core/tests/Unit/ArmClientOptionsTests.cs index f217d22e920c1..edcc23fe9a6bd 100644 --- a/sdk/resourcemanager/Azure.ResourceManager.Core/tests/Unit/ArmClientOptionsTests.cs +++ b/sdk/resourcemanager/Azure.ResourceManager.Core/tests/Unit/ArmClientOptionsTests.cs @@ -1,12 +1,60 @@ using System; +using System.Threading.Tasks; using Azure.Core; +using Azure.Core.Pipeline; using NUnit.Framework; namespace Azure.ResourceManager.Core.Tests { [Parallelizable] - public class AzureResourceManagerClientOptionsTests + public class ArmClientOptionsTests : ResourceManagerTestBase { + public ArmClientOptionsTests(bool isAsync) : base(isAsync) { } + + [TestCase] + public void ValidateClone() + { + var options1 = new ArmClientOptions(); + var options2 = options1.Clone(); + + Assert.IsFalse(ReferenceEquals(options1, options2)); + Assert.IsFalse(ReferenceEquals(options1.Diagnostics, options2.Diagnostics)); + Assert.IsFalse(ReferenceEquals(options1.Retry, options2.Retry)); + Assert.IsFalse(ReferenceEquals(options1.ApiVersions, options2.ApiVersions)); + Assert.IsFalse(ReferenceEquals(options1.PerCallPolicies, options2.PerCallPolicies)); + Assert.IsFalse(ReferenceEquals(options1.PerRetryPolicies, options2.PerRetryPolicies)); + } + + [TestCase] + public void TestTransportInClone() + { + var x = new ArmClientOptions(); + x.Transport = new MyTransport(); + var y = x.Clone(); + Assert.IsTrue(ReferenceEquals(x.Transport, y.Transport)); + + x.Transport = new MyTransport(); + Assert.IsFalse(ReferenceEquals(y.Transport, x.Transport)); + } + + private class MyTransport : HttpPipelineTransport + { + public override Request CreateRequest() + { + throw new NotImplementedException(); + } + + public override void Process(HttpMessage message) + { + throw new NotImplementedException(); + } + + public override ValueTask ProcessAsync(HttpMessage message) + { + throw new NotImplementedException(); + } + } + [TestCase] public void VersionIsDefault() {