topics
January 7, 2025
Complete the following steps to configure your Enterprise Agreement (EA) bill splitting for Azure account with the CloudHealth Platform.
Navigate to Setup > Accounts > Azure Enrollment and click Add Enrollment.
Enter the Enrollment ID and Enrollment Name.
Under Partner > Scope, select:
Navigate to Partner > Customers > Lists. Then click New Customer.
In the New Customer Sign Up form, enter Account Information, Company Information, and Company Address for the customer.

Select Set Up Partner Generated Billing to proceed.
Select a Classification to determine the level of customer access:
Click on Azure CSP or Azure EA tab to configure Azure accounts.
Select the Charge PAYG pricing checkbox to use the Azure Pay As You Go rate cards for customer bills.

Prerequisite: You must have global administrator privileges to register an App. While the connection between CloudHealth and Azure is read-only, a global administrator must register the App to ensure that there are no errors.
Open a text editor (such as NotePad or TextEdit).
Log in to the Azure Portal.
From the left menu, select Azure Active Directory.
Select the App Registrations tile and then click New App Registration from the top of the page.

Fill out the following fields in the form and then click Create:
https://apps.cloudhealthtech.com
Due to a a rare issue in the Azure Portal, creating a new app registration might fail to create a new service principal as expected. If this occurs, click the Create Service Principal link in App Registrations > Overview.
Open the Application Registration you just created.

Go to Certificates & Secrets in the left menu. Click New Client Secret.
Click Save. A value is generated.
Copy the key description and value into the text document.
Close the App Registration blade and return to the Active Directory menu.
Under the Manage header, select Properties.

Locate the directory ID. Select the Copy icon to copy the ID and then paste it into the text document.

Repeat steps 3-12 for each directory you manage.
Checkpoint: At this point, you have this information in the text document.
You can only create or update this billing role using the API.
Use your account credentials as an Enterprise Admin or Global Admin to sign in to the tenant with the enrollment access that you want to assign.
Open the Role Assignments - Put REST API article. Click Try it.
Provide the following parameters as a part of the API request.

For help locating these values, see Find API Parameters topic. For more information, see Find your SPN and tenant ID.
API Request Body:
{
"properties": {
"principalId": "REPLACE WITH OBJECT ID",
"principalTenantId": "REPLACE WITH TENANT ID",
"roleDefinitionId": "/providers/Microsoft.Billing/billingAccounts/REPLACE WITH BillingAccountID/billingRoleDefinitions/24f8edb6-1668-4659-b5e2-40bb5f3a7d7e"
}
}
If you have multiple enrollments mapped to the same service principals, you will need to run the Role Assignments - Put - REST API (Azure Billing) command for each enrollment.
Open the Role Assignments - Put REST API article, and click Try it.
Sign in to the tenant as an Enterprise Admin with the enrollment access.
Provide the following parameters as a part of the API request.
For help locating these values, see Find API Parameters topic. For more information, see Find your SPN and tenant ID.
{
“properties”: {
“principalId”: “SPN ID OR OBJECT ID”,
“principalTenantId”: “ADtenant ID OR Azure Tenant ID”,
“roleDefinitionId”: “/providers/Microsoft.Billing/billingAccounts/EnrollmentID/billingRoleDefinitions/24f8edb6-1668-4659-b5e2-40bb5f3a7d7e”
}
}
When configuring the Service Principals with the enrollmentReader permission, change the API endpoint URL in the Role Assignments - Put API from https://management.azure.com to https://management.usgovcloudapi.net to grant the SPN the new permission.
Object ID
Make sure that you copy and paste the Object ID from Enterprise applications. Do not use Object ID from App Registrations.

Azure Tenant ID

BillingAccountID

Role Definition
Already pre-filled with correct role ID. For example- "roleDefinitionId": "/providers/Microsoft.Billing/billingAccounts/REPLACE WITH BillingAccountID/billingRoleDefinitions/24f8edb6-1668-4659-b5e2-40bb5f3a7d7e"
Enrollment ID
Assign a Reader role for subscriptions that are managed in the directory.
For help assigning roles in Azure, see Assign Azure Roles using the Azure Portal.
When assigning the role, make the following selections:
Repeat this step for each subscription.
With the additional get and list permissions, CloudHealth gets access to keys and secrets for each key vault under each subscription. Providing this access offers the following benefits:
Use the following steps to grant additional permissions to the service principal:

$subs = Get-AzureRmSubscription
$client_id = 'Application id of service principal'
foreach ($sub in $subs) {Set-AzureRmContext -SubscriptionId $sub.SubscriptionId
$key_vaults = Get-AzureRmKeyVault
foreach ($key_vault in $key_vaults) {Set-AzureRmKeyVaultAccessPolicy -VaultName $key_vault.VaultName -ServicePrincipalName $client_id -PermissionsToKeys get,list -PermissionsToSecrets get,list } }
Get the Application id of the service principal from the CloudHealth platform. Go to Setup > Accounts > Azure Service Principal.
The script accesses current key vaults and grant permission to the service principal to retrieve and display key vault keys and secrets.
For a newly-added key vault, you need to separately grant permission to the service principal to retrieve and display keys. You can either run the above PowerShell script or manually add the service principal using following steps:
get, list permissions from the Key permissions and Secret permissions dropdown. Log in to the CloudHealth platform. From the left menu, select Setup > Accounts > Azure Service Principal. Then click New Service Principal.
Select Global Azure from the Account Type dropdown.

Copy the information from the text document into corresponding fields in the setup form.
Make sure there are no spaces.
Optionally, select the Security Asset Collection dropdown if you want to disable asset collection on certain assets for security reasons. CloudHealth recommends enabling asset collection for all assets and does not store sensitive data.
Disabled assets are marked as inactive in CloudHealth and cannot be used in policies.

Click Save Service Principal.
Log in to the Azure Portal and go to Azure Active Directory > App Registrations.
Copy the display name of the application you registered for CloudHealth and paste it in a Text file (such as NotePad or TextEdit).

Log in to the CloudHealth Platform. Go to Assets > Azure and select Savings Plans from the Other section.
In the Savings Plan table, click the Go to Azure Portal icon to open the savings plan in the Azure portal.
From the left pane, go to Access Control (IAM) and click Add role assignment.

Fill out the fields as follows:
Select Reader from the Role dropdown menu.
In the Select field, copy and paste the service principal display name from step 2 that is associated with the savings plan and select the user returned by the search.
Click Save.
Repeat steps 4-7 for each Savings Plan.
The CloudHealth platform supports Azure AD User collection through Azure Service Principal. To collect the Azure AD objects, you need to add an additional Graph API permission to the Service Principal.
Log in to the Azure Portal, go to Azure Active Directory > App Registrations, and select the CloudHealth app.
Click API permissions > Add a permission.
Select Microsoft Graph and click Application permissions.
Under Select Permissions, expand Users, and select User.Read.All permission.
Click Add Permissions.

Once you add the required permissions, click Grant admin consent for Default Directory to allow an admin to grant admin consent to the configured permissions.
