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

Resource Health Events List by Tenant Id 403 Forbidden #4471

Open
2 of 9 tasks
weixian-zhang opened this issue May 11, 2024 · 0 comments
Open
2 of 9 tasks

Resource Health Events List by Tenant Id 403 Forbidden #4471

weixian-zhang opened this issue May 11, 2024 · 0 comments
Labels
customer-reported question Further information is requested

Comments

@weixian-zhang
Copy link

weixian-zhang commented May 11, 2024

Link to sample

https://learn.microsoft.com/en-us/rest/api/resourcehealth/events/list-by-tenant-id?view=rest-resourcehealth-2022-10-01&tabs=JavaScript#listeventsbytenantid

Library name and version

@azure/arm-resourcehealth, @azure/identity

Language of the Sample

  • C#/.NET
  • Java
  • JavaScript/TypedScript
  • Python
  • Golang
  • Other - Please specify in Issue details field

Sample Issue Type

  • Sample not working
  • Sample missing
  • Do not understand sample

Issue details

Node app when accessing service health events List by Tenant Id, get 403 forbidden error
https://management.azure.com/providers/Microsoft.ResourceHealth/events

image

Has the following configured:

  • access using AzureDefaultCredential with AZURE_CLIENT_ID, AZURE_TENANT_ID and AZURE_CLIENT_SECRET exist in env vars.
  • registered App is assigned with tenant role: "Global Admin" and "Security Admin"
  • registered App is assigned with custom role at management group with all "MicrosoftResourceHealth" permissions
  • registered App has granted "Azure Service Management - user_impersonation" scope
{ "error": { "code": "AuthorizationFailed", "message": "The client '06bc32ab-5ab5-4b8d-9f6c-95d0a420eb95' with object id '06bc32ab-5ab5-4b8d-9f6c-95d0a420eb95' does not have authorization to perform action 'Microsoft.ResourceHealth/events/read' over scope '/providers/Microsoft.ResourceHealth' or the scope is invalid. If access was recently granted, please refresh your credentials." } } ![image](https://github.com/Azure/azure-rest-api-specs-examples/assets/43234101/8fcce67b-7be1-4526-a68b-79a2d4b1152f)

Expected behavior

expects a successful response with HTTP code 200

Actual behavior

API responded 403 forbidden

{
"error": {
"code": "AuthorizationFailed",
"message": "The client '06bc32ab-5ab5-4b8d-9f6c-95d0a420eb95' with object id '06bc32ab-5ab5-4b8d-9f6c-95d0a420eb95' does not have authorization to perform action 'Microsoft.ResourceHealth/events/read' over scope '/providers/Microsoft.ResourceHealth' or the scope is invalid. If access was recently granted, please refresh your credentials."
}
}

Reproduction Steps

No response

Environment

Node 20.x
Windows 11

@microsoft-github-policy-service microsoft-github-policy-service bot added question Further information is requested customer-reported labels May 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
customer-reported question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant