question

LauraGute-0035 avatar image
0 Votes"
LauraGute-0035 asked Invarosoftcolombo-7151 answered

UnknownTenantID when requesting reports from Graph

I have been pulling a few of the MS 365 Graph reports and my users and groups list, with a registered app. Using my developer account, this was working, as recently as last Thursday, 12/24/2020.

This week, I can still pull users and groups lists, but not the reports. I get the following error, when requesting reports...

HTTP error 404
UnknownError - code: "UnknownTenantId", message: "We do not recognize this tenant ID b45d6a6c-1289-4897-8987-b155bbbd594a. Please double-check the tenant ID and try again."

The app has granted API permissions to

API / Permissions name Type Description
Microsoft Graph (3)
Group.Read.All Application Read all groups
Reports.Read.All Application Read all usage reports
User.Read.All Application Read all users' full profiles

Did permissions change or something else change?

I created a second developer account, just in case it was my account. I get the same error from my new account, when requesting reports.

Thanks!

microsoft-graph-reports
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hello, please provide the error response request id and timestamp. Also the request URL, headers and body.

0 Votes 0 ·
LauraGute-0035 avatar image
0 Votes"
LauraGute-0035 answered LauraGute-0035 commented

@alfredorevilla-msft

Here's a fresh response...

  HTTP/1.1 404 Not Found
  Cache-Control: private
  Content-Type: application/json
  request-id: 4d0157be-ae5a-4aaf-9fc1-0af27cc8ae07
  client-request-id: 4d0157be-ae5a-4aaf-9fc1-0af27cc8ae07
  x-ms-ags-diagnostic: {"ServerInfo":{"DataCenter":"North Central US","Slice":"SliceC","Ring":"2","ScaleUnit":"000","RoleInstance":"AGSFE_IN_9"}}
  Strict-Transport-Security: max-age=31536000
  Date: Thu, 31 Dec 2020 18:48:18 GMT
  Content-Length: 446
        
  {
    "error": {
      "code": "UnknownError",
      "message": "{\\"error\\":{\\"code\\":\\"UnknownTenantId\\",\\"message\\":\\"We do not recognize this tenant ID b45d6a6c-1289-4897-8987-b155bbbd594a. Please double-check the tenant ID and try again.\\"}}",
      "innerError": {
        "date": "2020-12-31T18:48:18",
        "request-id": "4d0157be-ae5a-4aaf-9fc1-0af27cc8ae07",
        "client-request-id": "4d0157be-ae5a-4aaf-9fc1-0af27cc8ae07"
      }
    }
  }

Thanks!

· 4
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

I found the request was done using an application access token thus the account should not be an issue. About your second attempt, did you used delegated (user) permissions? Can you provide request id and date for that too?

0 Votes 0 ·

Also, does your office plan includes desktop apps?

0 Votes 0 ·

I'm using a Microsoft 365 Developer program account, right now, so I believe I have access to everything.

0 Votes 0 ·

Both requests were working as of last Thursday, with this developer account.

0 Votes 0 ·
LauraGute-0035 avatar image
0 Votes"
LauraGute-0035 answered LauraGute-0035 edited

@alfredorevilla-msft

All my requests use the same Application/Client ID, Directory/Tenant ID and Client Secret. The only difference is the first one requests a report...
https://graph.microsoft.com/v1.0/reports/getOffice365ActivationCounts

...and the second requests a non-report...
https://graph.microsoft.com/v1.0/groups?$select=id,displayName&$orderby=displayName (full response, below)

 HTTP/1.1 200 OK
 Cache-Control: private
 Content-Type: application/json;odata.metadata=minimal;odata.streaming=true;IEEE754Compatible=false;charset=utf-8
 request-id: b25907bf-4f55-4a27-ba19-5fa7563c5c4e
 client-request-id: b25907bf-4f55-4a27-ba19-5fa7563c5c4e
 x-ms-ags-diagnostic: {"ServerInfo":{"DataCenter":"North Central US","Slice":"SliceC","Ring":"2","ScaleUnit":"000","RoleInstance":"AGSFE_IN_20"}}
 x-ms-resource-unit: 1
 OData-Version: 4.0
 Strict-Transport-Security: max-age=31536000
 Date: Thu, 31 Dec 2020 21:28:18 GMT
 Content-Length: 399
    
 {"@odata.context":"https://graph.microsoft.com/v1.0/$metadata#groups(id,displayName)","value":[{"id":"a6cf455d-f9fd-4456-b7ff-3ffdef9f7c85","displayName":"All Company"},{"id":"0c1eb50f-8dde-43b5-a893-cf6bbcc395de","displayName":"Contoso Team"},{"id":"19b9285d-c9ef-4df7-a09c-85d2b6c32cd9","displayName":"nagiosdev"},{"id":"98e20d77-7091-4dfd-b281-fe0dabf1a212","displayName":"Team Site with Data"}]}

Thanks!

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Invarosoftcolombo-7151 avatar image
0 Votes"
Invarosoftcolombo-7151 answered

I too having this problem, can get users and groups and licenses, but can't get for mail related reports(i.e mailusagedetail) is always return above error as same as "We do not recognize this tenant ID 9d99877c-03b5-4f6a-90d8-0609c9eb5d06. Please double-check the tenant ID and try again" is because of test account?

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.