Esempio n. 1
0
        ///GENMHASH:0202A00A1DCF248D2647DBDBEF2CA865:8F640179247B56242D756EB9A20DC705
        public async override Task <IBatchAccount> CreateResourceAsync(CancellationToken cancellationToken = default(CancellationToken))
        {
            HandleStorageSettings();
            var batchAccountCreateParametersInner = new BatchAccountCreateParametersInner();

            if (autoStorage != null)
            {
                batchAccountCreateParametersInner.AutoStorage = new AutoStorageBaseProperties
                {
                    StorageAccountId = autoStorage.StorageAccountId
                };
            }
            else
            {
                batchAccountCreateParametersInner.AutoStorage = null;
            }

            batchAccountCreateParametersInner.Location = Inner.Location;
            batchAccountCreateParametersInner.Tags     = Inner.Tags;

            var batchAccountInner = await Manager.Inner.BatchAccount.CreateAsync(
                ResourceGroupName,
                Name,
                batchAccountCreateParametersInner,
                cancellationToken);

            creatableStorageAccountKey = null;
            SetInner(batchAccountInner);
            await applicationsImpl.CommitAndGetAllAsync(cancellationToken);

            return(this);
        }
 /// <summary>
 /// Creates a new Batch account with the specified parameters. Existing
 /// accounts cannot be updated with this API and should instead be updated with
 /// the Update Batch Account API.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group that contains the Batch account.
 /// </param>
 /// <param name='accountName'>
 /// A name for the Batch account which must be unique within the region. Batch
 /// account names must be between 3 and 24 characters in length and must use
 /// only numbers and lowercase letters. This name is used as part of the DNS
 /// name that is used to access the Batch service in the region in which the
 /// account is created. For example:
 /// http://accountname.region.batch.azure.com/.
 /// </param>
 /// <param name='parameters'>
 /// Additional parameters for account creation.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <BatchAccountInner> CreateAsync(this IBatchAccountOperations operations, string resourceGroupName, string accountName, BatchAccountCreateParametersInner parameters, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.CreateWithHttpMessagesAsync(resourceGroupName, accountName, parameters, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }