Act now: are you ready for Microsoft Graph billing changes coming in July?
We’ve known for a while (since October 2021 in fact) that Microsoft would start charging for using specific API endpoints in Microsoft Graph.
These chargable endpoints are confined to Change Notifications for Teams activity, Export APIs and message updates. The specific APIs impacted are:
- Microsoft Graph Change Notifications API for Teams notifications
- Microsoft Graph Export APIs for Teams chat messages
- Microsoft Graph Export APIs for Teams channel messages
- Microsoft Graph Patch API for Teams messages (just policyViolation updates)
Now though, thanks to a blog post on the Microsoft 365 Platform blog, we know that Microsoft are going to start implementing their planned charging for use of these endpoints.
In this post I’ve tried to give clear advice on who should act, what you need to do by when, and answer some common questions. Let me know if there are questions you think I’ve missed!
If you created your application registration after March 1st 2023…
If your application registration (not your app, just the application registration) was created after 1st March then you are already being charged for these APIs and therefore there isn’t any new action for you to take.
If this was a surprise, then either you’re using Evaluation Mode (which is fully functional but with a low rate) and your application isn’t making enough calls to cause a problem, or you’re missing data. Check for HTTP 402: Payment Required response errors.
If you created your application registration before March 1st 2023…
If you have an application registration which is older than March 1st then you have yet to be impacted by this change.
This is changing. From July 1st 2023, your application must be registered and configured correctly, otherwise it will revert to Evaluation Mode, putting you at risk of those HTTP 402: Payment Required errors.
What is Evaluation Mode?
Evaluation Mode is the default state your application is placed into if you don’t do anything. The throughput limits for Evaluation Mode are:
- 500 chatMessage change notification messages per month, per app
- 500 conversationMember change notification messages per month, per app
- 500 chat change notification messages per month, per app
- 500 export messages across all chats per month, per app
- 500 export messages across all channels per month, per app
- 500 policyViolation chatMessage updates, per month, per app
After this, you will receive HTTP 402: Payment Required errors and data will not be returned until the limit resets at the start of the next month.
What do I need to do to prepare for Graph billing changes?
- You need to associate your application with an Azure subscription for billing. This is done by creating a resource of type Microsoft.GraphServices. If this is the first time you have done this you also need to register the resource provider on your subscription, which you can do in the CLI: az provider register –namespace Microsoft.GraphServices
- To actually associate the application with the subscription, create a new instance of a Microsoft.GraphServices resource:
az resource create --resource-group RESOURCE_GROUP_NAME --name myGraphAppBilling --resource-type Microsoft.GraphServices/accounts --properties "{`"appId`": `"myAppGUID`"}" --location Global --subscription mySubscriptionGUID
You’ll need to know your subscription ID and application ID. More information on these commands is in the Microsoft docs: Enable metered APIs and services in Microsoft Graph – Microsoft Graph | Microsoft Learn.
Tip: I recommend creating a new resource group, either for all of these GraphService resources you create (one per application), or a separate resource group for each GraphService resource. This will make viewing the costs easier (see below).
- If you application is a Security & Compliance application then you can use the seeded capacity provided with some license types, provided that license supports the Microsoft Communication DLP service plan. This is called Model A. For more information on the seeded limits and the price for additional use, see this documentation page: Payment models and licensing requirements for Microsoft Teams APIs – Microsoft Graph | Microsoft Learn. For everyone else, your consumption model is called Model B. (see also: Microsoft Teams Export APIs and Change Notifications for Chats & Channels will be chargeable | The thoughtstuff Blog)
- If you want to PATCH chat messages to update the policyViolation data, you must use Model A. (ref)
- You need to specify which model you are using (Evaluation, A, B) when making requests to these chargeable APIs. Typically this is done by appending a URL parameter ?model=A or ?model=B to the request URL. If no model parameter is passed, Evaluation Mode is assumed.
I have a multi-tenanted application. What happens?
Microsoft Graph consumption charges accrue to the owner of the application, whether it’s single tenant or multi-tenant. This means that if you have a multi-tenanted application used by many different tenants, all the charges will come to you!
How can I see what I’m being charged?
Once you have configured your application and subscription for consumption billing the costs will appear in Azure alongside any other charges you have, via the Cost Analysis blade. If you have created your GraphService resources in a separate resource group then it should be easier to separate out the consumption API cost from anything else that’s happening in your tenant.