Skip to content

Commit 0cce2e2

Browse files
committed
endpoint
1 parent 172cc84 commit 0cce2e2

File tree

3 files changed

+41
-44
lines changed

3 files changed

+41
-44
lines changed

articles/key-vault/certificates/quick-create-node.md

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,18 @@ title: Quickstart - Azure Key Vault certificate client library for JavaScript (
33
description: Learn how to create, retrieve, and delete certificates from an Azure key vault using the JavaScript client library with either JavaScript or TypeScript
44
author: msmbaldwin
55
ms.author: mbaldwin
6-
ms.date: 07/24/2024
6+
ms.date: 07/30/2024
77
ms.service: key-vault
88
ms.subservice: certificates
99
ms.topic: quickstart
1010
ms.devlang: javascript
11-
ms.custom: devx-track-js, mode-api, passwordless-js
11+
ms.custom: devx-track-js, mode-api, passwordless-js, devx-track-ts
1212
zone_pivot_groups: programming-languages-set-functions-nodejs
1313
---
1414

1515
# Quickstart: Azure Key Vault certificate client library for JavaScript
1616

17-
Get started with the Azure Key Vault certificate client library for JavaScript. [Azure Key Vault](../general/overview.md) is a cloud service that provides a secure store for certificates. You can securely store keys, passwords, certificates, and other secrets. Azure key vaults may be created and managed through the Azure portal. In this quickstart, you learn how to create, retrieve, and delete certificates from an Azure key vault using the JavaScript client library
17+
Get started with the Azure Key Vault certificate client library for JavaScript. [Azure Key Vault](../general/overview.md) is a cloud service that provides a secure store for certificates. You can securely store keys, passwords, certificates, and other secrets. Azure key vaults may be created and managed through the Azure portal. In this quickstart, you learn how to create, retrieve, and delete certificates from an Azure key vault using the JavaScript client library.
1818

1919
Key Vault client library resources:
2020

@@ -102,25 +102,25 @@ Create a Node.js application that uses your key vault.
102102
103103
## Set environment variables
104104
105-
This application is using key vault name as an environment variable called `KEY_VAULT_NAME`.
105+
This application is using key vault endpoint as an environment variable called `KEY_VAULT_URL`.
106106
107107
### [Windows](#tab/windows)
108108
109109
```cmd
110-
set KEY_VAULT_NAME=<your-key-vault-name>
110+
set KEY_VAULT_URL=<your-key-vault-endpoint>
111111
````
112112
113113
### [PowerShell](#tab/powershell)
114114
115115
Windows PowerShell
116116
```powershell
117-
$Env:KEY_VAULT_NAME="<your-key-vault-name>"
117+
$Env:KEY_VAULT_URL="<your-key-vault-endpoint>"
118118
```
119119

120120
### [macOS or Linux](#tab/linux)
121121

122122
```cmd
123-
export KEY_VAULT_NAME=<your-key-vault-name>
123+
export KEY_VAULT_URL=<your-key-vault-endpoint>
124124
```
125125
---
126126

@@ -130,7 +130,7 @@ Application requests to most Azure services must be authorized. Using the [Defau
130130

131131
In this quickstart, `DefaultAzureCredential` authenticates to key vault using the credentials of the local development user logged into the Azure CLI. When the application is deployed to Azure, the same `DefaultAzureCredential` code can automatically discover and use a managed identity that is assigned to an App Service, Virtual Machine, or other services. For more information, see [Managed Identity Overview](/azure/active-directory/managed-identities-azure-resources/overview).
132132

133-
In this code, the name of your key vault is used to create the key vault URI, in the format `https://<your-key-vault-name>.vault.azure.net`. For more information about authenticating to key vault, see [Developer's Guide](/azure/key-vault/general/developers-guide#authenticate-to-key-vault-in-code).
133+
In this code, the endpoint of your key vault is used to create the key vault client. The endpoint format looks like `https://<your-key-vault-name>.vault.azure.net` but may change for sovereign clouds. For more information about authenticating to key vault, see [Developer's Guide](/azure/key-vault/general/developers-guide#authenticate-to-key-vault-in-code).
134134

135135
## Code example
136136

@@ -166,11 +166,10 @@ This code uses the following [Key Vault Certificate classes and methods](/javasc
166166
// - AZURE_CLIENT_SECRET: The client secret for the registered application
167167
const credential = new DefaultAzureCredential();
168168

169-
const keyVaultName = process.env["KEY_VAULT_NAME"];
170-
if(!keyVaultName) throw new Error("KEY_VAULT_NAME is empty");
171-
const url = "https://" + keyVaultName + ".vault.azure.net";
169+
const keyVaultUrl = process.env["KEY_VAULT_URL"];
170+
if(!keyVaultUrl) throw new Error("KEY_VAULT_URL is empty");
172171

173-
const client = new CertificateClient(url, credential);
172+
const client = new CertificateClient(keyVaultUrl, credential);
174173

175174
const uniqueString = new Date().getTime();
176175
const certificateName = `cert${uniqueString}`;
@@ -274,12 +273,12 @@ This code uses the following [Key Vault Certificate classes and methods](/javasc
274273
"createdOn": 2021-11-29T20:17:45.000Z,
275274
"updatedOn": 2021-11-29T20:17:45.000Z,
276275
"expiresOn": 2022-11-29T20:17:45.000Z,
277-
"id": "https://YOUR-KEY-VAULT-NAME.vault.azure.net/certificates/YOUR-CERTIFICATE-NAME/YOUR-CERTIFICATE-VERSION",
276+
"id": "https://YOUR-KEY-VAULT-NAME-ENDPOINT/certificates/YOUR-CERTIFICATE-NAME/YOUR-CERTIFICATE-VERSION",
278277
"enabled": false,
279278
"notBefore": 2021-11-29T20:07:45.000Z,
280279
"recoveryLevel": "Recoverable+Purgeable",
281280
"name": "YOUR-CERTIFICATE-NAME",
282-
"vaultUrl": "https://YOUR-KEY-VAULT-NAME.vault.azure.net",
281+
"vaultUrl": "https://YOUR-KEY-VAULT-NAME-ENDPOINT",
283282
"version": "YOUR-CERTIFICATE-VERSION",
284283
"tags": undefined,
285284
"x509Thumbprint": undefined,

articles/key-vault/keys/quick-create-node.md

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ ms.service: key-vault
88
ms.subservice: keys
99
ms.topic: quickstart
1010
ms.devlang: javascript
11-
ms.custom: devx-track-js, mode-api, passwordless-js
11+
ms.custom: devx-track-js, mode-api, passwordless-js, devx-track-ts
1212
zone_pivot_groups: programming-languages-set-functions-nodejs
1313
---
1414

1515
# Quickstart: Azure Key Vault key client library for JavaScript
1616

1717

18-
Get started with the Azure Key Vault key client library for JavaScript. [Azure Key Vault](../general/overview.md) is a cloud service that provides a secure store for cryptographic keys. You can securely store keys, passwords, certificates, and other secrets. Azure key vaults may be created and managed through the Azure portal. In this quickstart, you learn how to create, retrieve, and delete keys from an Azure key vault using the JavaScript key client library
18+
Get started with the Azure Key Vault key client library for JavaScript. [Azure Key Vault](../general/overview.md) is a cloud service that provides a secure store for cryptographic keys. You can securely store keys, passwords, certificates, and other secrets. Azure key vaults may be created and managed through the Azure portal. In this quickstart, you learn how to create, retrieve, and delete keys from an Azure key vault using the JavaScript key client library.
1919

2020
Key Vault client library resources:
2121

@@ -103,25 +103,25 @@ Create a Node.js application that uses your key vault.
103103
104104
## Set environment variables
105105
106-
This application is using key vault name as an environment variable called `KEY_VAULT_NAME`.
106+
This application is using key vault endpoint as an environment variable called `KEY_VAULT_URL`.
107107
108108
### [Windows](#tab/windows)
109109
110110
```cmd
111-
set KEY_VAULT_NAME=<your-key-vault-name>
111+
set KEY_VAULT_URL=<your-key-vault-endpoint>
112112
````
113113
114114
### [PowerShell](#tab/powershell)
115115
116116
Windows PowerShell
117117
```powershell
118-
$Env:KEY_VAULT_NAME="<your-key-vault-name>"
118+
$Env:KEY_VAULT_URL="<your-key-vault-endpoint>"
119119
```
120120

121121
### [macOS or Linux](#tab/linux)
122122

123123
```cmd
124-
export KEY_VAULT_NAME=<your-key-vault-name>
124+
export KEY_VAULT_URL=<your-key-vault-endpoint>
125125
```
126126
---
127127

@@ -131,7 +131,7 @@ Application requests to most Azure services must be authorized. Using the [Defau
131131

132132
In this quickstart, `DefaultAzureCredential` authenticates to key vault using the credentials of the local development user logged into the Azure CLI. When the application is deployed to Azure, the same `DefaultAzureCredential` code can automatically discover and use a managed identity that is assigned to an App Service, Virtual Machine, or other services. For more information, see [Managed Identity Overview](/azure/active-directory/managed-identities-azure-resources/overview).
133133

134-
In this code, the name of your key vault is used to create the key vault URI, in the format `https://<your-key-vault-name>.vault.azure.net`. For more information about authenticating to key vault, see [Developer's Guide](/azure/key-vault/general/developers-guide#authenticate-to-key-vault-in-code).
134+
In this code, the endpoint of your key vault is used to create the key vault client. The endpoint format looks like `https://<your-key-vault-name>.vault.azure.net` but may change for sovereign clouds. For more information about authenticating to key vault, see [Developer's Guide](/azure/key-vault/general/developers-guide#authenticate-to-key-vault-in-code).
135135

136136
## Code example
137137

@@ -169,11 +169,10 @@ This code uses the following [Key Vault Secret classes and methods](/javascript/
169169
// - AZURE_CLIENT_SECRET: The client secret for the registered application
170170
const credential = new DefaultAzureCredential();
171171

172-
const keyVaultName = process.env["KEY_VAULT_NAME"];
173-
if(!keyVaultName) throw new Error("KEY_VAULT_NAME is empty");
174-
const url = "https://" + keyVaultName + ".vault.azure.net";
172+
const keyVaultUrl = process.env["KEY_VAULT_URL"];
173+
if(!keyVaultUrl) throw new Error("KEY_VAULT_URL is empty");
175174

176-
const client = new KeyClient(url, credential);
175+
const client = new KeyClient(keyVaultUrl, credential);
177176

178177
const uniqueString = Date.now();
179178
const keyName = `sample-key-${uniqueString}`;
@@ -260,12 +259,12 @@ This code uses the following [Key Vault Secret classes and methods](/javascript/
260259
```JSON
261260
"key": {
262261
"key": {
263-
"kid": "https://YOUR-KEY-VAULT-NAME.vault.azure.net/keys/YOUR-KEY-NAME/YOUR-KEY-VERSION",
262+
"kid": "https://YOUR-KEY-VAULT-ENDPOINT/keys/YOUR-KEY-NAME/YOUR-KEY-VERSION",
264263
"kty": "YOUR-KEY-TYPE",
265264
"keyOps": [ ARRAY-OF-VALID-OPERATIONS ],
266265
... other properties based on key type
267266
},
268-
"id": "https://YOUR-KEY-VAULT-NAME.vault.azure.net/keys/YOUR-KEY-NAME/YOUR-KEY-VERSION",
267+
"id": "https://YOUR-KEY-VAULT-ENDPOINT/keys/YOUR-KEY-NAME/YOUR-KEY-VERSION",
269268
"name": "YOUR-KEY-NAME",
270269
"keyOperations": [ ARRAY-OF-VALID-OPERATIONS ],
271270
"keyType": "YOUR-KEY-TYPE",
@@ -280,11 +279,11 @@ This code uses the following [Key Vault Secret classes and methods](/javascript/
280279
"recoveryLevel": "Recoverable+Purgeable",
281280
"exportable": undefined,
282281
"releasePolicy": undefined,
283-
"vaultUrl": "https://YOUR-KEY-VAULT-NAME.vault.azure.net",
282+
"vaultUrl": "https://YOUR-KEY-VAULT-ENDPOINT",
284283
"version": "YOUR-KEY-VERSION",
285284
"name": "YOUR-KEY-VAULT-NAME",
286285
"managed": undefined,
287-
"id": "https://YOUR-KEY-VAULT-NAME.vault.azure.net/keys/YOUR-KEY-NAME/YOUR-KEY-VERSION"
286+
"id": "https://YOUR-KEY-VAULT-ENDPOINT/keys/YOUR-KEY-NAME/YOUR-KEY-VERSION"
288287
}
289288
}
290289
```

articles/key-vault/secrets/quick-create-node.md

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ ms.service: azure-key-vault
88
ms.subservice: secrets
99
ms.topic: quickstart
1010
ms.devlang: javascript
11-
ms.custom: devx-track-js, mode-api, passwordless-js
11+
ms.custom: devx-track-js, mode-api, passwordless-js, devx-track-ts
1212
zone_pivot_groups: programming-languages-set-functions-nodejs
1313
---
1414

1515
# Quickstart: Azure Key Vault secret client library for JavaScript
1616

17-
Get started with the Azure Key Vault secret client library for JavaScript. [Azure Key Vault](../general/overview.md) is a cloud service that provides a secure store for secrets. You can securely store keys, passwords, certificates, and other secrets. Azure key vaults may be created and managed through the Azure portal. In this quickstart, you learn how to create, retrieve, and delete secrets from an Azure key vault using the JavaScript client library
17+
Get started with the Azure Key Vault secret client library for JavaScript. [Azure Key Vault](../general/overview.md) is a cloud service that provides a secure store for secrets. You can securely store keys, passwords, certificates, and other secrets. Azure key vaults may be created and managed through the Azure portal. In this quickstart, you learn how to create, retrieve, and delete secrets from an Azure key vault using the JavaScript client library.
1818

1919
Key Vault client library resources:
2020

@@ -105,25 +105,25 @@ Create a Node.js application that uses your key vault.
105105
106106
## Set environment variables
107107
108-
This application is using key vault name as an environment variable called `KEY_VAULT_NAME`.
108+
This application is using key vault endpoint as an environment variable called `KEY_VAULT_URL`.
109109
110110
### [Windows](#tab/windows)
111111
112112
```cmd
113-
set KEY_VAULT_NAME=<your-key-vault-name>
113+
set KEY_VAULT_URL=<your-key-vault-endpoint>
114114
````
115115
116116
### [PowerShell](#tab/powershell)
117117
118118
Windows PowerShell
119119
```powershell
120-
$Env:KEY_VAULT_NAME="<your-key-vault-name>"
120+
$Env:KEY_VAULT_URL="<your-key-vault-endpoint>"
121121
```
122122

123123
### [macOS or Linux](#tab/linux)
124124

125125
```cmd
126-
export KEY_VAULT_NAME=<your-key-vault-name>
126+
export KEY_VAULT_URL=<your-key-vault-endpoint>
127127
```
128128
---
129129

@@ -134,7 +134,7 @@ Application requests to most Azure services must be authorized. Using the [Defau
134134

135135
In this quickstart, `DefaultAzureCredential` authenticates to key vault using the credentials of the local development user logged into the Azure CLI. When the application is deployed to Azure, the same `DefaultAzureCredential` code can automatically discover and use a managed identity that is assigned to an App Service, Virtual Machine, or other services. For more information, see [Managed Identity Overview](/azure/active-directory/managed-identities-azure-resources/overview).
136136

137-
In this code, the name of your key vault is used to create the key vault URI, in the format `https://<your-key-vault-name>.vault.azure.net`. For more information about authenticating to key vault, see [Developer's Guide](/azure/key-vault/general/developers-guide#authenticate-to-key-vault-in-code).
137+
In this code, the endpoint of your key vault is used to create the key vault client. The endpoint format looks like `https://<your-key-vault-name>.vault.azure.net` but may change for sovereign clouds. For more information about authenticating to key vault, see [Developer's Guide](/azure/key-vault/general/developers-guide#authenticate-to-key-vault-in-code).
138138

139139
## Code example
140140

@@ -167,11 +167,10 @@ This code uses the following [Key Vault Secret classes and methods](/javascript/
167167
// - AZURE_CLIENT_SECRET: The client secret for the registered application
168168
const credential = new DefaultAzureCredential();
169169

170-
const keyVaultName = process.env["KEY_VAULT_NAME"];
171-
if(!keyVaultName) throw new Error("KEY_VAULT_NAME is empty");
172-
const url = "https://" + keyVaultName + ".vault.azure.net";
170+
const keyVaultUrl = process.env["KEY_VAULT_URL"];
171+
if(!keyVaultUrl) throw new Error("KEY_VAULT_URL is empty");
173172

174-
const client = new SecretClient(url, credential);
173+
const client = new SecretClient(keyVaultUrl, credential);
175174

176175
// Create a secret
177176
// The secret can be a string of any kind. For example,
@@ -243,8 +242,8 @@ This code uses the following [Key Vault Secret classes and methods](/javascript/
243242
"enabled": true,
244243
"recoverableDays": 90,
245244
"recoveryLevel": "Recoverable+Purgeable",
246-
"id": "https: //YOUR-KEYVAULT-NAME.vault.azure.net/secrets/secret1637692472606/YOUR-VERSION",
247-
"vaultUrl": "https: //YOUR-KEYVAULT-NAME.vault.azure.net",
245+
"id": "https: //YOUR-KEYVAULT-ENDPOINT.vault.azure.net/secrets/secret1637692472606/YOUR-VERSION",
246+
"vaultUrl": "https: //YOUR-KEYVAULT-ENDPOINT.vault.azure.net",
248247
"version": "YOUR-VERSION",
249248
"name": "secret1637692472606"
250249
}
@@ -259,8 +258,8 @@ This code uses the following [Key Vault Secret classes and methods](/javascript/
259258
"enabled": true,
260259
"recoverableDays": 90,
261260
"recoveryLevel": "Recoverable+Purgeable",
262-
"id": "https: //YOUR-KEYVAULT-NAME.vault.azure.net/secrets/secret1637692472606/YOUR-VERSION",
263-
"vaultUrl": "https: //YOUR-KEYVAULT-NAME.vault.azure.net",
261+
"id": "https: //YOUR-KEYVAULT-ENDPOINT/secrets/secret1637692472606/YOUR-VERSION",
262+
"vaultUrl": "https: //YOUR-KEYVAULT-ENDPOINT",
264263
"version": "YOUR-VERSION",
265264
"name": "secret1637692472606"
266265
```

0 commit comments

Comments
 (0)