Overview Of Microsoft Graph Open Extensions And Schema Extensions

What is Microsoft Graph Extensions?

 
It allows you to extend the graph API resources to save the data of your own application. You can add the custom properties of Microsoft graph resources like user and messages. You can define custom schema and maintain the application data in graph API which meets the schema requirements. It avoids the overhead in maintaining data in two different data stores.
 
Microsoft Graph offers two types of extensions,
  • Open Extensions – Helps to add untyped data to Graph resources.
  • Schema Extensions – Helps to define a schema and extend the resource type.
Note
Don’t use extensions to store sensitive information like credentials, banking details, government identity related details.
 

Why do we need Microsoft Graph Extension?

 
Let’s assume you have an application where you need to save some user specific data like user theme color or user specific settings.
 
Here you will be saving user specific data in your custom database and user profile details from Active Directory. Managing data in two different data stores is a headache, right?
 
What if you are able to manage the user-centric data in Graph API itself?
 
What if you are able to get your own application data along with Graph results itself?
 
It eases the overload in managing data in single data store and gets it using Graph API calls.
 
Supported resources where Microsoft Graph Extensions is generally available,
Supported resources where Microsoft Graph Extensions is in Preview,
All the above-mentioned resources are supported in work or school accounts.
 
Below are the resources which you can use for graph with personal accounts also,
  • Event
  • Post
  • Group
  • Message
  • Contact
  • User

What permissions are needed to use Microsoft Graph Extension?

 
You don’t need any additional permission to use Open Extension, the same permission which is needed for the resource is enough to use Open Extension.
 
But to manage schema extension the application must be granted Directory.AccessAsUser.All permission.
 
Limitations in Microsoft Graph Extension
  • Directory resources like User, Group and Device can have up to 2KB of data.
  • Maximum 2 open extensions are allowed per resource instance.
  • Extensions for Outlook resources like Message, event, contact are stored in MAPI property of user’s mailbox which is limited resource.
  • Maximum 5 schema extension definitions can be created by an application.
  • Change tracking using Delta Query is not supported for extension properties.
  • Open extensions are not possible to add along with resource while creating resources like device/group/user. First create a resource and make a separate API call to add the extension to the entity.
  • Schema extensions are not possible to add while creating resources. First create the resource then add the schema and then add the data.
  • Maximum of 100 extension properties are allowed in schema extension.
  • Filtering of data based on schema extension properties are not supported for outlook entity types like contact, event, message or post.

Conclusion

 
I hope this article helps you to understand about Microsoft Graph Extensions, its purpose, and its limitations. If you have any questions/issues about this article, please let me know in the comments.