Skip to content

Grant EnrollmentReader for EA billing

First navigate to the REST API page - https://learn.microsoft.com/en-us/rest/api/billing/2019-10-01-preview/role-assignments/put?tabs=HTTP#code-try-0 • Sign in with an Admin Account. • Select the AD Tenant that contains the CloudMonitor Service Principal.

First navigate to the REST API page -…

You will see that the right pane has changed into a simple API platform. In the Parameters section we need to provide values for the following fields:

  1. billingAccoutName
  2. billingRoleAssignmentName

billingAccoutName 2. billingRoleAssignmentName

The billingAccountName is your “Billing account ID”. You can find this in the Azure portal on the “Cost Management + Billing” Overview. In our example below it is 1111111.

The billingAccountName is your "Billing account ID". You can find this in the Azure portal on the "Cost Management + Billing" Overview

Paste the “Billing account ID” into the billingAccountName input field.

Paste the "Billing account ID" into the billingAccountName input field

For the second input, we need to provide a random, unique GUID. We can generate one using the online GUID/UUID Generator website - https://guidgenerator.com.

For the second input, we need to provide a random, unique GUID

Paste the GUID in the billingRoleAssignmentName input field.

Paste the GUID in the billingRoleAssignmentName input field

The Parameters section is now done. We will now move onto providing a JSON object in the Body section.

The Parameters section is now done. We will now move onto providing a JSON object in the Body section

Replace <your-billing-accountId> with the same billingAccountId used in the “billingAccountName” parameter. In our example, it is “1111111”.

Replace the your-billing-accountId placeholder with the same billingAccountId used in the billingAccountName parameter — for example, "1111111"

Replace <billing-role-definitionId> with “24f8edb6-1668-4659-b5e2-40bb5f3a7d7e”. The reason for this specific value is explained in the next step.

Replace the billing-role-definitionId placeholder with "24f8edb6-1668-4659-b5e2-40bb5f3a7d7e"

Note: “24f8edb6-1668-4659-b5e2-40bb5f3a7d7e” represents the role definition ID for the EnrollmentReader role. This role grants the Service Principal Name (SPN) read access to view your billing information.

Note: "24f8edb6-1668-4659-b5e2-40bb5f3a7d7e" represents the role definition ID for the EnrollmentReader role

Then replace <your-principal-tenantId> with your AD Tenant Id. You can locate it via:

  1. Go to Azure Ad > App Registrations > Find the CloudMonitor Service Principal/App (Tip: paste the Service Principal’s Client Id for filtering).
  2. Replace <your-principal-tenantId> with the “Directory (tenant) Id” field.
  3. Stay on this page for a future step.

Go to Azure AD > App Registrations and find the CloudMonitor Service Principal/App

Lastly, replace <your-principal-Id> with the CloudMonitor Service Principal Managed Application resource Object ID. You can find it by:

  1. Continuing from the last location & clicking on the Managed Application link.
  2. Replace <your-principal-Id> with the “Object ID”.

Continuing from the last location & clicking on the Managed Application link. 2. Replace the your-principal-Id placeholder with the "Object ID"

Your Body section should now look similar to the below:

Your Body section should now look similar to the below:

Click “Run” – it should return a “200” Status Code if it made the association successfully.

Click "Run" – it should return a "200" Status Code if it made the association successfully