mirror of
https://github.com/prometheus/prometheus
synced 2026-04-20 22:41:05 +08:00
When using ManagedIdentity authentication with system-assigned identity, the client_id field is intentionally left empty. However, the current code unconditionally sets options.ID = azidentity.ClientID(cfg.ClientID), which passes an empty string instead of nil. The Azure SDK treats an empty ClientID as a request for a user-assigned identity with an empty client ID, rather than falling back to system-assigned identity. Fix by only setting options.ID when cfg.ClientID is non-empty, matching the pattern already used in storage/remote/azuread/azuread.go. Fixes #16634 Signed-off-by: Ogulcan Aydogan <ogulcanaydogan@hotmail.com>