Microsoft.Azure.Commands.Batch.Models.BatchClient.UpdateAccount C# (CSharp) Méthode

UpdateAccount() public méthode

Updates an existing Batch account
public UpdateAccount ( string resourceGroupName, string accountName, Hashtable tags, string autoStorageAccountId ) : BatchAccountContext
resourceGroupName string The name of the resource group the account is under. If unspecified, it will be looked up.
accountName string The account name
tags Hashtable New tags to associate with the account
autoStorageAccountId string The resource id of the storage account to be used for auto storage.
Résultat BatchAccountContext
        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;
        }
BatchClient