Search

Chapter 1. Creating a Microsoft Azure integration: Basic

download PDF
Important

If you want to create an Azure integration by using the advanced path, do not complete the following steps. Instead, go to Creating a Microsoft Azure integration: Advanced.

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:

  1. Create a storage account and resource group
  2. Choose the appropriate scope for your cost export
  3. Configure a Storage Account Contributor and Reader roles for access
  4. 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. Adding a Microsoft Azure account

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:

  1. Click Settings Menu Settings icon > Integrations.
  2. In the Cloud tab, click Add integration.
  3. In the Add a cloud integration wizard, select Microsoft Azure and click Next.
  4. Enter a name for your integration and click Next.
  5. In the Select application step, select Cost management and click Next.
  6. 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.
  7. 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.
  8. Copy the command that is generated.

In your Microsoft Azure account:

  1. Click Cloud Shell and run the command that you copied from cost management. Copy the returned value.

In cost management:

  1. In the Specify cost export scope step, paste the value that you copied from Microsoft Azure into Cost export scope.
  2. Click Next.

You will continue using the wizard in the following sections.

1.2. Creating a Microsoft Azure resource group and storage account

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:

  1. 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 Instance details, 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 that you can add them to Red Hat Hybrid Cloud Console later.
  6. Click Review.
  7. Review the storage account and click Create.

In cost management:

  1. 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.
  2. Click Next.

You will continue using the wizard in the following sections.

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.
    • You must set Format to CSV.
    • Set Compression type to None or Gzip.
  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.

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.

In your Microsoft Azure account:

  1. Click Cloud Shell.
  2. Enter the following command to get your Subscription ID:

    az account show --query "{subscription_id: id }"
  3. Copy the value that is generated for subscription_id.

    Example response

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

In cost management:

  1. In the Subscription ID field of the Add a cloud integration wizard, paste the value that you copied in the previous step.
  2. Click Next.

You will continue using the wizard in the following sections.

1.5. Creating Microsoft Azure roles for Red Hat access

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:

  1. 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:

  1. Click Cloud Shell.
  2. In the cloud shell prompt, paste the command that you copied.
  3. 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"
    }

In cost management:

  1. Return to the Add a cloud integration wizard and paste the values that you copied into their corresponding fields on the Roles page.
  2. Copy the second az role assignment command that is generated from the wizard.

In your Microsoft Azure account:

  1. Return to the cloud shell prompt and paste the command to create a Cost management reader role.

In cost management:

  1. Return to the Add a cloud integration wizard and click Next.
  2. Review the information that you provided and click Add.

1.6. Viewing your data

You have now successfully created your basic 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 Microsoft Azure integration: Advanced.

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.