/// <summary> /// Create or update 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='assignment'> /// Blueprint assignment object to save. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <Assignment> CreateOrUpdateAsync(this IAssignmentsOperations operations, string scope, string assignmentName, Assignment assignment, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(scope, assignmentName, assignment, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Creates or updates 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 will be saved. /// </param> /// <param name='assignmentName'> /// The name of the assignment. /// </param> /// <param name='assignment'> /// The assignment object to save. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <Assignment> CreateOrUpdateInManagementGroupAsync(this IAssignmentsOperations operations, string managementGroupName, string assignmentName, Assignment assignment, CancellationToken cancellationToken = default(CancellationToken)) { var resourceScope = string.Format(Constants.ResourceScopes.ManagementGroupScope, managementGroupName); using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceScope, assignmentName, assignment, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Create or update 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='assignment'> /// assignment object to save. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <Assignment> CreateOrUpdateInSubscriptionAsync(this IAssignmentsOperations operations, string subscriptionId, string assignmentName, Assignment assignment, CancellationToken cancellationToken = default(CancellationToken)) { var scope = string.Format(Constants.ResourceScopes.SubscriptionScope, subscriptionId); using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(scope, assignmentName, assignment, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }