Share via

Got errors when listing tenants: Request not applicable to target tenant.

Hawk View 0 Reputation points
2023-04-18T03:14:59.69+00:00

Hi, Question I met: I'm trying to get our tenants from Microsoft Graph Rest API using this request:

GET https://graph.microsoft.com/beta/tenantRelationships/managedTenants/tenants

But I got this error:

{
    "error": {
        "code": "BadRequest",
        "message": "Request not applicable to target tenant.",
        "innerError": {
            "date": "2023-04-18T02:52:32",
            "request-id": "3a2133e1-xxxxxxxxxxxxxx-f1fbd71f05be",
            "client-request-id": "3a2133e1-xxxxxxxxxxxxxx-f1fbd71f05be"
        }
    }
}

Work I've done: I checked the permissions and it looks fine. User's image

According to this thread: https://learn.microsoft.com/en-us/answers/questions/1063413/(error)-graph-api-request-not-applicable-to-target We activated Intune for our account, User's image

and I checked the access code and access token on this request: https://graph.microsoft.com/v1.0/me and it works fine. So I tried this list all tenants request on Graph Explorer again: https://developer.microsoft.com/en-us/graph/graph-explorer and in Modify Permissions tab, the status is unconsent User's image

and it says User's image

Then I add the permission for Directory.Read.All and DelegatedPermissionGrant.ReadWrite.All User's image

User's image

but it still didn't work. Can anybody help me with this issue please? Thanks

Microsoft Security | Microsoft Entra | Microsoft Entra ID
Microsoft Security | Microsoft Graph
0 comments No comments

1 answer

Sort by: Most helpful
  1. risolis 8,806 Reputation points
    2023-04-20T05:55:10.5066667+00:00

    Hello @Hawk View Thank you for your heads up. Thank you for posting this concern on this community. I just wanted to double check if this is related to your case scenario as those links state below:

    1. https://learn.microsoft.com/en-us/graph/api/intune-rbac-roleassignment-list?view=graph-rest-beta#feedback
    2. https://github.com/microsoftgraph/microsoft-graph-docs/issues/5613
    3. https://github.com/microsoftgraph/microsoft-graph-docs/blob/master/api-reference/beta/api/intune-rbac-roleassignment-list.md Looking forward to hearing from you Cheers, Please "Accept the answer" if the information helped you. This will help us and others in the community as well.

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.