Beispiel #1
0
        /// <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>

        public static Assignment CreateOrUpdateInManagementGroup(this IAssignmentsOperations operations, string managementGroupName, string assignmentName, Assignment assignment)
        {
            var resourceScope = string.Format(Constants.ResourceScopes.ManagementGroupScope, managementGroupName);

            return(operations.CreateOrUpdateAsync(resourceScope, assignmentName, assignment).GetAwaiter().GetResult());
        }
 /// <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>
 public static Assignment CreateOrUpdate(this IAssignmentsOperations operations, string scope, string assignmentName, Assignment assignment)
 {
     return(operations.CreateOrUpdateAsync(scope, assignmentName, assignment).GetAwaiter().GetResult());
 }
Beispiel #3
0
        /// <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>
        public static Assignment CreateOrUpdateInSubscription(this IAssignmentsOperations operations, string subscriptionId, string assignmentName, Assignment assignment)
        {
            var scope = string.Format(Constants.ResourceScopes.SubscriptionScope, subscriptionId);

            return(operations.CreateOrUpdateAsync(scope, assignmentName, assignment).GetAwaiter().GetResult());
        }