Search

Chapter 1. Creating a Microsoft Azure integration

download PDF

Configure your Microsoft Azure account to allow cost management access.

Configuring your Microsoft Azure account to be a cost management integration requires:

  1. Creating a storage account and resource group
  2. Choosing the appropriate scope for your cost export
  3. Configuring a Storage Account Contributor and Reader roles for access
  4. Scheduling daily cost exports

Because third-party products and documentation can change, instructions for configuring the third-party integrations provided are general and correct at the time of publishing. For the most up-to-date information, see the Microsoft Azure documentation.

Important

If you are using RHEL metering, you must use the following steps to set up your account. You cannot use the steps to filter your data in Filtering your Microsoft Azure data before integrating it into cost management. 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.

Add your Microsoft Azure integration to cost management from the Integrations page.

1.1. Adding a Microsoft Azure account and naming your integration

Add your Microsoft Azure account as an integration so cost management can process the cost and usage data.

Procedure

  1. From Red Hat Hybrid Cloud Console, click Settings Menu Settings icon > Integrations.
  2. On the Settings page, in the Cloud tab, click Add integration.
  3. Click Add integration.
  4. In the Add a cloud integration wizard, select Microsoft Azure as the cloud provider type and click Next.
  5. Enter a name for your integration and click Next.
  6. In the Select application step, select Cost management and click Next.
  7. In the Specify cost export scope step, select I am OK with sending the default data to Cost Management.
  8. Select the scope of your cost data export from the menu. You can export data at the subscription level or other scopes in your subscription.

    1. Copy the generated command for the scope that you selected.
    2. In your Microsoft Azure account, click Cloud Shell and paste and run the command that you copied from the earlier step.
  9. In the Add a cloud integration wizard, paste the returned value from Microsoft Azure into the Cost export scope field on the Specify cost export scope step.
  10. Click Next.

1.2. Creating a Microsoft Azure resource group and storage account

Create a storage account in Microsoft Azure to house the cost data and metrics and a storage account to house your filtered cost data that cost management will collect. In the Add a cloud integration wizard in cost management, enter the resource group name and storage account name in the fields in the Resource group and storage account page.

Prerequisites

You must have a Red Hat user account with Cloud Administrator entitlements.

Procedure

  1. In your Microsoft Azure account, search for storage and click Storage accounts.
  2. On the Storage accounts page, click Create.
  3. On the Create a storage account page, in the Resource Group field, click Create new. Enter a name, and click OK. In this example, use cost-data-group.
  4. In the instance details section, enter a name in the Storage account name field. In this example, use costdata.
  5. Copy the names of the resource group and storage account so you can add them to the Add a cloud integration wizard in Red Hat Hybrid Cloud Console and click Review.
  6. Review the storage account and click Create.
  7. In the Red Hat Hybrid Cloud Console Add a cloud integration wizard, on the Resource group and storage account page, enter values in the Resource group name and Storage account name.
  8. Click Next.

1.3. Configuring a daily Microsoft Azure data export schedule

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:

  1. In the search bar, enter "cost exports" and click the result.
  2. Click Create.
  3. Under Select a template, click Cost and usage (actual) to export your standard usage and purchase charges.
  4. Follow the steps in the Azure wizard.

    • Select the correct subscription and Storage account that you created in the previous sections' steps.
  5. Review the information and click Create.

In cost management:

  1. Return to the Add a cloud integration wizard and complete the steps in Daily export.
  2. Click Next when you finish creating the export schedule. You will continue using the wizard in the following sections.

For more help with creating exports in Azure, see Microsoft’s documentation.

1.4. Finding your Microsoft Azure subscription ID

Find your subscription_id in the Microsoft Azure Cloud Shell and add it to the Add a cloud integration wizard in cost management.

Procedure

  1. In your Microsoft Azure account, click Cloud Shell.
  2. Enter the following command to obtain your Subscription ID:

    az account show --query "{subscription_id: id }"
  3. Copy the value for the subscription_id from the returned data.

    Example response

    {
        "subscription_id": 00000000-0000-0000-000000000000
        }

  4. Paste that value in the Subscription ID field on the Subscription ID page in the Add a cloud integration wizard.
  5. Click Next.

1.5. Configuring Microsoft Azure roles

To grant Red Hat access to your data, you must configure dedicated roles in Microsoft Azure. If you already created a service principal in Microsoft Azure, do not create another one, skip to step 4 and use it to share your Tenant (Directory) ID, Client (Application) ID, and Client secret values with cost management.

Procedure

  1. In the Add a cloud integration wizard, on the Roles page, copy the az ad sp create-for-rbac command from the wizard to create a service principal with the Cost Management Storage Account Contributor role.
  2. In your Microsoft Azure account, click Cloud Shell.
  3. Paste the command you copied in the previous step in the cloud shell prompt.
  4. Copy the Tenant (Directory) ID, Client (Application) ID, and Client secret values and paste the values on the Roles page of the Add a cloud integration wizard.
  5. Copy the second generated az role assignment create command from the wizard and paste it in the cloud shell prompt in Microsoft Azure to create a Cost Management Reader role.
  6. In the Add a cloud integration wizard, click Next.
  7. Review the information you provided in the wizard and click Add.
Red Hat logoGithubRedditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

© 2024 Red Hat, Inc.