/// <summary> /// Creates or updates a resource group. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group to create or update. Can include /// alphanumeric, underscore, parentheses, hyphen, period (except at end), and /// Unicode characters that match the allowed characters. /// </param> /// <param name='parameters'> /// Parameters supplied to the create or update a resource group. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <ResourceGroup> CreateOrUpdateAsync(this IResourceGroupsOperations operations, string resourceGroupName, ResourceGroup parameters, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, parameters, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
public async override Task <IResourceGroup> CreateResourceAsync(CancellationToken cancellationToken) { ResourceGroupInner param = new ResourceGroupInner(); param.Location = Inner.Location; param.Tags = Inner.Tags; var response = await client.CreateOrUpdateWithHttpMessagesAsync(Name, param, cancellationToken : cancellationToken); SetInner(response.Body); return(this); }