Skip to content

Commit

Permalink
Send metadata header on IMDS probe request. (Azure#15875)
Browse files Browse the repository at this point in the history
* Call imds instance endpoint instead of token endpoint to probe for imds, extend timeout

* Update msi token tests to distinguish between which imds endpoint is being called

* Fix comment and visibility in test

* Change per stpetrov

* re-trigger checks

* Add metadata header to probe request
  • Loading branch information
isaacbanner authored and annelo-msft committed Feb 17, 2021
1 parent d274646 commit e1d9a21
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ public override async Task<AppAuthenticationResult> GetAuthResultAsync(string re
{
string probeRequestUrl = $"{ImdsEndpoint}{ImdsInstanceRoute}?api-version={ImdsInstanceApiVersion}";
HttpRequestMessage imdsProbeRequest = new HttpRequestMessage(HttpMethod.Get, probeRequestUrl);
imdsProbeRequest.Headers.Add(AzureVMImdsHeader, "true");

try
{
Expand Down

0 comments on commit e1d9a21

Please sign in to comment.