From e4cea1a3f7736a90a2fd224bbe2e3c77afe2c601 Mon Sep 17 00:00:00 2001 From: Isaac Sarek Banner <70341725+isaacbanner@users.noreply.github.com> Date: Tue, 1 Dec 2020 15:10:57 -0800 Subject: [PATCH] Send metadata header on IMDS probe request. (#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 --- .../TokenProviders/MsiAccessTokenProvider.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/sdk/mgmtcommon/AppAuthentication/Azure.Services.AppAuthentication/TokenProviders/MsiAccessTokenProvider.cs b/sdk/mgmtcommon/AppAuthentication/Azure.Services.AppAuthentication/TokenProviders/MsiAccessTokenProvider.cs index ffdc8aeeab12a..85fc6859915f3 100644 --- a/sdk/mgmtcommon/AppAuthentication/Azure.Services.AppAuthentication/TokenProviders/MsiAccessTokenProvider.cs +++ b/sdk/mgmtcommon/AppAuthentication/Azure.Services.AppAuthentication/TokenProviders/MsiAccessTokenProvider.cs @@ -144,6 +144,7 @@ public override async Task GetAuthResultAsync(string re { string probeRequestUrl = $"{ImdsEndpoint}{ImdsInstanceRoute}?api-version={ImdsInstanceApiVersion}"; HttpRequestMessage imdsProbeRequest = new HttpRequestMessage(HttpMethod.Get, probeRequestUrl); + imdsProbeRequest.Headers.Add(AzureVMImdsHeader, "true"); try {