Red Hat blog
Blog menu
Cost Management on the Red Hat Hybrid Cloud Console has improved its integration with Microsoft Azure making it easier than ever to view the cost of running Red Hat OpenShift deployed on Azure.
While Cost Management has supported Microsoft Azure for some time, the latest update now extends support for Azure’s Cost Management scopes. With these new capabilities you can choose the level of integration your organization has with Red Hat’s Cost Management service. This allows you to isolate down to as small as a single Resource Group where the OpenShift cluster is deployed or share as broadly as an entire Billing Account.
Previously, cost data was shared at the Microsoft Azure subscription level, which for some organizations may be broader than they would like. Alternatively, you may have a Billing Account with thousands of subscriptions, and registering all of those would have been too tedious. Cost Management scopes make it easier to cover any point in that spectrum. Once defined appropriately, the Cost Management service can begin consuming that cost data correlating it with the metrics from the Cost Management Metrics Operator installed on the OpenShift cluster.
Working with Cost Management Scopes
Red Hat’s Cost Management service is configured by creating new Sources on the Hybrid Cloud Console. Within the Sources application, you are directed through a wizard to connect your cloud provider to the Cost Management service. You can also read the complete details in the product documentation.
Creating an Azure Source

As part of the wizard flow, you will provide a name for your Azure source, then you will select the Cost Management application.

Setting up a Cost Export for the desired scope
The next step of the wizard has you provide the Cost Management scope for the cost export that will be consumed. If you launch the Azure Portal and search for Cost Management + Billing, this will navigate you to the service where you can create a scheduled export.

In the left navigation you will see Exports under Settings towards the bottom of the panel.

Lastly, when stepping through the setup process, you need to choose the appropriate scope with the Scope Chooser.

Within the wizard you can select the appropriate scope from a dropdown menu. The choices include Subscription, Resource Group, Management Group, Billing Account, Billing Profile, Invoice Section and Enrollment Account. Based on the scope selection, you are presented with an Azure CLI command that you can copy and paste into the Azure Cloud Shell. Some commands require you to provide parameters replacing the placeholder text.

As you progress through the wizard, you will set up the storage location for the export and schedule the daily export. You will also have to specify the name of the export.

Completing the Source configuration
As you complete the setup, you will be given the Azure subscription identifier where the export will be stored, and set up a service principal with Reader access to the storage account and the Cost Management APIs. Azure Cloud Shell steps are also provided, but, for higher level scopes like Billing Account, Billing Profile, Invoice Section and Enrollment Account, you must use the Azure Portal to assign the appropriate Reader privilege.

With the Source configured, it can take up to 24 hours for Microsoft Azure to create the cost export and for Red Hat’s Cost Management to consume this new data. With the Azure data in place, the underlying infrastructure cost is available, so the Cost Management Metrics Operator just needs to be installed on the cluster. The operator uploads metrics data to console.redhat.com, allowing the service to correlate the virtual machine (VM) instances to the OpenShift nodes and then proportionally assign costs to the projects based on usage and requests.

Get started today
It's now easier than ever to visualize the cost of running your OpenShift cluster on Azure either self-deployed or using Microsoft Azure Red Hat OpenShift.
Based on your organizational needs, you can either isolate the shared data to a minimal set, or you can set up your enterprise at a higher scope, minimizing the need for future Azure source configuration. Cost Management provides you with greater visibility into your project cost and the associated cloud services being utilized so you can get a full picture of the technical costs. Login to console.redhat.com to get started.
About the author
Chris Hambridge started his software engineering career in 2006 and joined Red Hat in 2017. He has a Masters in Computer Science from the Georgia Institute of Technology, and is passionate about cloud-native development and DevOps with a focus on pragmatic solutions to everyday problems.