Skip to content

Commit 161a8fe

Browse files
authored
Merge pull request #26088 from microsoftgraph/freshness-throttling
[Content freshness] Microsoft Graph throttling
2 parents ed9bca4 + d3b2b86 commit 161a8fe

File tree

60 files changed

+601
-434
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+601
-434
lines changed

concepts/throttling-limits.md

Lines changed: 56 additions & 380 deletions
Large diffs are not rendered by default.

concepts/throttling.md

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,22 @@
11
---
22
title: "Microsoft Graph throttling guidance"
3-
description: "Find best practices for maintaining optimal performance of the Microsoft Graph service if an overwhelming number of requests occurs."
3+
description: "Learn the best practices to avoid throttling and maintaining optimal performance should your app be throttled."
44
ms.localizationpriority: high
55
author: FaithOmbongi
66
ms.author: ombongifaith
7-
ms.reviewer: Luca.Spolidoro
7+
ms.reviewer: mariampo, Avinash.Chenoor
88
ms.subservice: non-product-specific
9-
ms.date: 01/22/2024
9+
ms.topic: overview
10+
ms.date: 01/14/2025
1011
ms.custom: graphiamtop20
1112
#Customer intent: As a developer integrating with Microsoft Graph, I want to understand how to avoid throttling and how to handle throttling when it occurs.
1213
---
1314

1415
# Microsoft Graph throttling guidance
1516

16-
Throttling limits the number of concurrent calls to a service to prevent overuse of resources. Microsoft Graph is designed to handle a high volume of requests. If an overwhelming number of requests occurs, throttling helps maintain optimal performance and reliability of the Microsoft Graph service.
17+
Throttling limits the number of concurrent calls to a service to prevent overuse of resources. The Microsoft Graph service implements throttling limits to ensure service availability and reliability.
1718

18-
Throttling limits vary based on the scenario. For example, if you are performing a large volume of writes, the possibility for throttling is higher than if you are only performing reads.
19+
Throttling limits vary based on the scenario. For example, if you're performing a large volume of writes, the possibility for throttling is higher than if you're only performing reads.
1920

2021
> [!NOTE]
2122
> Solutions that need to extract a large volume of data from Microsoft Graph should use [Microsoft Graph Data Connect](data-connect-concept-overview.md) instead of the Microsoft Graph REST APIs. Microsoft Graph Data Connect allows organizations to extract Microsoft 365 data in bulk without being subject to throttling limits.
@@ -31,7 +32,12 @@ Throttling limits vary based on the scenario. For example, if you are performing
3132
## What happens when throttling occurs?
3233
<!-- markdownlint-enable MD026 -->
3334

34-
When a throttling threshold is exceeded, Microsoft Graph limits any further requests from that client for a period of time. When throttling occurs, Microsoft Graph returns HTTP status code 429 (Too many requests), and the requests fail. A suggested wait time is returned in the response header of the failed request. Throttling behavior can depend on the type and number of requests. For example, if you have a high volume of requests, all requests types are throttled. Threshold limits vary based on the request type. Therefore, you could encounter a scenario where writes are throttled but reads are still permitted.
35+
When a throttling threshold is exceeded, Microsoft Graph:
36+
- Limits any further requests from that client app for some time.
37+
- Returns HTTP status code **429 Too Many Requests** and the requests fail.
38+
- Returns a suggested wait time in the response header of the failed request.
39+
40+
Throttling behavior can depend on the type and number of requests. For example, if you have a high volume of requests, all requests types are throttled. Threshold limits vary based on the request type. Therefore, you could encounter a scenario where writes are throttled but reads are still permitted.
3541

3642
## Common throttling scenarios
3743

@@ -77,20 +83,20 @@ When you implement error handling, use the HTTP error code 429 to detect throttl
7783

7884
1. Wait the number of seconds specified in the `Retry-After` header.
7985
2. Retry the request.
80-
3. If the request fails again with a 429 error code, you are still being throttled. Continue to use the recommended `Retry-After` delay and retry the request until it succeeds.
86+
3. If the request fails again with a 429 error code, you're still being throttled. Continue to use the recommended `Retry-After` delay and retry the request until it succeeds.
8187

82-
All the resources and APIs described in the [Service-specific limits](throttling-limits.md) provide a `Retry-After` header except when noted.
88+
All the resources and APIs described in the [Service-specific limits](throttling-limits.md) provide a `Retry-After` header except where indicated.
8389

8490
For a broader discussion of throttling in the Microsoft Cloud, see [Throttling pattern](/azure/architecture/patterns/throttling).
8591

8692
> [!NOTE]
87-
> If no `Retry-After` header is provided by the response, we recommend implementing an exponential backoff retry policy. You can also implement [more advanced patterns](/azure/architecture/patterns/category/resiliency) when building large-scale applications.
93+
> If no `Retry-After` header is provided by the response, we recommend implementing an exponential backoff retry policy. You can also implement [more advanced patterns](/azure/well-architected/reliability/design-patterns) when building large-scale applications.
8894
>
8995
> Microsoft Graph SDKs already implement handlers that rely on the `Retry-After` header or default to an exponential backoff retry policy.
9096
9197
## Best practices to avoid throttling
9298

93-
Programming patterns like continuously polling a resource to check for updates and regularly scanning resource collections to check for new or deleted resources are more likely to lead to applications being throttled and degrade overall performances. You should instead leverage [change tracking](delta-query-overview.md) and [change notifications](change-notifications-overview.md) when available.
99+
Programming patterns like continuously polling a resource to check for updates and regularly scanning resource collections to check for new or deleted resources are more likely to lead to applications being throttled and degrade overall performances. You should instead use [change tracking](delta-query-overview.md) and [change notifications](change-notifications-overview.md) when available.
94100

95101
>[!NOTE]
96102
>[Best practices for discovering files and detecting changes at scale](/onedrive/developer/rest-api/concepts/scan-guidance) describes best practices in details.
@@ -99,7 +105,7 @@ Programming patterns like continuously polling a resource to check for updates a
99105

100106
[JSON batching](./json-batching.md) allows you to optimize your application by combining multiple requests into a single JSON object. Requests in a batch are evaluated individually against throttling limits and if any request exceeds the limits, it fails with a status code of `429` and an error similar to the [preceding sample response](#sample-response). The batch itself succeeds with a status code of `200` (OK). Multiple requests can be throttled in a single batch. You should retry each failed request from the batch using the value provided in the `retry-after` response header from the JSON content. You may retry all the failed requests in a new batch after the longest `retry-after` value.
101107

102-
If SDKs retry throttled requests automatically when they are not batched, throttled requests that were part of a batch are not retried automatically.
108+
If SDKs retry throttled requests automatically when they aren't batched, throttled requests that were part of a batch aren't retried automatically.
103109

104110
## Next step
105111

includes/throttling-assignment.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
author: "cristobal-buenrostro"
3+
ms.localizationpriority: high
4+
ms.subservice: education
5+
ms.topic: include
6+
---
7+
<!-- markdownlint-disable MD041 -->
8+
9+
| Request type | Limit per app per tenant | Limit per tenant for all apps |
10+
|---------------------------|------------------------------|----------------------------|
11+
| Any | 500 requests per 10 seconds | 1,000 requests per 10 seconds
12+
|Any | 15,000 requests per 3,600 seconds|30,000 requests per 3,600 seconds|
13+
| GET me/Assignment | 50 requests per 10 seconds | 150 requests per 10 seconds |
14+
15+
16+
The preceding limits apply to the following resources:
17+
18+
- [educationAssignment](/graph/api/resources/educationassignment)
19+
- [educationSubmission](/graph/api/resources/educationsubmission)
20+
- [trending](/graph/api/resources/insights-trending)
21+
- [educationResource](/graph/api/resources/educationresource)

includes/throttling-bookings.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
author: "arvindmicrosoft"
3+
ms.localizationpriority: high
4+
ms.subservice: microsoft-bookings
5+
ms.topic: include
6+
---
7+
<!-- markdownlint-disable MD041 -->
8+
9+
The Bookings service applies limits to each app ID and mailbox combination, specifically when a particular app accesses a particular booking mailbox. Exceeding the limit for one mailbox doesn't affect the ability of the application to access another mailbox.
10+
11+
| Limit | Applies to |
12+
| -------------- | ------------ |
13+
| Four concurrent requests | v1.0 and beta endpoints |
14+
15+
The preceding limits apply to the following resources:
16+
- [business](/graph/api/resources/bookingbusiness)
17+
- [appointment](/graph/api/resources/bookingappointment)
18+
- [customQuestion](/graph/api/resources/bookingcustomquestion)
19+
- [customer](/graph/api/resources/bookingcustomer)
20+
- [service](/graph/api/resources/bookingservice)
21+
- [staffMember](/graph/api/resources/bookingstaffmember)

includes/throttling-call-records.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
author: "mcm223"
3+
ms.localizationpriority: high
4+
ms.subservice: cloud-communications
5+
ms.topic: include
6+
---
7+
<!-- markdownlint-disable MD041 -->
8+
9+
The limits listed in the following table apply to the following resources:
10+
11+
- [callRecord](/graph/api/resources/callrecords-callrecord)
12+
- [participant](/graph/api/resources/callrecords-participant)
13+
- [session](/graph/api/resources/callrecords-session)
14+
15+
| Limit type | Limit |
16+
| -------------- | ------------ |
17+
| Per application for all tenants | 15,000 requests per 20 seconds |
18+
| Per tenant for all applications | 10,000 requests per 20 seconds |
19+
| Per application per tenant | 1,500 requests per 20 seconds |
20+
| Per call record | 10 requests per 20 seconds (first page) <br/> 50 requests per 5 minutes (subsequent pages) |
21+
| List call records | 15 requests per 20 seconds (first page) <br/> 55 requests per 5 minutes (subsequent pages) |
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
author: "ananmishr"
3+
ms.localizationpriority: high
4+
ms.subservice: cloud-communications
5+
ms.topic: include
6+
---
7+
<!-- markdownlint-disable MD041 -->
8+
9+
| Resource | Limits per app |
10+
| -------------- | ------------ |
11+
| [Calls](/graph/api/resources/call) | 50,000 requests in a 15-second period, per application per tenant |
12+
| [Meeting information](/graph/api/resources/meetinginfo) | 2,000 meetings/user each month |
13+
| [Presence](/graph/api/resources/presence) | 1,500 requests in a 30-second period, per application per tenant |
14+
| [Virtual event](/graph/api/resources/virtualevent) | 10,000 requests/app each month |

includes/throttling-cpim.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ ms.subservice: entra-sign-in
55
ms.topic: include
66
---
77
<!-- markdownlint-disable MD041 -->
8-
<!-- this file is auto-generated don't edit it manually! -->
98

109
| Request type | Limit per tenant for all apps | Limit per app per tenant |
1110
| ------------ | ----------------------------- | ------------------------ |
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
author: "dkershaw10"
3+
ms.localizationpriority: high
4+
ms.subservice: entra-sign-in
5+
ms.topic: include
6+
---
7+
<!-- markdownlint-disable MD041 -->
8+
9+
| Request type | Limit per tenant |
10+
| ------------ | ---------------- |
11+
| POST on `exportPersonalData` | 1,000 requests per day for any subject and 100 per subject per day |
12+
| Any other request | 10,000 requests per hour |
13+
14+
The preceding limits apply to the following resources:
15+
16+
- [dataPolicyOperation](/graph/api/resources/datapolicyoperation)
17+
18+
> [!NOTE]
19+
> The resources listed earlier don't return a `Retry-After` header on `429 Too Many Requests` responses.

includes/throttling-education-rostering-apis.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ ms.subservice: education
55
ms.topic: include
66
---
77
<!-- markdownlint-disable MD041 -->
8-
<!-- this file is auto-generated don't edit it manually! -->
98

109
| Request type | Limit per app for all tenants | Limit per app per tenant |
1110
| ------------ | ----------------------------- | ------------------------ |

includes/throttling-aad-reports.md renamed to includes/throttling-entra-logs-reports.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,12 @@ ms.subservice: entra-monitoring-health
55
ms.topic: include
66
---
77
<!-- markdownlint-disable MD041 -->
8-
<!-- this file is auto-generated don't edit it manually! -->
8+
9+
| Request type | Limit per app per tenant |
10+
| ------------ | ------------------------ |
11+
| Any | Five requests per 10 seconds |
12+
13+
The preceding limits apply to the following resources:
914

1015
| <!-- fake header--> | <!-- fake header--> |
1116
|--|--|
@@ -16,3 +21,8 @@ Verify the following: azureadfeatureusage, azureadlicenseusage, azureaduserfeat
1621
1722
Changed authenticationMethodsRoot to authenticationMethod
1823
-->
24+
25+
### Identity and access reports best practices
26+
Microsoft Entra reporting APIs are throttled when Microsoft Entra ID receives too many calls during a given timeframe from a tenant or app. Calls might also be throttled if the service takes too long to respond. If your requests still fail with a `429 Too Many Requests` error code despite applying the [best practices to handle throttling](/graph/throttling#best-practices-to-handle-throttling), try reducing the amount of data returned. Try these approaches first:
27+
- Use filters to target your query to just the data you need. If you only need a certain type of event or a subset of users, for example, filter out other events using the `$filter` and `$select` query parameters to reduce the size of your response object and the risk of throttling.
28+
- If you need a broad set of Microsoft Entra ID reporting data, use `$filter` on the **createdDateTime** to limit the number of sign-in events you query in a single call. Then, iterate through the next timespan until you have all the records you need. For example, if you're being throttled, you can begin with a call that requests three days of data and iterate with shorter timespans until your requests are no longer throttled.

0 commit comments

Comments
 (0)