Microsoft.Azure.Commands.Batch.Models.BatchClient.CreateAccount C# (CSharp) Method

CreateAccount() public method

Creates a new Batch account
public CreateAccount ( string resourceGroupName, string accountName, string location, Hashtable tags, string autoStorageAccountId ) : BatchAccountContext
resourceGroupName string The name of the resource group in which to create the account
accountName string The account name
location string The location to use when creating the account
tags Hashtable The tags to associate with the account
autoStorageAccountId string The resource id of the storage account to be used for auto storage.
return BatchAccountContext
        public virtual BatchAccountContext CreateAccount(string resourceGroupName, string accountName, string location, Hashtable tags, string autoStorageAccountId)
        {
            Dictionary<string, string> tagDictionary = TagsConversionHelper.CreateTagDictionary(tags, validate: true);

            AutoStorageBaseProperties autoStorage = (string.IsNullOrEmpty(autoStorageAccountId)) ? null : new AutoStorageBaseProperties
            {
                StorageAccountId = autoStorageAccountId
            };

            var response = BatchManagementClient.BatchAccount.Create(resourceGroupName, accountName, new BatchAccountCreateParameters()
            {
                Location = location,
                Tags = tagDictionary,
                AutoStorage = autoStorage
            });

            var context = BatchAccountContext.ConvertAccountResourceToNewAccountContext(response);
            return context;
        }
BatchClient