summary import { VaultCreateOrUpdateParameters , KeyVaultManagementClient } from "@msinternal/keyvault-resource-manager" ; import { DefaultAzureCredential } from "@azure/identity" ; async function createANewVaultOrUpdateAnExistingVault ( ) { const subscriptionId = "00000000-0000-0000-0000-000000000000" ; const resourceGroupName = "sample-resource-group" ; const vaultName = "sample-vault" ; const parameters = { location : "westus" , properties : { accessPolicies : [ { objectId : "00000000-0000-0000-0000-000000000000" , permissions : { certificates : [ "get" , "list" , "delete" , "create" , "import" , "update" , "managecontacts" , "getissuers" , "listissuers" , "setissuers" , "deleteissuers" , "manageissuers" , "recover" , "purge" ] , keys : [ "encrypt" , "decrypt" , "wrapKey" , "unwrapKey" , "sign" , "verify" , "get" , "list" , "create" , "update" , "import" , "delete" , "backup" , "restore" , "recover" , "purge" ] , secrets : [ "get" , "list" , "set" , "delete" , "backup" , "restore" , "recover" , "purge" ] } , tenantId : "00000000-0000-0000-0000-000000000000" } ] , enabledForDeployment : true , enabledForDiskEncryption : true , enabledForTemplateDeployment : true , publicNetworkAccess : "Enabled" , sku : { name : "standard" , family : "A" } , tenantId : "00000000-0000-0000-0000-000000000000" } } ; const credential = new DefaultAzureCredential ( ) ; const client = new KeyVaultManagementClient ( credential , subscriptionId ) ; const result = await client . vaults . beginCreateOrUpdateAndWait ( resourceGroupName , vaultName , parameters ) ; console . log ( result ) ; } createANewVaultOrUpdateAnExistingVault ( ) . catch ( console . error ) ;