To get the billing data for Azure in the OpsRamp portal, you need to enable the Cost Management API to calculate an estimate for your Azure spending. This will help you to monitor the spending over a period from the OpsRamp portal.
Step 1: Enable API
To enable the Cost Management API:
- Log in to the Azure portal.
- From the left-hand side navigation menu, click Subscriptions.
- Select the subscription that you want to enable the Microsoft.CostManagement API.
- From the left-hand side navigation menu, click Resource providers.
- Search for Microsoft.CostManagement in the list of resource providers. If the status of the provider is Not Registered, you need to register the provider.
- Select the provider and click the Register button to register.
This will allow you to use the Azure Cost Management APIs and SDKs to manage and retrieve the cost-related data for your resources.
Perform the below steps in the Azure portal to check the role assignments for a service principal and ensure it has the necessary permissions for cost management operations:
- Log in to the Azure portal.
- Select Azure Active Directory from the left-hand menu and navigate to the Azure Active Directory page.
- In the Azure Active Directory page, select Enterprise applications from the left-hand menu.
- Search for the name or the application ID of the service principal associated with the provided credentials.
- Once you find the service principal in the list, click the service principal to select it.
- In the Service Principal overview page, click the Users and groups option in the left-hand menu.
- In the Users and groups page, you will see the list of users and groups assigned to the service principal.
- Review the assigned users and groups to ensure the appropriate individuals or groups have access.
- To check the role assignments for the service principal, click the Roles and administrators option in the left-hand menu.
- In the Roles and administrators page, you will see the list of role assignments for the service principal.
- Review the role assignments to verify if the service principal has the Cost Management Operator or Cost Management Reader role assigned.
- If the desired role assignments are missing, you can click Add assignments button to assign the appropriate roles.
- In the Add assignments page, search for the desired roles (for example, “Cost Management Operator” or “Cost Management Reader”) and select them.
- Specify the desired users, groups, or service principals to assign the roles to.
- Click the ADD button to assign the roles.
By following the above steps, you can check the role assignments for a service principal in the Azure portal and ensure it has the necessary permissions for cost management operations. Make sure to assign the appropriate roles to the service principal to grant the desired level of access to Azure resources.
After you get the Offer ID from the Azure portal, you need to set the offer ID in OpsRamp.
To set the Offer ID:
- Log in to the OpsRamp portal.
- Click All Clients. From the drop-down list, select a client.
- Navigate to Setup > Integrations and Apps > Integrations.
- Click on Azure integration and navigate to Settings.
- Select the Collect Cost Analytics checkbox.
- Click Finish.The configuration is successfully created.