File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -177,10 +177,11 @@ using Newtonsoft.Json;
177
177
using Newtonsoft .Json .Linq ;
178
178
```
179
179
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:
181
181
182
182
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.
184
185
185
186
``` csharp
186
187
class Program
@@ -201,9 +202,10 @@ Edit the class file to contain the code in the following two-step process:
201
202
WebResponse response = request .GetResponse ();
202
203
return ParseWebResponse (response , " access_token" );
203
204
}
204
-
205
+
205
206
static string FetchSecretValueFromKeyVault (string token )
206
207
{
208
+ // Step 3: Add the vault name and secret name to the request.
207
209
WebRequest kvRequest = WebRequest .Create (" https://<YourVaultName>.vault.azure.net/secrets/<YourSecretName>?api-version=2016-10-01" );
208
210
kvRequest .Headers .Add (" Authorization" , " Bearer " + token );
209
211
WebResponse kvResponse = kvRequest .GetResponse ();
You can’t perform that action at this time.
0 commit comments