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
Authenticating to your key vault and creating a key vault client depends on the environmental variables from the [Set environmental variables](#set-environmental-variables) step above, and the [SecretClient constructor](/javascript/api/@azure/keyvault-secrets/secretclient?view=azure-node-latest#secretclient-string--tokencredential--pipelineoptions-).
137
136
138
-
The name of your key vault is expanded to the key vault URI, in the format "https://<your-key-vault-name>.vault.azure.net".
137
+
The name of your key vault is expanded to the key vault URI, in the format `https://<your-key-vault-name>.vault.azure.net`.
139
138
140
139
```javascript
141
140
constkeyVaultName=process.env["KEY_VAULT_NAME"];
@@ -150,7 +149,7 @@ const client = new SecretClient(KVUri, credential);
150
149
Now that your application is authenticated, you can put a secret into your keyvault using the [client.setSecret method](/javascript/api/@azure/keyvault-secrets/secretclient?view=azure-node-latest#setsecret-string--string--setsecretoptions-) This requires a name for the secret -- we're using "mySecret" in this sample.
151
150
152
151
```javascript
153
-
waitclient.setSecret(secretName, secretValue);
152
+
awaitclient.setSecret(secretName, secretValue);
154
153
```
155
154
156
155
You can verify that the secret has been set with the [az keyvault secret show](/cli/azure/keyvault/secret?view=azure-cli-latest#az-keyvault-secret-show) command:
@@ -174,7 +173,7 @@ Your secret is now saved as `retrievedSecret.value`.
174
173
Finally, let's delete the secret from your key vault with the [client.beginDeleteSecret method](/javascript/api/@azure/keyvault-secrets/secretclient?view=azure-node-latest#begindeletesecret-string--begindeletesecretoptions-).
175
174
176
175
```javascript
177
-
waitclient.beginDeleteSecret(secretName)
176
+
awaitclient.beginDeleteSecret(secretName)
178
177
```
179
178
180
179
You can verify that the secret is gone with the [az keyvault secret show](/cli/azure/keyvault/secret?view=azure-cli-latest#az-keyvault-secret-show) command:
0 commit comments