question

ivandemin-5254 avatar image
0 Votes"
ivandemin-5254 asked ·

TooManyRequests Issue Microsoft Teams PowerShell

Hello,

so our script is connecting MicrosoftTeams via PowerShell and ads new TeamGroup, TeamChannel and TeamUser.
Sometime it works and then in works not and we get the error TooManyRequests like in the picture.

Could it be an performance issue with the API of Microsoft Teams?
What could we do to prevent this error to happening?

Best regards,

Ivan![4911-skript.png][2]
4912-skript.png


[2]: /answers/storage/attachments/4921-error.png

office-teams-windows-itpro
error.png (120.5 KiB)
skript.png (174.3 KiB)
10 |1000 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.

JimmyYang-MSFT avatar image
0 Votes"
JimmyYang-MSFT answered ·

Hi Ivan!
According to your description, it seems this script have no issue.
Based on my knowledge, to protect Microsoft Teams and its users, the bot APIs rate-limit incoming requests. Apps that go over this limit will receive Too many request error status.
We recommend your application implement the appropriate backoff behavior when the API returns Too many request. For more details, you can refer to:
https://docs.microsoft.com/en-us/microsoftteams/platform/bots/how-to/rate-limit

· Share
10 |1000 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.

KaiWollmerstedtTGIS-3101 avatar image
0 Votes"
KaiWollmerstedtTGIS-3101 answered ·

Hello Ivan,

were you able to find a solution to the problem? I have the same error message when I start a get-team query.
I would also like to know where I can see when I can send a command again.

 get-team : Error occurred while executing 
 Code: TooManyRequests
 Message: Too many requests from Identifier:12128f48-ec9e-42f0-b203-ea49fb6af367+12128f48-ec9e-42f0-b203-ea49fb6af367 under category:throttle.teams.ags.api_complex_level_10.app_normal.operation_read_sustained. Please try again later.
 InnerError:
   RequestId: a808fe0d-ff34-42e4-b902-5ebd5c24cd8a
   DateTimeStamp: 2020-12-04T09:41:11
 HttpStatusCode: TooManyRequests
 At line:1 char:1
 + get-team -User xxx@xxx.com
 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     + CategoryInfo          : NotSpecified: (:) [Get-Team], ApiException
     + FullyQualifiedErrorId : Microsoft.TeamsCmdlets.PowerShell.Custom.ErrorHandling.ApiException,Microsoft.TeamsCmdlets.PowerShell.Custom.GetTeam

Best regards
Kai

· Share
10 |1000 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.

AlexanderZoutenbier-0164 avatar image
0 Votes"
AlexanderZoutenbier-0164 answered ·

I have the same issues since yesterday.
Running with Azure Automation new-team command. No change in the code and i'm not able to create a team anymore.

New-Team : Error occurred while executing Code: TooManyRequests Message: Too many requests from Identifier:12128f48-ec9e-42f0-b203-ea49fb6af367+12128f48-ec9e-42f0-b203-ea49fb6af367 under category:throttle.teams.ags.api_complex_level_10.app_normal.operation_read_sustained. Please try again later. InnerError: RequestId: d71ba7b3-9eb8-424e-aa02-ac24c77b5de3 DateTimeStamp: 2020-12-04T11:08:47 HttpStatusCode: TooManyRequests At line:14 char:12 + $newteam = New-Team -Displayname $teamtitel -Description $teamdescrip ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [New-Team], ApiException + FullyQualifiedErrorId : Microsoft.TeamsCmdlets.PowerShell.Custom.ErrorHandling.ApiException,Microsoft.TeamsCmdlets.PowerShell.Custom.NewTeam

· Share
10 |1000 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.

KaiWollmerstedtTGIS-3101 avatar image
0 Votes"
KaiWollmerstedtTGIS-3101 answered ·

This is nice to hear ;-).
Are you able to use other cmdlets, like get-teams?

Best regards
Kai

· 3 · Share
10 |1000 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.

No all the cmdlets are not working anymore. I opend a case already

1 Vote 1 ·
ZhuoweiXu-8291 avatar image ZhuoweiXu-8291 AlexanderZoutenbier-0164 ·

I have the same issue. Thanks to open the case.

0 Votes 0 ·
FLX-5826 avatar image FLX-5826 AlexanderZoutenbier-0164 ·

Same issue here

0 Votes 0 ·
ceosite avatar image
0 Votes"
ceosite answered ·

Same issue with New-Team command.
Start-Sleep -Seconds 2 does it have any effect ?

· Share
10 |1000 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.

AlexanderZoutenbier-0164 avatar image
3 Votes"
AlexanderZoutenbier-0164 answered ·

I received a call van support and since yesterday there are issues. They are working on it.

· Share
10 |1000 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.

KaiWollmerstedtTGIS-3101 avatar image
0 Votes"
KaiWollmerstedtTGIS-3101 answered ·
· Share
10 |1000 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.

AlexanderZoutenbier-0164 avatar image
1 Vote"
AlexanderZoutenbier-0164 answered ·

At my end it's resolved.

· Share
10 |1000 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.

FLX-5826 avatar image
0 Votes"
FLX-5826 answered ·

My is resolved too.

· Share
10 |1000 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.

KaiWollmerstedtTGIS-3101 avatar image
0 Votes"
KaiWollmerstedtTGIS-3101 answered ·

Here is everything ok now

· Share
10 |1000 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.