/// <summary> /// Associates existing subscription with the management group. /// /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='groupId'> /// Management Group ID. /// </param> /// <param name='subscriptionId'> /// Subscription ID. /// </param> /// <param name='cacheControl'> /// Indicates whether the request should utilize any caches. Populate the /// header with 'no-cache' value to bypass existing caches. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <SubscriptionUnderManagementGroup> CreateAsync(this IManagementGroupSubscriptionsOperations operations, string groupId, string subscriptionId, string cacheControl = "no-cache", CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.CreateWithHttpMessagesAsync(groupId, subscriptionId, cacheControl, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Associates existing subscription with the management group. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='groupId'> /// Management Group ID. /// </param> /// <param name='subscriptionId'> /// Subscription ID. /// </param> /// <param name='cacheControl'> /// Indicates that the request shouldn't utilize any caches. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task CreateAsync(this IManagementGroupSubscriptionsOperations operations, string groupId, string subscriptionId, string cacheControl = "no-cache", CancellationToken cancellationToken = default(CancellationToken)) { (await operations.CreateWithHttpMessagesAsync(groupId, subscriptionId, cacheControl, null, cancellationToken).ConfigureAwait(false)).Dispose(); }