public virtual BatchAccountContext RegenerateKeys(string resourceGroupName, string accountName, AccountKeyType keyType)
{
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);
}
var regenResponse = BatchManagementClient.BatchAccount.RegenerateKey(resourceGroupName, accountName, keyType);
var context = GetAccount(resourceGroupName, accountName);
context.PrimaryAccountKey = regenResponse.Primary;
context.SecondaryAccountKey = regenResponse.Secondary;
// build a new context to put the keys into
return context;
}