Fix IMDS token requests for managed identities (#6698)

This was broken by a035ee5f94, which
accidentally constructed the IMDS URL with a double slash at the start
of the path. This is not properly routed on the server side, leading to
a 404 error with some very misleading XML.

Signed-off-by: James Le Cuirot <jlecuirot@microsoft.com>
This commit is contained in:
James Le Cuirot 2025-08-14 08:22:53 +01:00 committed by GitHub
parent cb8bef26c7
commit b33fb227ce
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 1 deletions

View File

@ -8,6 +8,8 @@
### Bugs Fixed
- Fixed IMDS token requests for managed identities, which were broken by an invalid URL path in 1.12.0-beta.1.
### Other Changes
## 1.13.0 (2025-08-05)

View File

@ -527,7 +527,7 @@ std::unique_ptr<ManagedIdentitySource> ImdsManagedIdentitySource::Create(
imdsUrl = Core::Url{imdsEndpointEnvVarValue};
}
imdsUrl.SetPath("/metadata/identity/oauth2/token");
imdsUrl.SetPath("metadata/identity/oauth2/token");
return std::unique_ptr<ManagedIdentitySource>(
new ImdsManagedIdentitySource(clientId, objectId, resourceId, imdsUrl, options));