You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
description: Learn how to create, retrieve, and delete certificates from an Azure key vault using the JavaScript client library
3
+
description: Learn how to create, retrieve, and delete certificates from an Azure key vault using the JavaScript client library with either JavaScript or TypeScript
# Quickstart: Azure Key Vault certificate client library for JavaScript
15
16
16
-
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.
17
18
18
19
Key Vault client library resources:
19
20
@@ -23,6 +24,8 @@ For more information about Key Vault and certificates, see:
23
24
-[Key Vault Overview](../general/overview.md)
24
25
-[Certificates Overview](about-certificates.md)
25
26
27
+
::: zone pivot="programming-language-javascript"
28
+
26
29
## Prerequisites
27
30
28
31
- An Azure subscription - [create one for free](https://azure.microsoft.com/free/?WT.mc_id=A261C142F).
@@ -33,6 +36,19 @@ For more information about Key Vault and certificates, see:
This quickstart assumes you're running [Azure CLI](/cli/azure/install-azure-cli).
37
53
38
54
## Sign in to Azure
@@ -86,25 +102,25 @@ Create a Node.js application that uses your key vault.
86
102
87
103
## Set environment variables
88
104
89
-
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`.
90
106
91
107
### [Windows](#tab/windows)
92
108
93
109
```cmd
94
-
set KEY_VAULT_NAME=<your-key-vault-name>
110
+
set KEY_VAULT_URL=<your-key-vault-endpoint>
95
111
````
96
112
97
113
### [PowerShell](#tab/powershell)
98
114
99
115
Windows PowerShell
100
116
```powershell
101
-
$Env:KEY_VAULT_NAME="<your-key-vault-name>"
117
+
$Env:KEY_VAULT_URL="<your-key-vault-endpoint>"
102
118
```
103
119
104
120
### [macOS or Linux](#tab/linux)
105
121
106
122
```cmd
107
-
export KEY_VAULT_NAME=<your-key-vault-name>
123
+
export KEY_VAULT_URL=<your-key-vault-endpoint>
108
124
```
109
125
---
110
126
@@ -114,7 +130,7 @@ Application requests to most Azure services must be authorized. Using the [Defau
114
130
115
131
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).
116
132
117
-
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).
118
134
119
135
## Code example
120
136
@@ -134,7 +150,9 @@ This code uses the following [Key Vault Certificate classes and methods](/javasc
134
150
135
151
### Set up the app framework
136
152
137
-
1. Create new text file and paste the following code into the **index.js** file.
153
+
::: zone pivot="programming-language-javascript"
154
+
155
+
* Create new text file and paste the following code into the **index.js** file.
0 commit comments