-
-
Notifications
You must be signed in to change notification settings - Fork 94
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
Unauthorized error when authenticated with UserAssignedManagedIdentity on Us Gov Cloud #1646
Comments
Hi @tomkerkhove , I went down to this line promitor/src/Promitor.Integrations.Azure/Authentication/AzureAuthenticationFactory.cs Line 72 in c32348a
|
Yeah, it looks like it needs to be this constructor instead, which provides TokenCredentialOptions:
Current code will be getting the default TokenCredentialOptions, which will indeed be AuthorityHost = https://login.microsoftonline.com/, which is Azure Commercial and won't work for gov.
|
Hi @tomkerkhove , I have opened the PR for this, I was able to successfully scrape from my AzureUSGov subscription: I'm double-checking and updating on the PR/developers.md if I missed anything in the PR process now. |
Thanks for the quick response! Actually I'm looking at the scraper now, so after we discovered the resources:
I think it's similar so 👀 on that. |
Thanks. It could be that or permissions, but I'd expect an unauthorized there then. It might be this: https://github.com/tomkerkhove/promitor/pull/1648/files#diff-630f87ab9d90eb937b2970b338be8e942706f90d9c248a618b158a23618d84f1R113 |
Azure Monitor uses https://github.com/tomkerkhove/promitor/pull/1648/files#diff-630f87ab9d90eb937b2970b338be8e942706f90d9c248a618b158a23618d84f1R116 but thath one looks OK though. |
Relates to #1646 Signed-off-by: GitHub <[email protected]>
) Relates to #1646 Signed-off-by: GitHub <[email protected]>
Report
After helm install from the official chart and from after this PR: promitor/charts#36
I encounter the
Operation returned an invalid status code 'Unauthorized'
error while trying to query resources from AzureGraphResource after Authenticated.Note: I have checked the identity binding (with Reader and Contributor roles of the subscription) with azure-cli image and I could
az login --identity
and fetch the any resources in the subscription.Expected Behavior
After authenticated with the UserAssignedManagedIdentity, the client could query for the resources defined. In this case, I use the sample:
Actual Behavior
Got the below error log and the service discovery returned 500 HTTP code.
Steps to Reproduce the Problem
includeDendencies=true
Component
Resource Discovery
Version
0.4.0
Configuration
Configuration for Helm chart:
resource-discovery-declaration.yaml configmap:
runtime.yaml
Logs
Platform
Microsoft Azure
Contact Details
[email protected]
The text was updated successfully, but these errors were encountered: