Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Microsoft Graph API - 503 Service Unavailable

I'm working to integrate Microsoft Graph with a Rails web application. We're trying to send multiple email messages via Graph, but every now and then we get a 503 Service Unavailable with the following headers and body:

Response headers:

{
  "content-type": [
    "text/html; charset=us-ascii"
  ],
  "server": [
    "Microsoft-HTTPAPI/2.0"
  ],
  "date": [
    "Wed, 30 May 2018 22:05:31 GMT"
  ],
  "connection": [
    "close"
  ],
  "content-length": [
    326
  ]
}

Response body:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""http://www.w3.org/TR/html4/strict.dtd">
<HTML>
<HEAD>
    <TITLE>Service Unavailable</TITLE>
    <META HTTP-EQUIV="Content-Type" Content="text/html; charset=us-ascii">
</HEAD>
<BODY>
    <h2>Service Unavailable</h2>
    <hr>
    <p>HTTP Error 503. The service is unavailable.</p>
</BODY>
</HTML>

We use the POST https://graph.microsoft.com/v1.0/me/sendMail call to send hundreds of outlook emails. After sending roughly 100-200 emails with the Graph API we get the 503 Service Unavailable error. This is problematic when we have to send 1000+ customized emails since it is unclear to me how we could properly handle the error without knowing how long to wait before retrying and other Graph API request.

I'm wondering if anyone has run into a similar issue before. I've read about something similar along the lines of client throttling (Microsoft Graph API - Throttling), but in this post, they're getting 409 (with a retry-after header), not 503.

Based on the Graph documentations, we're supposed to receive a JSON object that may contain a Retry-After header. However, as shown above, we're neither getting the Retry-After header nor a JSON object for the 503 error.

like image 331
Jack Avatar asked Jun 01 '18 22:06

Jack


People also ask

How do I grant access to Microsoft Graph API?

Go to the app's API permissions page. Select Add a permission and then choose Microsoft Graph in the flyout. Select Delegated permissions. Use the search box to find and select the required permissions.

Is graph API deprecated?

Azure Active Directory (Azure AD) Graph is deprecated but won't be retired on June 30, 2022 as previously announced.

How do I grant access to Microsoft Graph Explorer?

You can consent to permissions in Graph Explorer by choosing either the Modify permissions tab or the Select permissions option in the settings gear next to your profile when you're signed in. The Modify permissions tab lists all the permissions that you need to run the query in the address bar.


1 Answers

As an update here. In future for any 500 error messages, you are best to raise these as service issues as per the instructions here https://developer.microsoft.com/en-us/graph/support

Have a paid Azure subscription? Visit the Azure Admin Center. https://ms.portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/newsupportreq

Have a Premier support contract for Microsoft 365? Visit the Microsoft 365 Admin Center and use the Support menu. https://admin.microsoft.com/

like image 185
Jeremy Thake MSFT Avatar answered Sep 22 '22 04:09

Jeremy Thake MSFT