You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
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
Sample Issue Type
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
Has the following configured:
{ "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
The text was updated successfully, but these errors were encountered: