Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Azure SD Managed Identity auth doesn't work inside Azure Container Apps #3830

Closed
MattiasAng opened this issue Feb 16, 2023 · 3 comments · Fixed by #3832
Closed

Azure SD Managed Identity auth doesn't work inside Azure Container Apps #3830

MattiasAng opened this issue Feb 16, 2023 · 3 comments · Fixed by #3832
Assignees
Labels
bug Something isn't working vmagent

Comments

@MattiasAng
Copy link
Contributor

Describe the bug

When running VictoriaMetrics inside a Azure Container App and using Azure service discovery with Managed Identity authentication method, I am unable to get a token.

To Reproduce

Create a Container App and setup a VMAgent with Azure SD configuration and ManagedIdentity as auth method.

scrape_configs:
- job_name: test
  azure_sd_configs:
    - subscription_id: REDACTED
      authentication_method: 'ManagedIdentity'
  relabel_configs:
    - source_labels: [instance]
      regex: (.+)
      replacement: ${1}:1000
      target_label: __address__

Authentication will keep failing due to an empty token received. The actual result when using an older API version is either 401 or a response that older API versions doesn't work.
``

Version

vmagent-20230209-232200-tags-v1.87.1-0-g291c4197

Logs

2023-02-16T16:58:04.476571186Z 2023-02-16T16:58:04.476Z error VictoriaMetrics/lib/promscrape/config.go:1044 skipping azure_sd_config targets for job_name "test" because of error: cannot list virtual machines: cannot execute azure api request at /subscriptions/REDACTED/providers/Microsoft.Compute/virtualMachines?api-version=2022-03-01: unexpected status code returned from "https://management.azure.com/subscriptions/REDACTED/providers/Microsoft.Compute/virtualMachines?api-version=2022-03-01": 401; expecting 200; response body: "{\"error\":{\"code\":\"AuthenticationFailedMissingToken\",\"message\":\"Authentication failed. The 'Authorization' header is missing the access token.\"}}"

Screenshots

No response

Used command-line flags

No response

Additional information

No response

@valyala
Copy link
Collaborator

valyala commented Feb 23, 2023

Re-opening the issue until the fix 6d019a3 is included in the next release of VictoriaMetrics and vmagent.

@valyala valyala reopened this Feb 23, 2023
valyala added a commit that referenced this issue Feb 24, 2023
valyala added a commit that referenced this issue Feb 24, 2023
@valyala
Copy link
Collaborator

valyala commented Feb 25, 2023

The fix has been included in the 1.87.2 release. Closing the issue as fixed then.

@valyala valyala closed this as completed Feb 25, 2023
@valyala
Copy link
Collaborator

valyala commented Feb 25, 2023

FYI, the fix has been included also into v1.88.0 and all the newer releases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working vmagent
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants