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

GetKeys() public method

Gets the keys associated with the Batch account
public GetKeys ( string resourceGroupName, string accountName ) : 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
return BatchAccountContext
        public virtual BatchAccountContext GetKeys(string resourceGroupName, string accountName)
        {
            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 context = GetAccount(resourceGroupName, accountName);
            var keysResponse = BatchManagementClient.BatchAccount.GetKeys(resourceGroupName, accountName);
            context.PrimaryAccountKey = keysResponse.Primary;
            context.SecondaryAccountKey = keysResponse.Secondary;

            return context;
        }
BatchClient