
In the previous chapter, we discussed tags, policies, and locks and how they can be leveraged from a compliance standpoint. Tags allow us to add metadata to our resources; they also help us in the logical management of resources. In the Azure portal, we can filter resources based on tags. If we assume there is a large number of resources, which is quite common in enterprises, filtering will help us to easily manage our resources. Another benefit of tags is that they can be used to filter our billing reports or usage reports in terms of tags. In this chapter, we are going to explore cost management for Azure solutions.
The primary reason why corporations are moving to the cloud is to save on cost. There is no upfront cost for having an Azure subscription. Azure provides a pay-as-you-go subscription, where billing is based on consumption. Azure measures resource usage and provides monthly invoices. There is no upper limit for Azure consumption. As we are on a public cloud, Azure (like any other service provider) has some hard and soft limits on the number of resources that can be deployed. Soft limits can be increased by working with Azure Support. There are some resources that have a hard limit. The service limits can be found at https://docs.microsoft.com/azure/azure-resource-manager/management/azure-subscription-service-limits, and the default limit varies based on the type of subscription you have.
It is important for companies to keep a close watch on Azure consumption and usage. Although they can create policies to set organizational standards and conventions, there is also a need to keep track of billing and consumption data. Moreover, they should employ best practices for consuming Azure resources so that the return is maximized. For this, architects need to know about Azure resources and features, their corresponding costs, and the cost/benefit analysis of features and solutions.
In this chapter, we will cover the following topics:
Azure offer details
Billing
Invoicing
Usage and quotas
Usage and Billing APIs
Azure pricing calculator
Best practices for cost optimization
Let's go ahead and discuss each of these points.