Skip to content

Commit ba80fc1

Browse files
m-nashazure-sdk
andauthored
Use arm client reference instead of client context (Azure#26452)
* changes to remove armclientoptions cloning * changes to generated files * updates to use provider namespace string and not pass assembly * remove usage of mgmt pipeline builder * update api * temp comment out compute and network for tests * temp update to migration guide md * temp changes to support back compat * revert manual changes to generated folder * make properties protected * add client context overload * update api * add overload useClientContext to tenant clean up more code * add cached client api * update api * update public api to be virtual * update to use getor add * updates to custom code * temp changes to support autorest changes * more customization * remove file * suppress armclient * updates to custom code to adapt to new generation * Update AutoRest C# version to 3.0.0-beta.20220126.1 * regen with new custom code * make ctor param ordering consistent * more adjustments on custom code and test cases * removing some code that is no longer needed * remove unused method * uncomment references to compute and network update api and snippets * removing more api that isn't needed anymore * add back azure.core project to sln * regen return type fix * Add test cases around cached factory * Update AutoRest C# version to 3.0.0-beta.20220126.3 * update tests * update customization * cache sub client diag * update apis * update webpubsub * update storage * update appconfiguration * update cdn * update compute * update keyvault * update storage * update eventhub * update communication * update deviceupdate * update servicebus * update sqlmanagement * update webpubsub * update appservice * update insights Co-authored-by: azure-sdk <[email protected]>
1 parent dcdcb8d commit ba80fc1

File tree

2,033 files changed

+61880
-68269
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,033 files changed

+61880
-68269
lines changed

common/ManagementTestShared/Current/ManagementRecordedTestBase.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ protected ArmClient GetResourceManagementClient()
4444
options.AddPolicy(CleanupPolicy, HttpPipelinePosition.PerCall);
4545

4646
return CreateClient<ArmClient>(
47-
TestEnvironment.SubscriptionId,
4847
TestEnvironment.Credential,
48+
TestEnvironment.SubscriptionId,
4949
options);
5050
}
5151

@@ -54,8 +54,8 @@ protected async Task CleanupResourceGroupsAsync()
5454
if (CleanupPolicy != null && Mode != RecordedTestMode.Playback)
5555
{
5656
_cleanupClient ??= new ArmClient(
57-
TestEnvironment.SubscriptionId,
5857
TestEnvironment.Credential,
58+
TestEnvironment.SubscriptionId,
5959
new ArmClientOptions());
6060
var sub = _cleanupClient.GetSubscriptions().GetIfExists(TestEnvironment.SubscriptionId);
6161
foreach (var resourceGroup in CleanupPolicy.ResourceGroupsCreated)

common/ManagementTestShared/Redesign/ManagementRecordedTestBase.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,10 @@ private ArmClient GetCleanupClient()
6464
if (Mode != RecordedTestMode.Playback)
6565
{
6666
return new ArmClient(
67-
TestEnvironment.SubscriptionId,
68-
GetUri(TestEnvironment.ResourceManagerUrl),
69-
TestEnvironment.Credential,
70-
new ArmClientOptions());
67+
TestEnvironment.Credential,
68+
TestEnvironment.SubscriptionId,
69+
GetUri(TestEnvironment.ResourceManagerUrl),
70+
new ArmClientOptions());
7171
}
7272
return null;
7373
}
@@ -81,15 +81,15 @@ protected ArmClient GetArmClient(ArmClientOptions clientOptions = default)
8181
options.AddPolicy(ManagementGroupCleanupPolicy, HttpPipelinePosition.PerCall);
8282

8383
return CreateClient<ArmClient>(
84+
TestEnvironment.Credential,
8485
TestEnvironment.SubscriptionId,
8586
GetUri(TestEnvironment.ResourceManagerUrl),
86-
TestEnvironment.Credential,
8787
options);
8888
}
8989

9090
private Uri GetUri(string endpoint)
9191
{
92-
return !string.IsNullOrEmpty(endpoint) ? new Uri(endpoint) : null;
92+
return !string.IsNullOrEmpty(endpoint) ? new Uri(endpoint) : new Uri("https://management.azure.com");
9393
}
9494

9595
[SetUp]
@@ -172,9 +172,9 @@ public async Task OneTimeSetUp()
172172
options.AddPolicy(OneTimeManagementGroupCleanupPolicy, HttpPipelinePosition.PerCall);
173173

174174
GlobalClient = CreateClient<ArmClient>(
175+
SessionEnvironment.Credential,
175176
SessionEnvironment.SubscriptionId,
176177
GetUri(SessionEnvironment.ResourceManagerUrl),
177-
SessionEnvironment.Credential,
178178
options);
179179
}
180180

eng/Packages.Data.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@
149149
All should have PrivateAssets="All" set so they don't become package dependencies
150150
-->
151151
<ItemGroup>
152-
<PackageReference Update="Microsoft.Azure.AutoRest.CSharp" Version="3.0.0-beta.20220121.1" PrivateAssets="All" />
152+
<PackageReference Update="Microsoft.Azure.AutoRest.CSharp" Version="3.0.0-beta.20220126.3" PrivateAssets="All" />
153153
<PackageReference Update="Azure.ClientSdk.Analyzers" Version="0.1.1-dev.20220111.2" PrivateAssets="All" />
154154
<PackageReference Update="coverlet.collector" Version="1.3.0" PrivateAssets="All" />
155155
<PackageReference Update="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="3.3.1" PrivateAssets="All" />

sdk/agrifood/Azure.Verticals.AgriFood.Farming/src/Generated/ApplicationDataClient.cs

Lines changed: 10 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sdk/agrifood/Azure.Verticals.AgriFood.Farming/src/Generated/AttachmentsClient.cs

Lines changed: 10 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)