/// <summary> /// Get a blueprint assignment. /// </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='assignmentName'> /// Name of the blueprint assignment. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <Assignment> GetAsync(this IAssignmentsOperations operations, string scope, string assignmentName, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.GetWithHttpMessagesAsync(scope, assignmentName, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Gets a Blueprint assignment in 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 assignment is saved. /// </param> /// <param name='assignmentName'> /// The name of the assignment. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <Assignment> GetInManagementGroupAsync(this IAssignmentsOperations operations, string managementGroupName, string assignmentName, CancellationToken cancellationToken = default(CancellationToken)) { var resourceScope = string.Format(Constants.ResourceScopes.ManagementGroupScope, managementGroupName); using (var _result = await operations.GetWithHttpMessagesAsync(resourceScope, assignmentName, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Get a Blueprint assignment. /// </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='assignmentName'> /// name of the assignment. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <Assignment> GetInSubscriptionAsync(this IAssignmentsOperations operations, string subscriptionId, string assignmentName, CancellationToken cancellationToken = default(CancellationToken)) { var scope = string.Format(Constants.ResourceScopes.SubscriptionScope, subscriptionId); using (var _result = await operations.GetWithHttpMessagesAsync(scope, assignmentName, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }