Chapter 1. Creating an unfiltered Microsoft Azure integration
- If you want to create a filtered Azure integration, do not complete the following steps. Instead, go to Creating a filtered Microsoft Azure integration.
- If you are using RHEL metering, after you integrate your data with cost management, go to Adding RHEL metering to a Microsoft Azure integration to finish configuring your integration for RHEL metering.
You must create a Microsoft Azure integration for cost management from the Integrations page and configure your Microsoft Azure account to allow cost management access.
To create an Azure integration, you will complete the following tasks:
- Create a storage account and resource group
- Choose the appropriate scope for your cost export
- Configure a Storage Account Contributor and Reader roles for access
- Schedule daily cost exports
Azure is a third-party product and its UI and documentation can change. The instructions for configuring third-party integrations are correct at the time of publishing. For the most up-to-date information, see the Microsoft Azure’s documentation.
1.1. Selecting a scope and configuring roles Copy linkLink copied to clipboard!
In the Add a cloud integration wizard, you must select a scope to determine the level at which your cost data is collected and exported. If your scope requires the Billing account reader role, you must manually configure it in the Azure portal.
The scope that you select determines where role-based access control permissions are applied. The most common Scope selection in the wizard is Subscription.
The following list maps which role you need for each Scope selection:
Cost Management Reader Azure RBAC role:
- Subscription
- Resource group
- Management group
Billing account reader Azure RBAC role:
- Billing account
- Billing profile
- Invoice section
- Enrollment account
If your scope requires the Cost Management reader role, you can run the commands as they appear in the documentation. If your scope requires the Billing account reader role, see Assign Azure roles in the Azure portal to learn how to manually configure the role in the Azure portal.
1.2. Adding a Microsoft Azure account Copy linkLink copied to clipboard!
Add your Microsoft Azure account as an integration so cost management can process the cost and usage data.
Prerequisites
You must have a Red Hat user account with Cloud Administrator entitlements.
In cost management:
-
Click Settings Menu
> Integrations.
- In the Cloud tab, click .
- In the Add a cloud integration wizard, select Microsoft Azure and click .
- Enter a name for your integration and click .
- In the Select application step, select Cost management and click .
In the Specify cost export scope step, select I am OK with sending the default data to Cost Management.
- If you are registering RHEL usage billing, select Include RHEL usage. Otherwise, proceed to the next step.
- Select the scope of your cost data export from the menu. You can export data at the subscription level or by other scopes in your subscription.
- Copy the command that is generated.
In your Microsoft Azure account:
- Click and run the command that you copied from cost management. Copy the returned value.
In cost management:
- In the Specify cost export scope step, paste the value that you copied from Microsoft Azure into Cost export scope.
- Click .
You will continue using the wizard in the following sections.
1.3. Creating a Microsoft Azure resource group and storage account Copy linkLink copied to clipboard!
Create a storage account in Microsoft Azure to house your cost data and metrics. In the Add a cloud integration wizard in cost management, enter the storage account name in the corresponding fields.
Prerequisites
You must have a Red Hat user account with Cloud Administrator entitlements.
In your Microsoft Azure account:
-
Search for
storage
and click . - On the Storage accounts page, click .
-
On the Create a storage account page, in the Resource Group field, click . Enter a name and click . In this example, use
cost-data-group
. -
In Instance details, enter a name in the Storage account name field. In this example, use
costdata
. - Copy the names of the resource group and storage account so that you can add them to Red Hat Hybrid Cloud Console later.
- Click .
- Review the storage account and click .
In cost management:
- In the Add a cloud integration wizard, paste the resource group and storage account names that you copied into Resource group name and Storage account name.
- Click .
You will continue using the wizard in the following sections.
1.4. Configuring a daily Microsoft Azure data export schedule Copy linkLink copied to clipboard!
Next, set up an automatic export of your cost data to your Microsoft Azure storage account so that cost management can retrieve your data daily.
In your Microsoft Azure account:
- In the search bar, enter "cost exports" and click the result.
- Click .
- Under Select a template, click Cost and usage (actual) to export your standard usage and purchase charges.
Follow the steps in the Azure wizard.
- Select the correct subscription and Storage account that you created in the previous sections.
- Set Format to CSV.
- Set Compression type to None or Gzip.
- Review the information and save the export name and directory for later reference.
- Click .
Next, set up an automatic export of your cost data to your Microsoft Azure storage.
In cost management:
- Return to the Add a cloud integration wizard and complete the steps in Daily export.
- Click .
- Return to the Add a cloud integration wizard and click .
You will continue using the wizard in the following sections. For more help with creating exports in Azure, see Microsoft’s documentation.
1.5. Finding your Microsoft Azure subscription ID Copy linkLink copied to clipboard!
Find your subscription_id
in the Microsoft Azure Cloud Shell and add it to the Add a cloud integration wizard in cost management.
In your Microsoft Azure account:
- Click .
Enter the following command to get your Subscription ID:
az account show --query "{subscription_id: id }"
az account show --query "{subscription_id: id }"
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Copy the value that is generated for
subscription_id
.Example response
{ "subscription_id": 00000000-0000-0000-000000000000 }
{ "subscription_id": 00000000-0000-0000-000000000000 }
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
In cost management:
- In the Subscription ID field of the Add a cloud integration wizard, paste the value that you copied in the previous step.
- Click .
You will continue using the wizard in the following sections.
1.6. Creating Microsoft Azure roles for Red Hat access Copy linkLink copied to clipboard!
To grant Red Hat access to your data, you must configure dedicated roles in Microsoft Azure. If you have an additional resource under the same Azure subscription, you might not need to create a new service account.
In cost management:
-
In the Roles section of the Add a cloud integration wizard, copy the
az ad sp create-for-rbac
command to create a service principal with the Cost Management Storage Account Contributor role.
In your Microsoft Azure account:
- Click .
- In the cloud shell prompt, paste the command that you copied.
Copy the values from the returned data for the client ID, secret, and tenant:
Example response
{ "client_id": "00000000-0000-0000-000000000000", "secret": "00000000-0000-0000-000000000000", "tenant": "00000000-0000-0000-000000000000" }
{ "client_id": "00000000-0000-0000-000000000000", "secret": "00000000-0000-0000-000000000000", "tenant": "00000000-0000-0000-000000000000" }
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
In cost management:
- Return to the Add a cloud integration wizard and paste the values that you copied into their corresponding fields on the Roles page.
-
Copy the second
az
role assignment command that is generated from the wizard.
In your Microsoft Azure account:
- Return to the cloud shell prompt and paste the command to create a Cost management reader role.
In cost management:
- Return to the Add a cloud integration wizard and click .
- Review the information that you provided and click .
1.7. Viewing your data Copy linkLink copied to clipboard!
You have now successfully created an unfiltered integration. To learn more about what you can do with your data, continue to Next steps for managing your costs. Do not follow the instructions in Creating a filtered Microsoft Azure integration.