Microsoft Graph PDF conversion timing out at ~45 seconds with "General_Timeout" error

Thomas, Andre (CDC) 20 Reputation points
2025-12-24T01:44:24.5866667+00:00

Environment:

  • Azure App Service (Windows)
  • Node.js application v18.19.1
  • @microsoft/microsoft-graph-client v3.0.7
  • Testing with Postman (to isolate from client-side issues)
  • SharePoint Online drive item conversion

Issue: I'm using the Microsoft Graph API to convert Word documents to PDF via the /drives/{driveId}/items/{itemId}/content?format=pdf endpoint. The conversion consistently times out after approximately 45 seconds with a General_Timeout error, even for a relatively small 7 MB Word document containing only text (no images or complex formatting).

Error Response:

{
  "error": {
    "code": "generalException",
    "message": "The operation has timed out.",
    "innererror": {
      "code": "General_Timeout"
    }
  }
}

Code Example

const token = await getAccessToken(); // OAuth2 client credentials flow
const controller = new AbortController();
const timeoutId = setTimeout(() => controller.abort(), 600000); // 10 minute timeout

const response = await fetch(
  `https://graph.microsoft.com/v1.0/drives/${driveId}/items/${itemId}/content?format=pdf`,
  {
    method: 'GET',
    headers: {
      'Authorization': `Bearer ${token}`
    },
    signal: controller.signal
  }
);

clearTimeout(timeoutId);


What I've Tried:

  1. Increased timeout to 10 minutes (600,000 ms) using AbortController
  2. Tested with both the Graph SDK client and raw fetch() - same result
  3. Confirmed the timeout occurs at ~45 seconds consistently across multiple attempts
  4. Verified the file is accessible (can download without ?format=pdf successfully)
  5. Tested with simple text-only Word documents (no images, 7 MB file size)

Questions:

  1. Is there a server-side timeout limit (approximately 45 seconds) for the synchronous ?format=pdf conversion that cannot be overridden?
  2. Are there any recommended file size or complexity limits for synchronous PDF conversion? The documentation says 100MB file size limit so I'm well within that.
  3. Is there an asynchronous/job-based API for document conversion to avoid synchronous timeout limits?

The 100 MB file size limit suggests larger files should be supported, but I'm hitting timeouts well below that threshold. Any guidance would be appreciated.

Microsoft Security | Microsoft Graph
0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.