1. Home
  2. Setup
  3. How to Generate your Azure EA Access Token (aka API Access Key)
  1. Home
  2. FAQ
  3. How to Generate your Azure EA Access Token (aka API Access Key)

How to Generate your Azure EA Access Token (aka API Access Key)


An access token, also known as an API Access Key, generated in the Azure Portal is required to allow PyraCloud to import cost and usage information for your Microsoft Azure subscriptions under an Enterprise Agreement.

These tokens expire on a regular basis, so you will need to follow these instructions each time your token expires to generate a new one and then add it to PyraCloud.

Change of portal
Note that previously these access tokens (aka API Access Keys) were generated in the Azure EA Portal. This portal was deprecated by Microsoft and the equivalent functionality has been implemented in the Azure Portal.

This article has been updated with instructions for the new process in the Azure Portal.

Microsoft Azure EA only
Note that API Access Keys are required for activating Microsoft Azure under an Enterprise Agreement only.

If you are activating Microsoft 365, this article does not apply. If you are activating Microsoft Azure under another licensing program (for example, CSP), this article does not apply.


To generate an API Access Key in the Azure Portal, the user generating the key must have the Enterprise Administrator or Enrollment Admin directory role assigned to their user account. If the user does not have this level of access, the “Manage API Access Keys” section of the Azure Portal will not be visible, and the user will not be able to complete the steps below.

Two other roles, Department Owner and Account Owner, are mentioned in the Microsoft documentation. Although API Access Keys can be generated by users with these roles, the generated keys will be insufficient for PyraCloud to operate correctly.

Generate a primary or secondary API Access Key

Documentation source
The following steps are reproduced directly from this Microsoft documentation. This documentation also includes information on the data made available through the Microsoft APIs, and common issues a user might face.

  1. Sign in to the Azure portal as an enterprise administrator.
  2. Select Cost Management + Billing.
  3. Select Billing scopes from the navigation menu and then select the billing account that you want to work with.
  4. In the navigation menu, select Usage + Charges.
  5. Select Manage API Access Keys.
  6. Select Generate to generate the key.
  1. Select the expand symbol or select Copy to get the API access key for immediate use.
Updated on January 26, 2023

Was this article helpful?

Related Articles