Azure for Architects
上QQ阅读APP看书,第一时间看更新

Understanding billing

Azure is a service utility that has the following features:

No upfront costs

No termination fees

Billing per second, per minute, or per hour depending on the type of resource

Payment based on consumption-on-the-go

In such circumstances, it is very difficult to estimate the upfront cost of consuming Azure resources. Every resource in Azure has its own cost model and charge based on storage, usage, and time span. It is very important for management, administration, and finance departments to keep track of usage and costs. Azure provides usage and billing reporting capabilities to help upper management and administrators generate cost and usage reports based on multiple criteria.

The Azure portal provides detailed billing and usage information through the Cost Management + Billing feature, which can be accessed from the master navigation blade, as shown in Figure 6.1:

Cost Management + Billing
Figure 6.1: Cost Management + Billing service in the Azure portal

Please note that if your billing is managed by a CSP, you will not have access to this feature. CSP customers can view their costs in the pay-as-you-go scheme if they transition their CSP legacy subscriptions to the Azure plan. We will discuss the Azure plan and the Modern Commerce platform later in the chapter.

Cost Management + Billing shows all the subscriptions and the billing scopes you have access to, as shown in Figure 6.2:

Billing details of all listed user subscriptions
Figure 6.2: Billing overview of user subscriptions

The Cost Management section has several blades, such as:

Cost analysis for analyzing the usage of a scope.

Budgets for settings budgets.

Cost alerts for notifying administrators when the usage exceeds a certain threshold.

Advisor recommendations for getting advice on how to make potential savings. We will discuss Azure Advisor in the last section of this chapter.

Exports for automating usage exports to Azure Storage.

Cloudyn, which is a tool used by CSP partners to analyze costs, as they don't have access to Cost Management.

Connectors for AWS for connecting your AWS consumption data to Azure Cost Management.

The different options available in Azure Cost Management are shown in Figure 6.3:

List of services in the Azure Cost Management section in the Azure portal
Figure 6.3: Cost Management overview

Clicking on the Cost analysis menu on this blade provides a comprehensive interactive dashboard, using which cost can be analyzed with different dimensions and measures:

Analysing subscription costs through the Cost Analysis option
Figure 6.4: Analyzing subscription costs through the Cost analysis option

The dashboard not only shows the current cost but also forecasts the cost and breaks it down based on multiple dimensions. Service name, Location, and Resource group name are provided by default, but they can be changed to other dimensions as well. There will be always a scope associated with every view. Some of the available scopes are billing account, management group, subscription, and resource group. You can switch the scope depending on the level you want to analyze.

The Budget menu on the left allows us to set up the budget for better cost management and provides alerting features in case the actual cost is going to breach the budget estimates:

Creating a budget alert for cost management
Figure 6.5: Creating a budget

Cost Management also allows us to fetch cost data from other clouds, such as AWS, within the current dashboards, thereby managing costs for multiple clouds from a single blade and dashboard. However, this feature is in preview at the time of writing. This connector will become chargeable after August 25, 2020.

You need to fill in your AWS role details and other details to pull the cost information, as shown in Figure 6.5. If you are unsure how to create the policy and role in AWS, refer to https://docs.microsoft.com/azure/cost-management-billing/costs/aws-integration-set-up-configure#create-a-role-and-policy-in-aws:

Creating a connector to bring AWS cost and usage report data into Azure Cost Management
Figure 6.6: Creating an AWS connector in Cost Management

The cost reports can also be exported to a storage account on a scheduled basis.

Some of the cost analysis is also available in the Subscriptions blade. In the Overview section, you can see resources and their cost. Also, there is another graph, where you can see your current spend, forecast, and balance credit (if you are using a credit-based subscription).

Figure 6.7 shows cost information:

Overview of costs by resource for the subscription
Figure 6.7: Cost analysis for the subscription

Clicking on any of the costs in Figure 6.7 will redirect you to the Cost ManagementCost Analysis section. There are a lot of dimensions in Cost Management with which you can group the data for analysis. The available dimensions will vary based on the scope you have selected. Some of the commonly used dimensions are as follows:

Resource types

Resource group

Tag

Resource location

Resource ID

Meter category

Meter subcategory

Service

At the beginning of the chapter, we said that tags can be used for cost management. For example, let's say you have a tag called Department with values of IT, HR, and Finance. Tagging the resources appropriately will help you understand the cost incurred by each department. You can also download the cost report as a CSV, Excel, or PNG file using the Download button.

Additionally, Cost Management supports multiple views. You can create your own dashboard and save it. EA customers get the added benefit of the Cost Management connector or Power BI. With the connector, users can pull the usage statistics to Power BI and create visualizations.

Up to this point, we have been discussing how we can keep track of our usage using Cost Management. In the next section, we will explore how invoicing works for the services we have used.