PnP-PowerShell icon indicating copy to clipboard operation
PnP-PowerShell copied to clipboard

Implement support for throttling and automatic retry of any SP http call

Open mrvdsah opened this issue 5 years ago • 4 comments

Hi,

Microsoft recently has enforced throttling on several api calls. When running several PnP commands, we are getting 503 service unavailable messages or TooManyRequest errors.

For instance on following command: Set-SPOSite $SiteUrl -SharingCapability ExternalUserSharingOnly

For every api call, throttling support should be implemented.

https://docs.microsoft.com/en-us/sharepoint/dev/general-development/how-to-avoid-getting-throttled-or-blocked-in-sharepoint-online

See ExecuteQueryWithIncrementalRetry extension for implementation.

Which version of the PnP-PowerShell Cmdlets are you using?

  • [ ] PnP PowerShell for SharePoint 2013
  • [ ] PnP PowerShell for SharePoint 2016
  • [ X] PnP PowerShell for SharePoint Online

What is the version of the Cmdlet module you are running?

(you can retrieve this by executing Get-Module -Name *pnppowershell* -ListAvailable) 3.19.2003.0

How did you install the PnP-PowerShell Cmdlets?

  • [ ] MSI Installed downloaded from GitHub
  • [ X] Installed through the PowerShell Gallery with Install-Module
  • [ ] Other means

mrvdsah avatar Mar 16 '20 17:03 mrvdsah

Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.

ghost avatar Mar 16 '20 17:03 ghost

I also experiance a lot of throttling errors with only very simple PowerShell script (iterating over 150 SharePoint sitecollections). Untill now i cannot find a solution for it. I hope Microsoft could give us an solution for this problem. Many people are dealing with it.

markgort86 avatar Mar 18 '20 10:03 markgort86

is this still an issue?

bigpix2000 avatar Dec 01 '20 15:12 bigpix2000

This is still an issue. We are getting throttling errors when iterating over a number of sites. Is there any way to read the response headers so we can get the "retry-after" header?

kurtgetonwithit avatar Dec 03 '20 06:12 kurtgetonwithit