AZCOST1B: Understand Monitoring and Tracking

Previously, you explored two methods to estimate costs using the Azure Pricing Calculator and the Pricing Details Page.

As you have surely noticed, when examining the details of the pricing pages, there are differences between the two calculations. One contains more detailed information about certain configuration charges but also requires a deeper technical understanding. If you feel overwhelmed by the various charges that may not be fully clear, do not worry; you are not alone. To help you gain more confidence in your calculations, we will review the charges that occur based on actual usage.

For this purpose, a sample solution has been created based on the design from the previous lab. Furthermore, we generated approximately more 50K requests directly to the API and the web interfaces so that you will have real costs data to explorer the capabilities of the „Cost Management + Billing“ (CMaB).

The Cost Management and Billing (CMaB) service is an essential tool that assists in monitoring, tracking, and comprehending the overall expenses as well as the charges applied by Azure:

  1. You can establish Budgets and configure budget alerts to stay informed about actual and projected costs.
  2. It allows you to generate intelligent alerts to notify you of any anomalies in your expenditure.
  3. It provides a detailed analysis of charges applied to specific resources (such as storage accounts named a, b, or c), services (such as storage, bandwidth), products, subscriptions, and other elements. This capability ultimately enables you and your colleagues to optimize expenses by identifying and eliminating cost drivers.

Needless to say, guarding and optimizing costs require your constant love and attention. In this lab, we will focus on these capabilities, especially the third point.

Although optimization potentials are discussed as well, we will not show or discuss it further but leave it for the next lab.

Exercise 1: Guarding costs explosion with Budgets and Budget Alerts

In this exercise, we will guide you through the process of creating Budgets and Budget Alerts. Although they are mentioned separately, as Azure does, it is not possible to have one without the other.

Hint: You will not be able to complete the creation process due to a lack of necessary permissions. The key takeaway from this exercise is that creating a budget is relatively straightforward yet provides significant benefits. It helps protect you from escalating costs.

However, please remember that it is a soft limit, meaning Azure will not automatically stop or deallocate your resources when the budget is exceeded. You can implement such a mechanism fairly easily if required.

  1. Open the Azure Portal by visiting https://portal.azure.com/#@draphony.de
  2. Type Budgets in the search box
  3. And select Budgets from the List.
    1. You should see the CMaB with Budget preselected.
    2. Notice that the scope is preselected based on your permissions and needs to be customized (in your real tenant.)
  4. Hit + Add to create a new Budget and enter in the following view
    1. Name: dx-quarterly-500k
    2. Reset period: Quarterly
    3. Leave Creation date and Expiration date as it is.
      • Hint: please be aware that the Budget / Budget Alert will just disappear after a few days after the experiration date silently. You won’t get a touchy good bye letters with a last chance to win it back.
    4. Amount: 500000
    5. Hit Next
      • Hint: in this exercise we just take the standard scope. You cannot change it in the Create bugdet view. You have to go back to the overview from step 3 and change the scope there and hit + Add again.
      • Hint: the Add filter allows you to narrow down resources, that should be considered. This is especially powerful if you have solution spanning across subscriptions or multiple products sharing the same subscriptions.
  5. In the Set alerts tab, we configure the Budget Alerts. You cannot skip this part, which is why we mentioned that Budget and Budget Alerts cannot exists without each other.
    1. For Alert conditions, you can enter a few Actual and Forecasted values like depicted in the following image
    2. Afterwards, select the recipient(s) and language of the alert
      • Having at least 2 recipients is recommended as one might be absence at a critical moment.
    3. Hit Create. This step will fail.

As you can see, you creating a Budget and Budget Alert is quite straight forward.

Show one of the trainers to check and get 5 points.

Exercise 2: Creating Cost Alerts

In this exercise, we will guide you through the process of creating Cost Alerts. While the Budget alerts is to guard your expenses against a preset limit, cost alerts helps you to detect anomalies or reservation low utilization. So they are „smarter“ than the Bugdet Alert.

  1. Open the Azure Portal by visiting https://portal.azure.com/#@draphony.de
  2. Type Cost Alerts in the search box
  3. And select Alert Costs from the List.
    1. You should see the CMaB with Cost alerts preselected.
    2. Notice that the scope is preselected based on your permissions and needs to be customized (in your real tenant). Cost alerts are not supported on Management Group level, so we need to change the scope. In this exercise we change it to subscription.
  4. Click on Scope: Root management group.
    1. In the menu select azu-dx-lza-fenidu
    2. Hit the Select this subscription button.
  5. Hit + Add in the overview to create a new cost alert.
    1. Just leave the rest as it is and hit Create
  6. You should still see an empty overview. Because this is an overview of triggered alerts. Meaning this is a list of any detection in the past not the rules itself. If you want to see the definition, hit Alert rules.

Show one of the trainer, to check get 5 points.

Exercise 3: Understanding Cost Meters

In this exercise, we will use the CMaB tools to gain a better understanding of the Azure charges and see how our calculation differs from the real charge so that we do it better going forward.

This is a more challenging part as you will experience a more technical analysis on the charges but it will help you greatly in optimization your cost. We will try to map all the charge meters to the 4 categoties Storage, Traffic, Provisioning and Operation as this will impact the optimization potentials.

It’s going to be tough to understand each an every meter and its meaning on a deeper level without a deep technical understanding, but for cost optimization and a higher level understanding this is not really necessary as most of the meters follow a certain convention:

  1. Storage-meters usually ends with Data stored
  2. Operations-meters usually ends with an operation name such as Hot Read Operations, Hot Write Operations
  3. Traffic-meters usually ends with Data transfer, also the Tier is in many cases Bandwidth
  4. Provisioning-meters usually ends with something including the SKU naming.

Task 1: Open the Cost analysis view

Hint: Please be aware, that there are various version of the Azure Portal, which is served to customers based on your tenant, your tenant configuration, your location and just good old luck.

In some versions (at the moment of writing, the draphony.de-tenant does served the author team this experience)

  1. Click on the Cost Management + Billing on the left navigation bar to open the corresponding blade.
  2. Click on Cost Management.
  3. Afterwards Azure will show another page. where you click on Cost analysis under Reporting + analytics.
  4. Make sure that you change the scope to Tenant Root Group

In some version (at the moment of writing, the draphony.com-tenant does served the author team this experience)

  1. Open the Cost Management + Billing Blade to access feature.
  2. Under Cost Management, click on Cost analysis
  3. At the top row click on Cost by resource and select Services. Azure will list all the services, that is in the Billing account.

In both version, you should end up in the same view at the end.

Hint: please be aware, that the Cost analysis view does not give you a real-time view of the costs. It takes somewhat between 24 – 48 hours for the charge to be listed.

image-20250427195037457

Task 2: Identify Storage-costs

Let’s try to find all the meters belongs to Storage costs.

  1. As the name already suggest, the Storage service mostlike will have a lot of meters belonging to Storage-costs. Let’s unfold it.

Assignment 1: Discuss within your group, which of the meters belongs to the category Storage. Please keep in mind that a resource might have multiple Storage-costs

Assignment 2: Take the solution design and discuss within your group, where those charges occurs and draw them in the solution design directly.

Each valid correct classification of the Meter is worth 1 point and correct placement in the design is worth 1 point.

Hint: Some of the entries are listed as $0€$ in the view. It does not mean that you are not charged. It’s just the cost are (very) low at the moment.

  1. If you click on Download.
  2. A new menu will slide in from the right. Choose Services with products
  3. Hit Download as Excel
  4. Open the file in excel and increase the decimal to see the actual charge.

Task 3: Identify Traffic-costs

In this task, we try to identify the Meters related to data traffic, which Azure charge. Usually those Meters ends with Ingress, Egress, Data Transfer, Transfer Out.

Traffic costs can be optimized by bringing the resources closer to the users unless you intentionally wants to benefit from lower provisioning cost or you are bound to certain compliance regulations.

  1. Assignment 1: Discuss within your group, which of the meters belongs to the category Traffic.
  2. Assignment 2: Take the solution design and discuss within your group, where those charges occurs and draw them in the solution design directly.

Each valid correct classification of the Meter is worth 1 point and correct placement in the design is worth 1 point.

    Task 4: Identify Provisioning-costs

    In this task, we try to identify Provisioning costs, which are costs that occurs independently from actual usage, transferring any data or storing anything. It is the cost, that Azure charge you for providing the services including deploying and allocating resources to make the service available for you to use. The costs varies greatly from your configuration. For instance, if you buy the premium or higher SKU of a resource, Azure will charge you more than it does if you go for the standard or lower SKU. Meters typically caries names likes D4s v4, D8s v4, Standard Fixed Cost, and so on.

    Provisioning costs can be reduced by leveraging the elastic scaling ability of Azure like using serverless compute (Azure Function), virtual machine scale sets and other auto scaling mechanism. It is crucial to understand, that you are no longer in an on-premise environment where you are encouraged to reserve some buffer when ordering new hardware as the process can take up to months. In the cloud deploying a virtual machine can be done in a few minutes to even seconds. Another saving potential is the dynamic upscaling. You can take a lower SKU and scale to higher SKU whenever needing. However, this does not apply to all resources. There are resources, where will not be charged for Provisioning-costs like Azure Functions, Event Grid, and so. Basically serverless and SaaS.

    It is also worth mentioning, that the Azure Advisor provides recommendation to reduce this cost category.

    1. Assignment 1: Discuss within your group, which of the meters belongs to the category Provisioning. Please keep in mind that a resource might have multiple Provionsing-costs
    2. Assignment 2: Take the solution design and discuss within your group, where those charges occurs and draw them in the solution design directly.

    Each valid correct classification of the Meter is worth 1 point and correct placement in the design is worth 1 point.

      Task 5: Identify Operation-costs

      For better understanding, let’s assume Facebook is Azure service, that you could deploy to create your very own Facebook service and everything your user does will be charge. An action like uploading a picture would involve the following costs:

      1. There is general charge for you because the service is available regardless whether no one use or half of world’s population does. This is the Provisioning-costs.
      2. There is the traffic charge for the picture to arrive at your service as data has to be transfered from the user’s machine to your Facebook servers. This is the Traffic-costs.
      3. After writing the photo on the disk, you will be charge because this picture consumes storage on hard disks. This is the Storage-costs.
      4. On top of that, because the user upload a picture, you will be charge for this particular user action (Operation-costs).

      As for the cost saving aspect, Operation-costs are charged for the actual usage. Just to be clear. The pricing model of Azure does not charge for any possible operations! Some are considered key indicators for usage and therefore charged. Remaining parts are included or already covered by Traffic, Provisioning or Storage-charge. Usually, for PaaS, serverless and especially SaaS you have no/less Povisioning-cost but Operation-costs instead. Whereas, you have Provisioning-costs for IaaS but lower/no Operation costs. And basically this is the key for cost saving. If you have spikes and inconsistencies in workload during a period of time, you benefit from Azure resources with Operation-costs. If your workload is consistently high, you are more likely to benefit from Azure resources with Provisioning-costs. Some resources also allows you to switch the SKU so that you pay Provisioning-costs instead of Operation-costs and vicecera.

      And in this last task, we will identify the Operation costs, that occurs when ever you perform a operation against a resource.

      1. Assignment 1: Discuss within your group, which of the meters belongs to the category Operation. Please keep in mind that a resource might have multiple Operation-costs
      2. Assignment 2: Take the solution design and discuss within your group, where those charges occurs and draw them in the solution design

      Each valid correct classification of the Meter is worth 1 point and correct placement in the design is worth 1 point.

      Authors

      • Azure

      Newsletter zu Aktionen

      Trage dich ein um keine Aktionen von uns zu verpassen.
      Wir senden 1-2 E-Mails pro Quartal.