/// <summary> /// List blueprint assignments within a subscription. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='scope'> /// The scope of the resource. Valid scopes are: management group (format: /// '/providers/Microsoft.Management/managementGroups/{managementGroup}'), /// subscription (format: '/subscriptions/{subscriptionId}'). /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <IPage <Assignment> > ListAsync(this IAssignmentsOperations operations, string scope, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListWithHttpMessagesAsync(scope, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Lists Blueprint assignments within a management group. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='managementGroupName'> /// The name of the management group where the assignments are saved. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <IPage <Assignment> > ListInManagementGroupAsync(this IAssignmentsOperations operations, string managementGroupName, CancellationToken cancellationToken = default(CancellationToken)) { var resourceScope = string.Format(Constants.ResourceScopes.ManagementGroupScope, managementGroupName); using (var _result = await operations.ListWithHttpMessagesAsync(resourceScope, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// List Blueprint assignments within a subscription. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='subscriptionId'> /// azure subscriptionId, which we assign the blueprint to. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <IPage <Assignment> > ListInSubscriptionAsync(this IAssignmentsOperations operations, string subscriptionId, CancellationToken cancellationToken = default(CancellationToken)) { var scope = string.Format(Constants.ResourceScopes.SubscriptionScope, subscriptionId); using (var _result = await operations.ListWithHttpMessagesAsync(scope, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }