Skip to content

RateLimit headers are not returned by SharePoint online #10069

Closed

Description

Target SharePoint environment

SharePoint Online

What SharePoint development model, framework, SDK or API is this about?

SharePoint CSOM

Developer environment

Windows

What browser(s) / client(s) have you tested

  • 💥 Internet Explorer
  • 💥 Microsoft Edge
  • 💥 Google Chrome
  • 💥 FireFox
  • 💥 Safari
  • mobile (iOS/iPadOS)
  • mobile (Android)
  • not applicable
  • other (enter in the "Additional environment details" area below)

Additional environment details

  • Microsoft.SharePointOnline.CSOM 16.1.25110.12000
  • .NET framework 4.8

Describe the bug / error

We have an RateLimit implementation based on this example on GitHub: https://github.com/OneDrive/samples/blob/master/scenarios/throttling-ratelimit-handling/readme.md

In a development environment we get RateLimit headers returned from SharePoint, but with ClientIDs from a few customers we almost never get RateLimit headers returned.

Instead the customer app is throttled with 429 Too Many Requests errors with retry times of sometimes even 200+ seconds.

In Fiddler the network traffic is clearly visible that there are no RateLimit headers.

NoRateLimitHeaders

In the production environment there are around 4 processes which run with the same clientid which do background processes (Windows agents), and 4 processes (websites) which serve user requests. The websites processes run under a different clientid, but this does not make a difference. All processes are affected with many 429 errors.

In which case does SharePoint online give not first RateLimit headers, but returns 429 errors?

Steps to reproduce

  1. Use the example on GitHub https://github.com/OneDrive/samples/blob/master/scenarios/throttling-ratelimit-handling/readme.md
  2. Change the function SharePointCSOMCallAsync
private async Task SharePointCSOMCallAsync(Microsoft.SharePoint.Client.ClientContext clientContext)
{
	var site = clientContext.Site;
	var rootWeb = site.RootWeb;
	var contentTypes = rootWeb.ContentTypes;
	var currentUser = rootWeb.CurrentUser;
	var fields = rootWeb.Fields;

	clientContext.Load(site, s => s.Url, s => s.ServerRelativeUrl);

	clientContext.Load(rootWeb, r => r.Id, r => r.Description, r => r.Title, r => r.Url);
	clientContext.Load(rootWeb, r => r.Language, r => r.ServerRelativeUrl);

	clientContext.Load(currentUser, u => u.IsSiteAdmin, u => u.LoginName);

	clientContext.Load(contentTypes, c => c.Include(ctt => ctt.Fields.Include(f => f.InternalName), cct => cct.FieldLinks.Include(fl => fl.Name), ctt => ctt.Name, ctt => ctt.Group));
	clientContext.Load(fields, fi => fi.Include(f => f.InternalName, f => f.Id, f => f.Group, f => f.Hidden, f => f.ReadOnlyField, f => f.Title, f => f.CanBeDeleted));

	clientContext.Load(rootWeb, r => r.RoleDefinitions.Where(rd => !(rd.RoleTypeKind == RoleType.Guest || rd.RoleTypeKind == RoleType.RestrictedGuest)).Include(rd => rd.Id, rd => rd.Name, rd => rd.BasePermissions, rd => rd.RoleTypeKind));
	clientContext.Load(rootWeb, r => r.RoleAssignments.Include(ra => ra.Member.LoginName, ra => ra.Member.PrincipalType, ra => ra.Member.Id, ra => ra.RoleDefinitionBindings.Include(rdb => rdb.Id, rdb => rdb.RoleTypeKind, rdb => rdb.Name)));

	var siteUsers = site.RootWeb.SiteUsers;
	site.RootWeb.Context.Load(siteUsers, us => us.Include(u => u.Title, u => u.LoginName, u => u.PrincipalType, u => u.Email, u => u.Id));
	loadDefaultTitleDescriptionResource(clientContext.Site.RootWeb);
	await clientContext.ExecuteQueryAsync();
	Console.WriteLine(site.RootWeb.Title);

	IncrementCallsDone();

}

private static void loadDefaultTitleDescriptionResource(Microsoft.SharePoint.Client.Web web)
{
	var cultureNameEN = "en-US";
	var cultureNameNL = "nl-NL";
	_ = web.TitleResource.GetValueForUICulture(cultureNameEN);
	_ = web.TitleResource.GetValueForUICulture(cultureNameNL);
	_ = web.DescriptionResource.GetValueForUICulture(cultureNameEN);
	_ = web.DescriptionResource.GetValueForUICulture(cultureNameNL);
}
  1. Comment method 'SharePointRestCallAsync' and 'GraphRestCallAsync', so only method 'SharePointCSOMCallAsync' is called.
// Test a SharePoint Rest call
// await SharePointRestCallAsync(client, sharePointAccessToken);

// Test a Graph Rest call
//await GraphRestCallAsync(client, graphAccessToken);

// Test a CSOM call
await SharePointCSOMCallAsync(clientContext);
  1. Configure the app (for instance with 5 threads)
  2. Start Fiddler (or any other app which can show network traffic)
  3. Run the app

Expected behavior

In the development environment we get RateLimit headers.

RateLimitHeaders

Activity

  1. digiofficerobin commented on Mar 3, 2025

    @digiofficerobin
    ContributorAuthor

    Any updates on this issue?

  2. Ashlesha-MSFT commented on Mar 24, 2025

    @Ashlesha-MSFT
    Contributor

    Hello Robin Bouwmeester (@digiofficerobin),
    Thank you for bringing this issue to our attention. We will look into it and get back to you shortly.

  3. digiofficerobin commented on Mar 24, 2025

    @digiofficerobin
    ContributorAuthor

    You can use the ThrottlingSample.zip of issue #10070 (comment) as a starting point. Please uncomment the loadSiteInfo() call in SharePointCSOMCallAsync.

    private async Task SharePointCSOMCallAsync(Microsoft.SharePoint.Client.ClientContext clientContext)
    {
    	//await ensureUser(clientContext);
    	await loadSiteInfo(clientContext);
    	IncrementCallsDone();
    }
    

    Feel free to ask any questions you may have

  4. Ashlesha-MSFT commented on May 8, 2025

    @Ashlesha-MSFT
    Contributor

    Apologies for the delayed response, and thank you for your patience. We wanted to let you know that we have already brought this issue to the attention of our engineering team for further analysis and resolution.

  5. digiofficerobin commented on Jun 19, 2025

    @digiofficerobin
    ContributorAuthor

    Any updates on this question?

  6. digiofficerobin commented on Jul 7, 2025

    @digiofficerobin
    ContributorAuthor

    Any updates on this question?

  7. digiofficerobin commented on Aug 18, 2025

    @digiofficerobin
    ContributorAuthor

    Any updates on this question?

  8. VesaJuvonen commented on Aug 19, 2025

    @VesaJuvonen
    Contributor

    No updates - the currently owning PM on this feature is on a vacation with delays. We should be able to get a response on this within upcoming weeks. Thanks for pushing for resolution and input on this. Appreciate the push to keep us tracking there 👍

  9. VesaJuvonen commented on Nov 3, 2026

    @VesaJuvonen
    Contributor

    This issue is more than 12 months old and has not had recent activity. We are cleaning up the backlog so we can manage incoming reports more efficiently. If the issue is still relevant, please submit a new issue with updated details and current reproduction steps. We apologize for any inconvenience caused by this updated process, and thank you for being part of the SharePoint developer ecosystem.

  10. github-actions commented on Nov 3, 2026

    @github-actions

    Thank you for taking the time to file an issue. We periodically archive older or inactive issues as part of our issue management process, which automatically closes them once they are archived.

    If you’d like to understand more about why and how we handle archived (closed) issues, please see Our approach to closed issues.

    We appreciate your contribution and if this is still an active issue with the latest SPFx versions, please do resubmit the details. We needed to perform a cleanup, so that we can start with a clean table with a new process. We apologize for the inconvenience this might cause.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

sharepoint-developer-supportsharepoint-developer-supporttype:archive-old-issueIssues which are closed as tool old for active worktype:bug-suspectedSuspected bug (not working as designed/expected). See “type:bug-confirmed” for confirmed bugs.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions