402 : Payment Required with Developer E5 Sandbox

Mike Cantrell 0 Reputation points

I've stood up a developer E5 sandbox to test the Graph Teams export API. I know that these APIs require a payment model but I didn't expect the sandbox to enforce it:


I'm not sure what to do here. It doesn't appear that you can enter payment information for the API with a sandbox subscription. I can't re-provision the sandbox without deleting my profile and waiting up to 60 days.

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,521 questions
{count} votes

3 answers

Sort by: Most helpful
  1. Antonio 250 Reputation points Microsoft Vendor

    Hi Mike Cantrell

    As mentioned in the docs (See below) metered APIs and services in Microsoft Graph that consumes the APIs must be associated with an Azure subscription. This subscription will be billed for any metered charges.

    See the article for Creating/Adding Enterprise and Organization Azure Dev/Test Subscriptions


    Further note billing model available:
    User's image

    For additional aid in Azure billing setup please open a case with Azure support:

    For requesting to update doc pages please refer to bottom of page in doc and in the "Submit and view feedback for" section click "This page" for GitHub review request.

    --please don't forget to upvote and Accept as answer if the reply is helpful--

  2. Mike Cantrell 0 Reputation points

    Counter to what the Team API licensing documentation states, it is not possible to use a real payment model with the developer sandbox subscription:

    https://learn.microsoft.com/en-us/graph/teams-licenses#payment-models You can get a free Microsoft 365 E5 developer sandbox subscription with 25 user licenses through the Microsoft 365 Developer Program.

    The Team API licensing documentation should be updated to reflect this limitation instead of encouraging users to take that route. That's the entire reason we signed up for a sandbox subscription. We've lost a few days due to this and it's an expensive mistake.

  3. Mike Cantrell 0 Reputation points

    OK, we received the same error from our non-sandbox Azure subscription. The solution is to create resource groups and register your application to use the metered Graph API:

    New-AzResourceGroup -Name "MyApp" -Location "East US"
    Register-AzResourceProvider -ProviderNamespace Microsoft.GraphServices
    New-AzResource -ResourceName MyAppBilling -ResourceGroupName MyApp -ResourceType Microsoft.GraphServices/accounts -Properties @{"appId"="xxxx-xxxx-xxxx-xxxx-xxxxxx"} -Location Global -Force

    I haven't tried this with the sandbox subscription (we've moved on) but I'm assuming this would have fixed it as well.