prometheus/discovery/azure
Ogulcan Aydogan 7bbff490a3 discovery/azure: fix system managed identity when client_id is empty
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>
2026-03-19 10:49:17 +00:00
..
azure.go discovery/azure: fix system managed identity when client_id is empty 2026-03-19 10:49:17 +00:00
azure_test.go discovery/azure: fix system managed identity when client_id is empty 2026-03-19 10:49:17 +00:00
metrics.go Remove copyright date from headers (#17785) 2026-01-05 13:46:21 +01:00