Skip to content

Commit c01d49b

Browse files
authored
Merge pull request #88137 from MarileeTurscak-MSFT/patch-157
Added step to add the vault name and secret name
2 parents e5852e2 + 13b57d1 commit c01d49b

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

articles/key-vault/tutorial-net-windows-virtual-machine.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -177,10 +177,11 @@ using Newtonsoft.Json;
177177
using Newtonsoft.Json.Linq;
178178
```
179179

180-
Edit the class file to contain the code in the following two-step process:
180+
Edit the class file to contain the code in the following three-step process:
181181

182182
1. Fetch a token from the local MSI endpoint on the VM. Doing so also fetches a token from Azure AD.
183-
1. Pass the token to your key vault, and then fetch your secret.
183+
2. Pass the token to your key vault, and then fetch your secret.
184+
3. Add the vault name and secret name to the request.
184185

185186
```csharp
186187
class Program
@@ -201,9 +202,10 @@ Edit the class file to contain the code in the following two-step process:
201202
WebResponse response = request.GetResponse();
202203
return ParseWebResponse(response, "access_token");
203204
}
204-
205+
205206
static string FetchSecretValueFromKeyVault(string token)
206207
{
208+
//Step 3: Add the vault name and secret name to the request.
207209
WebRequest kvRequest = WebRequest.Create("https://<YourVaultName>.vault.azure.net/secrets/<YourSecretName>?api-version=2016-10-01");
208210
kvRequest.Headers.Add("Authorization", "Bearer "+ token);
209211
WebResponse kvResponse = kvRequest.GetResponse();

0 commit comments

Comments
 (0)