Skip to content

Commit e1d9a21

Browse files
isaacbannerannelo-msft
authored andcommitted
Send metadata header on IMDS probe request. (Azure#15875)
* 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
1 parent d274646 commit e1d9a21

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

sdk/mgmtcommon/AppAuthentication/Azure.Services.AppAuthentication/TokenProviders/MsiAccessTokenProvider.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ public override async Task<AppAuthenticationResult> GetAuthResultAsync(string re
144144
{
145145
string probeRequestUrl = $"{ImdsEndpoint}{ImdsInstanceRoute}?api-version={ImdsInstanceApiVersion}";
146146
HttpRequestMessage imdsProbeRequest = new HttpRequestMessage(HttpMethod.Get, probeRequestUrl);
147+
imdsProbeRequest.Headers.Add(AzureVMImdsHeader, "true");
147148

148149
try
149150
{

0 commit comments

Comments
 (0)