public virtual BatchAccountContext UpdateAccount(string resourceGroupName, string accountName, Hashtable tags, string autoStorageAccountId)
{
if (string.IsNullOrEmpty(resourceGroupName))
{
// use resource mgr to see if account exists and then use resource group name to do the actual lookup
resourceGroupName = GetGroupForAccount(accountName);
}
Dictionary<string, string> tagDictionary = TagsConversionHelper.CreateTagDictionary(tags, validate: true);
// need to the location in order to call
var getResponse = BatchManagementClient.BatchAccount.Get(resourceGroupName, accountName);
AutoStorageBaseProperties autoStorage = (autoStorageAccountId == null) ? null : new AutoStorageBaseProperties
{
StorageAccountId = autoStorageAccountId
};
var response = BatchManagementClient.BatchAccount.Create(resourceGroupName, accountName, new BatchAccountCreateParameters()
{
Location = getResponse.Location,
Tags = tagDictionary,
AutoStorage = autoStorage
});
BatchAccountContext context = BatchAccountContext.ConvertAccountResourceToNewAccountContext(response);
return context;
}