Skip to content

[extension/azureauth] Support for custom scopes #41003

Open
@gravufo

Description

@gravufo

Component(s)

extension/azureauth

Is your feature request related to a problem? Please describe.

I am trying to use the azureauth extension to push metrics to Azure Monitor Workspace using the prometheusremotewrite exporter.
Microsoft requires the authentication tokens to have the required audience to accept metrics.
Audiences are:

However, the target host is not monitor.azure.com. Each Azure Monitor Workspace has its own host.
Unfortunately, the extension does not allow setting a custom scope in its configuration and defaults to the target host as can be seen here.

Describe the solution you'd like

Expose a custom scope in the extension's config so it can be used like this:

azureauth:
  scopes:
    - https://monitor.azure.com/.default
  workload_identity:
    [...]

Note: I suggest exposing a []string{} so that it can be sent as-is to the underlying credential provider (azidentity) since that's what it wants. That way, we are not blocking any further use-cases. That said, I am open to only exposing a string, but I don't see any benefit in artificially limiting options.

Note2: The behavior if scopes is not set in the config should be the same as it is today; i.e. fallback to requesting a scope of .default on the target host of the request.

Describe alternatives you've considered

The only alternative is to keep using aad-auth-proxy, but I'm trying to get rid of it.

Additional context

No response

Tip

React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it. Learn more here.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions