diff --git a/sdk/keyvault/keyvault-certificates/README.md b/sdk/keyvault/keyvault-certificates/README.md index 39eff69af1be..3fe40f6c1491 100644 --- a/sdk/keyvault/keyvault-certificates/README.md +++ b/sdk/keyvault/keyvault-certificates/README.md @@ -136,6 +136,25 @@ const client = new CertificateClient(url, credential); - A **Certificate backup** can be generated from any created certificate. These backups come as binary data, and can only be used to regenerate a previously deleted certificate. +## Specifying the Azure Key Vault service API version + +By default, this package uses the latest Azure Key Vault service version which is `7.1-preview`. The only other version that is supported is `7.0`. You can change the service version being used by setting the option `apiVersion` in the client constructor as shown below: + +```typescript +const { DefaultAzureCredential } = require("@azure/identity"); +const { CertificateClient } = require("@azure/keyvault-certificates"); + +const credential = new DefaultAzureCredential(); + +const vaultName = ""; +const url = `https://${vaultName}.vault.azure.net`; + +// Change the Azure Key Vault service API version being used via the `apiVersion` option +const client = new CertificateClient(url, credential, { + apiVersion: "7.0" +}); +``` + ## Examples The following sections provide code snippets that cover some of the common diff --git a/sdk/keyvault/keyvault-keys/README.md b/sdk/keyvault/keyvault-keys/README.md index 3a3c34d62432..582e6623496d 100644 --- a/sdk/keyvault/keyvault-keys/README.md +++ b/sdk/keyvault/keyvault-keys/README.md @@ -148,6 +148,25 @@ const url = `https://${vaultName}.vault.azure.net`; const client = new KeyClient(url, credential); ``` +## Specifying the Azure Key Vault service API version + +By default, this package uses the latest Azure Key Vault service version which is `7.1-preview`. The only other version that is supported is `7.0`. You can change the service version being used by setting the option `apiVersion` in the client constructor as shown below: + +```typescript +const { DefaultAzureCredential } = require("@azure/identity"); +const { KeyClient } = require("@azure/keyvault-keys"); + +const credential = new DefaultAzureCredential(); + +const vaultName = ""; +const url = `https://${vaultName}.vault.azure.net`; + +// Change the Azure Key Vault service API version being used via the `apiVersion` option +const client = new KeyClient(url, credential, { + apiVersion: "7.0" +}); +``` + ## Examples The following sections provide code snippets that cover some of the common diff --git a/sdk/keyvault/keyvault-secrets/README.md b/sdk/keyvault/keyvault-secrets/README.md index 3a856c3563ac..8e7bd4ac1435 100644 --- a/sdk/keyvault/keyvault-secrets/README.md +++ b/sdk/keyvault/keyvault-secrets/README.md @@ -137,6 +137,25 @@ const url = `https://${vaultName}.vault.azure.net`; const client = new SecretClient(url, credential); ``` +## Specifying the Azure Key Vault service API version + +By default, this package uses the latest Azure Key Vault service version which is `7.1-preview`. The only other version that is supported is `7.0`. You can change the service version being used by setting the option `apiVersion` in the client constructor as shown below: + +```typescript +const { DefaultAzureCredential } = require("@azure/identity"); +const { SecretClient } = require("@azure/keyvault-secrets"); + +const credential = new DefaultAzureCredential(); + +const vaultName = ""; +const url = `https://${vaultName}.vault.azure.net`; + +// Change the Azure Key Vault service API version being used via the `apiVersion` option +const client = new SecretClient(url, credential, { + apiVersion: "7.0" +}); +``` + ## Examples The following sections provide code snippets that cover some of the common