Skip to content

Commit 9fad05e

Browse files
Merge pull request #265349 from msmbaldwin/akv-misc
Akv misc
2 parents 4c8278e + 788e9b3 commit 9fad05e

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

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

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,11 @@ In this example, the name of your key vault is expanded to the key vault URI, in
167167

168168
### Save a secret
169169

170-
Now that the console app is authenticated, add a secret to the key vault. For this task, use the [SetSecretAsync](/dotnet/api/azure.security.keyvault.secrets.secretclient.setsecretasync) method. The method's first parameter accepts a name for the secret—"mySecret" in this sample.
170+
Now that the console app is authenticated, add a secret to the key vault. For this task, use the [SetSecretAsync](/dotnet/api/azure.security.keyvault.secrets.secretclient.setsecretasync) method.
171+
172+
The method's first parameter accepts a name for the secret. In this sample, the variable `secretName` stores the string "mySecret".
173+
174+
The method's second parameter accepts a value for the secret. In this sample, the secret is input by the user via the commandline and stored in the variable `secretValue`.
171175

172176
```csharp
173177
await client.SetSecretAsync(secretName, secretValue);
@@ -176,7 +180,6 @@ await client.SetSecretAsync(secretName, secretValue);
176180
> [!NOTE]
177181
> If secret name exists, the code will create new version of that secret.
178182
179-
180183
### Retrieve a secret
181184

182185
You can now retrieve the previously set value with the [GetSecretAsync](/dotnet/api/azure.security.keyvault.secrets.secretclient.getsecretasync) method.
@@ -189,14 +192,14 @@ Your secret is now saved as `secret.Value`.
189192

190193
### Delete a secret
191194

192-
Finally, let's delete the secret from your key vault with the [StartDeleteSecretAsync](/dotnet/api/azure.security.keyvault.secrets.secretclient.startdeletesecretasync) and [PurgeDeletedSecretAsync](/dotnet/api/azure.security.keyvault.keys.keyclient) methods.
195+
Finally, let's delete the secret from your key vault with the [StartDeleteSecretAsync](/dotnet/api/azure.security.keyvault.secrets.secretclient.startdeletesecretasync) and [PurgeDeletedSecretAsync](/dotnet/api/azure.security.keyvault.secrets.secretclient.purgedeletedsecretasync) methods.
193196

194197
```csharp
195-
var operation = await client.StartDeleteSecretAsync("mySecret");
198+
var operation = await client.StartDeleteSecretAsync(secretName);
196199
// You only need to wait for completion if you want to purge or recover the key.
197200
await operation.WaitForCompletionAsync();
198201

199-
await client.PurgeDeletedSecretAsync("mySecret");
202+
await client.PurgeDeletedSecretAsync(secretName);
200203
```
201204

202205
## Sample code

0 commit comments

Comments
 (0)