Skip to content

Commit 9c0f758

Browse files
authored
ADO 5883 - Adding scope support for ArmClient initialization (Azure#22897)
* Update to support scope * Revert "Update to support scope" This reverts commit 4aeacdf. * Update in ArmClientOption * Update Azure.ResourceManager.netstandard2.0.cs
1 parent d1ab867 commit 9c0f758

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

sdk/resourcemanager/Azure.ResourceManager/api/Azure.ResourceManager.netstandard2.0.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ public sealed partial class ArmClientOptions : Azure.Core.ClientOptions
4040
{
4141
public ArmClientOptions() { }
4242
public Azure.ResourceManager.ApiVersions ApiVersions { get { throw null; } }
43+
public string Scope { get { throw null; } set { } }
4344
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
4445
public object GetOverrideObject<T>(System.Func<object> objectConstructor) { throw null; }
4546
}

sdk/resourcemanager/Azure.ResourceManager/src/ArmClient.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ public ArmClient(
104104
Credential = credential;
105105
BaseUri = baseUri ?? new Uri(DefaultUri);
106106
ClientOptions = options?.Clone() ?? new ArmClientOptions();
107-
Pipeline = ManagementPipelineBuilder.Build(Credential, BaseUri, options ?? ClientOptions);
107+
Pipeline = ManagementPipelineBuilder.Build(Credential, options.Scope, options ?? ClientOptions);
108108

109109
_tenant = new TenantOperations(ClientOptions, Credential, BaseUri, Pipeline);
110110
DefaultSubscription = string.IsNullOrWhiteSpace(defaultSubscriptionId)

sdk/resourcemanager/Azure.ResourceManager/src/ArmClientOptions.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ public sealed class ArmClientOptions : ClientOptions
2020
/// </summary>
2121
public ApiVersions ApiVersions { get; private set; }
2222

23+
/// <summary>
24+
/// Gets the ApiVersions object
25+
/// </summary>
26+
public string Scope { get; set; } = "https://management.core.windows.net/.default";
27+
2328
/// <summary>
2429
/// Initializes a new instance of the <see cref="ArmClientOptions"/> class.
2530
/// </summary>

0 commit comments

Comments
 (0)