Learn how to take advantage of APIs, platform capabilities and intelligence from Microsoft Graph to make your app more performant, more resilient and more reliable
8. Graph uses server-
side page size limits
When querying
collections, Graph
may return the results
in many pages
Always expect an
@odata.nextLink
property in the response
Contains the URL to the next page
9. 1.
Always handle the
possibility that the
responses are paged
in nature
2.
Follow the
@odata.nextLink
to obtain the next
page of results
3.
Final page will not
contain an
@odata.nextLink
property
4.
Treat the entire URL
as an opaque string
10. Error Best practice
403 How did this happen? My application got consent!
The signed-in user does not have privileges to access the resource requested.
Tip: Provide a generic "Access denied" error back to the signed-in user.
404 How did this happen? I just got this resource!
Resource not yet provisioned (like a user's photo)
Resource has been deleted
Tip: Watch for restore - your application should also take this into account.
429 Your app should always be prepared to be throttled.
Tip: Honor the HTTP Retry-After response header to recover
Tip: Rate limit to stay below throttle limits
503 Service is busy
Tip: Retry – but employ a back-off strategy similar to 429
Tip: Additionally, always make new retry requests over a new HTTP connection
15. Use filters
GET ?
$filter=department eq ‘Sales’ & $select=givenName,mail
Choose the records your
app really needs and no
more
Don’t send
unnecessary data
over the wire
Tip
Use $filter
16. POST/PATCH/PUT
If your code doesn’t need
to get a response, then
opt out
Don’t send
unnecessary data
over the wire
Tip
Use HTTP
Prefer return=minimal
request header
17. Webhooks
Scenario
Application needs to know
about changes to data – like
deleted users
Tips
Use webhook notifications whenever
data of interest has changed
Put notifications in a queue for later
processing
Why
Avoid computationally
expensive and excessive
polling
18. Delta query
Scenario
Need to cache or store Microsoft
Graph data locally, and keep that
data up to date, or track changes
to data for any other reasons
Tip
Use delta query
Why
Stop retrieving data your application already has!
Minimizes network traffic
Reduces the likelihood of reaching a throttling
threshold
19. Webhooks Delta query
Scenario
Same scenarios as before,
but if you need to
optimize further…
Tips
Use webhook notifications as the
trigger to make delta query calls
Put notifications in a queue for later
processing
Why
Difficult to figure out optimal
polling interval
THR2436 Barracuda Sentinel: Microsoft Graph powered AI for real-time cyber
fraud defense
20. Batching
Scenario
Mobile client app needs to get
signed-in user’s profile AND
avatar
Tip
Use JSON batching
Why
Performance gains through multiplexing
Save the application significant network latency
Conserves connection resources
Lower bandwidth consumption
23. Related sessions
BRK2409 Leveraging SharePoint as a development platform for the
modern intranet
Tue 4:45
BRK2406 Coding Enterprise Apps for Intune – Protected, Secured &
Integrated
Wed 8:30
BRK2410 Data-Driven and User-Centric: Improving enterprise productivity
and engagement through graph powered notifications
Wed 4:30
THR3304 Cognitive Services + Microsoft Graph Tue 5:30
THR2430 Intelligent Edge: Microsoft Graph and IoT Wed 9:00
THR2413 Bots + Teams + Microsoft Graph: the perfect combo to help
manage your calendar
Wed 11:00
THR3302 Azure Functions and Microsoft Graph Wed 12:30
THR2436 Barracuda Sentinel: Microsoft Graph powered AI for real-time
cyber fraud defense
Wed 1:00
THR2437 Smart UI with Adaptive Cards, Microsoft Graph and beyond Wed 2:00
TSP2013 Microsoft Graph Device Remote Sessions Wed 3:30
WRK2510 Build intelligent intranet portals with SharePoint Wed 4:00