microsoft / Intune-PowerShell-SDK

Native PowerShell support for invoking Microsoft Intune Graph API to enable IT Pro scenario automation.
MIT License
314 stars 77 forks source link

Get-MSGraphNextPage : 504 Gateway Timeout #56

Open LeoniSantos opened 5 years ago

LeoniSantos commented 5 years ago

Hello Guys,

Is anyone else facing too much timeout errors in MS Graph API?

below follow code I am using, do you know if there is any way to avoid it? or is this an endpoint issue?

$URL = "deviceManagement/importedDeviceIdentities" $ImportedIdentifier = Invoke-MSGraphRequest -HttpMethod GET -Url $URL -Verbose | Get-MSGraphAllPages

rohitramu commented 5 years ago

A 504 timeout would indicate an issue with the endpoint itself. Is this still happening for you?

LeoniSantos commented 5 years ago

Hello Rohit, yes this happens several times, more often when I work with large data, I managed a workaround using try/catch inside a do/until loop, but this is not good for performance.

same calls sometimes work other fails

bhicks-appen commented 5 years ago

I have just started getting lots of 504 Gateway Timeout's when utilizing Get-IntuneTroubleshootingEvent:

Get-IntuneTroubleshootingEvent : 504 Gateway Timeout { "error": { "code": "UnknownError", "message": "", "innerError": { "request-id": "4939eb55-284a-4ba6-9f6d-182b3245654b", "date": "2019-08-16T22:49:51" } } }

Skatterbrainz commented 4 years ago

I'm running into this today myself. We have approx 1850 devices. I can query the basic data just fine, but if I try to include the applications inventory it dies after querying 50-75% of the total. Any updates or progress on this issue?

DennisBergemann commented 6 months ago

Hi @Skatterbrainz, i am working great with 40.000 devices in intune.

in this case your timeouts are not related to this sdk, but to the graph api themself, its too high utilized...

2 Guesses:

  1. you can better fetch the apps as report as an example: detected apps report
  2. you can send your request as batch, this is sometimes better

I am using graph calls directly without this sdk, but this sdk should work as well Keep in mind, you can see the graph calls you need every time in intune console (F-12) Network or with addon

Best regards