summary import { VaultCheckNameAvailabilityParameters , KeyVaultManagementClient } from "@msinternal/keyvault-resource-manager" ; import { DefaultAzureCredential } from "@azure/identity" ; async function validateAVaultName ( ) { const subscriptionId = "00000000-0000-0000-0000-000000000000" ; const vaultName = { name : "sample-vault" , type : "Microsoft.KeyVault/vaults" } ; const credential = new DefaultAzureCredential ( ) ; const client = new KeyVaultManagementClient ( credential , subscriptionId ) ; const result = await client . vaults . checkNameAvailability ( vaultName ) ; console . log ( result ) ; } validateAVaultName ( ) . catch ( console . error ) ;