summary import { KeyVaultManagementClient } from "@msinternal/keyvault-resource-manager" ; import { DefaultAzureCredential } from "@azure/identity" ; async function listVaultsInTheSpecifiedResourceGroup ( ) { const subscriptionId = "00000000-0000-0000-0000-000000000000" ; const resourceGroupName = "sample-group" ; const top = 1 ; const options = { top : top } ; const credential = new DefaultAzureCredential ( ) ; const client = new KeyVaultManagementClient ( credential , subscriptionId ) ; const resArray = new Array ( ) ; for await ( let item of client . vaults . listByResourceGroup ( resourceGroupName , options ) ) { resArray . push ( item ) ; } console . log ( resArray ) ; } listVaultsInTheSpecifiedResourceGroup ( ) . catch ( console . error ) ;