Skip to content

Commit 3a73a09

Browse files
committed
update DTL Cost Management doc
1 parent f9590ac commit 3a73a09

File tree

10 files changed

+36
-64
lines changed

10 files changed

+36
-64
lines changed
Lines changed: 36 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,94 +1,66 @@
11
---
22
title: View the monthly estimated lab cost trend
3-
description: This article provides information on how to track the cost of your lab (monthly estimated cost trend chart) in Azure DevTest Labs.
3+
description: This article provides information on how to track the cost of your lab through Azure Cost Management
44
ms.topic: how-to
55
ms.author: rosemalcolm
66
author: RoseHJM
7-
ms.date: 06/26/2020
7+
ms.date: 02/16/2024
88
ms.custom: UpdateFrequency2
99
---
1010

1111
# Track costs associated with a lab in Azure DevTest Labs
12-
This article provides information on how to track the cost of your lab. It shows you how to view the estimated cost trend for the current calendar month for the lab. The article also shows you how to view month-to-date cost per resource in the lab.
12+
This article provides information on how to track the cost of your lab through [Azure Cost Management](../cost-management-billing/cost-management-billing-overview) by applying tags to the DevTest Lab to filter costs. DevTest Labs may create additional resource groups for resources related to the lab (depending on the features used and the settings of the lab). For this reason, it’s often not straightforward to get a view of the total costs for a lab just by looking at Resource Groups. To create a single view of costs per lab, tags are used.
1313

14-
## View the monthly estimated lab cost trend
15-
In this section, you learn how to use the **Monthly Estimated Cost Trend** chart to view the current calendar month's estimated cost-to-date and the projected end-of-month cost for the current calendar month. You also learn how to manage lab costs by setting spending targets and thresholds that, when reached, trigger DevTest Labs to report the results to you.
14+
## Steps to Leverage Cost Management for DevTest Labs
1615

17-
To view the Monthly Estimated Cost Trend chart, follow these steps:
16+
These are the steps needed to leverage cost management for DevTest Labs, more details are captured below.
17+
1. Enable tag inheritance for costs
18+
1. Apply tags to the DevTest Labs (cost center, business unit, etc)
19+
1. Provide permissions to allow users to view costs
20+
1. Use Azure Cost Management for viewing/filtering costs for DevTest Labs, based on the tags
1821

19-
1. Sign in to the [Azure portal](https://portal.azure.com).
20-
2. Select **All Services**, and then select **DevTest Labs** from the list.
21-
3. From the list of labs, select your lab.
22-
4. Select **Configuration and policies** on the left menu.
23-
4. Select **Cost trend** in the **Cost tracking** section on the left menu. The following screenshot shows an example of a cost chart.
24-
25-
![Screenshot that shows a cost chart.](./media/devtest-lab-configure-cost-management/graph.png)
22+
## Step 1: Enable Tag Inheritance for Tags on Resource Groups
2623

27-
The **Estimated cost** value is the current calendar month's estimated cost-to-date. The **Projected cost** is the estimated cost for the entire current calendar month, calculated using the lab cost for the previous five days.
24+
When DevTest Labs creates [environments](devtest-lab-create-environment-from-arm.md), these are each placed in their own resource group. To ensure that the DevTest Lab tags flow down (for billing purposes) from the resource group to the resources, it’s required to enable tag inheritance.
2825

29-
The cost amounts are rounded up to the next whole number. For example:
26+
This can be done either with billing properties OR via Azure Policies. The first method (billing properties) is the easiest & fastest if it doesn’t affect billing reporting for other resources in the same subscription.
3027

31-
* 5.01 rounds up to 6
32-
* 5.50 rounds up to 6
33-
* 5.99 rounds up to 6
28+
- [Group and allocate costs using tag inheritance](../cost-management-billing/costs/enable-tag-inheritance)
29+
- [Use the “Inherit a tag from the resource group” Azure Policy](../azure-resource-manager/management/tag-policies)
3430

35-
As it states above the chart, the costs you see by default in the chart are *estimated* costs using [Pay-As-You-Go](https://azure.microsoft.com/offers/ms-azr-0003p/) offer rates. You can also set your own spending targets that are displayed in the charts by [managing the cost targets for your lab.](#managing-cost-targets-for-your-lab)
31+
If updated correctly using the first method above, you will see that Tag Inheritance now shows **Enabled**:
3632

37-
The following costs *aren't* included in the cost calculation:
33+
![Screenshot that shows Tag Inheritance is enabled.](media/devtest-lab-configure-cost-management/tag-inheritance.png)
3834

39-
* CSP and Dreamspark subscriptions currently aren't supported. Azure DevTest Labs uses the Azure billing APIs to calculate the lab cost, which doesn't support CSP or Dreamspark subscriptions.
40-
* Your offer rates. Currently, you can't use the offer rates shown under your subscription that you've negotiated with Microsoft or Microsoft partners. Only Pay-As-You-Go rates are used.
41-
* Your taxes
42-
* Your discounts
43-
* Your billing currency. Currently, the lab cost is displayed only in USD currency.
35+
## Step 2: Apply Tags to DevTest Labs
4436

45-
### Managing cost targets for your lab
46-
DevTest Labs helps you manage your lab costs by setting a spending target that you can view in the Monthly Estimated Cost Trend chart. DevTest Labs can send you a notification when spending reaches the specified target threshold.
37+
DevTest Labs automatically propagates tags applied at the lab level to the resources that are created by the lab. This includes virtual machines (tags are applied to the billable resources) and environments (tags are applied to the resource group for the environment). Follow the steps in this article to apply tags to your labs: [Add tags to a lab](devtest-lab-add-tag.md).
4738

48-
1. On the **Cost trend** page, select **Manage target**.
39+
![Screenshot that shows tags in DevTest Labs in the Azure portal.](media/devtest-lab-configure-cost-management/devtest-tags.png)
4940

50-
![Screenshot that shows the Manage target button.](./media/devtest-lab-configure-cost-management/cost-trend-manage-target.png)
51-
2. On the **Manage target** page, specify a spending target and thresholds. You can also set whether each selected threshold is reported on the cost trend chart or through a webhook notification.
41+
It’s important to remember that tags are propagated for any resources created _after_ the tag has been applied to the DevTest Lab. If there are _existing resources_ that must be updated with the new tags, there is a script available to propagate the new/updated tags correctly. If you have existing resources and want to apply the lab tags, please use the [Update-DevTestLabsTags script located in the DevTest Labs GitHub Repo](https://github.com/Azure/azure-devtestlab/tree/phauge/update-dtl-tags/samples/DevTestLabs/Scripts/UpdateDtlTags).
5242

53-
![Screenshot that shows the Manage target pane.](./media/devtest-lab-configure-cost-management/cost-trend-manage-target-pane.png)
43+
## Step 3: Provide permissions to allow users to view costs
5444

55-
- Select a time period during which you want cost targets tracked.
56-
- **Monthly**: cost targets are tracked per month.
57-
- **Fixed**: cost targets are tracked for the date range you specify in the start and end dates. Typically, these values represent how long your project is scheduled to run.
58-
- Specify a **Target cost**. For example, how much you plan to spend on this lab in the time period you defined.
59-
- Select to enable or disable any threshold you want reported – in increments of 25% – up to 125% of your specified **Target cost**.
60-
- **Notify**: When results meet this threshold, a webhook URL that you specify notifies you.
61-
- **Plot on chart**: When results meet this threshold, the results plot on a cost trend graph that you can view.
62-
- If you choose to **Notify** when the threshold is met, you must specify a webhook URL. In the Cost integrations area, select **Click here to add an integration**. Enter a **Webhook URL** in the Configure notification pane and then select **OK**.
45+
DevTest Labs users don’t automatically have permission to view costs for their resources via Cost Management. There is an additional step to [enable users to view billing information](../cost-management-billing/costs/assign-access-acm-data#assign-billing-account-scope-access), which is to assign the _Billing Reader_ permission to users at the subscription level (if they don’t already have permissions that include Billing Reader access). More information is found here on managing access to billing information: [Manage access to Azure billing - Microsoft Cost Management](../cost-management-billing/manage/manage-billing-access)
6346

64-
![Screenshot that shows the Configure notification pane.](./media/devtest-lab-configure-cost-management/configure-notification-new.png)
47+
## Step 4: Use Azure Cost Management for viewing/filtering costs for DevTest Labs
6548

66-
- If you specify **Notify**, you must define a webhook URL.
67-
- Likewise, if you define a webhook URL, you must set **Notification** to **On** in the Cost threshold pane.
68-
- Create the webhook before you enter it here.
49+
Now that DevTest Labs has been configured to provide the lab-specific information for Cost Management, please start here on Cost Management Reporting to view costs: Get started with [Cost Management reporting - Azure - Microsoft Cost Management](../cost-management-billing/costs/reporting-get-started). You can visualize the costs in the Azure Portal, download cost reporting information, or use PowerBI to visualize the costs.
6950

70-
For more information about webhooks, see [Create a webhook or API Azure Function](../azure-functions/functions-bindings-http-webhook.md).
51+
For a quick view of costs per lab, please follow the following steps:
7152

72-
## View cost by resource
73-
The monthly cost trend feature in labs allows you to see how much you spent in the current calendar month. The feature also shows your spending projection until the end of the month, based on your spending in last seven days. To help you understand why the spending in the lab is meeting thresholds early on, you can use the **cost by resource** feature that shows you the month-to-date cost **per resource** in a table.
53+
1. Select **Cost Management** and then on **Cost analysis**
54+
1. Select **Daily Costs**
55+
![Screenshot that shows the daily costs card](media/devtest-lab-configure-cost-management/devtest-tags.png)
56+
1. On the **Custom: Cost Analysis** page, select the **Group By** filter, choose **Tag** and then the Tag Name (like “CostCenter”) to group by
57+
![Screenshot that shows searching for tag in the group by filter](media/devtest-lab-configure-cost-management/tag.png)
7458

75-
1. Sign in to the [Azure portal](https://portal.azure.com).
76-
2. Select **All Services**, and then select **DevTest Labs** from the list.
77-
3. From the list of labs, select the lab you want.
78-
4. Select **Configuration and policies** on the left menu.
79-
5. Select **Cost by resource** in the **Cost tracking** section on the left menu. You see the costs associated with each resource associated with a lab.
59+
The resulting view will show costs in the subscription grouped by the ‘tag’ (which is grouping by the lab & it’s resources).
8060

81-
![Screenshot that shows Cost by resource.](./media/devtest-lab-configure-cost-management/cost-by-resource.png)
61+
## Related content
8262

83-
This feature helps you to easily identify the resources that cost the most so you can take actions to reduce the lab spending. For example, the cost of a VM is based on the size of the VM. The larger the size of the VM, the more it costs. You could find the size of a VM and the owner, and talk to the owner about why they need the VM size and whether they can lower the size.
84-
85-
[Auto shutdown policy](devtest-lab-set-lab-policy.md?#set-auto-shutdown-policy) helps you to reduce the cost by shutting down lab VMs at a particular time of the day. However, a lab user can opt out of the shutdown policy, which increases the cost of running the VM. Select a VM in the table to see if it's been opted-out of the auto shutdown policy. Talk to the VM owner to find out why they opted out, and see if they can opt back in.
86-
87-
## Next steps
88-
Here are some things to try next:
89-
90-
* [Define lab policies](devtest-lab-set-lab-policy.md). Learn how to set the various policies used to govern how your lab and its VMs are used.
91-
* [Create custom image](devtest-lab-create-template.md). When you create a VM, you specify a base. The base can be either a custom image or a Marketplace image. This article describes how to create a custom image from a VHD file.
92-
* [Configure Marketplace images](devtest-lab-configure-marketplace-images.md). DevTest Labs supports creating VMs based on Azure Marketplace images. This article
93-
illustrates how to specify Azure Marketplace images you can use when creating VMs in a lab.
94-
* [Create a VM in a lab](devtest-lab-add-vm.md). This article illustrates how to create a VM from a custom or Marketplace base image, and work with artifacts in the VM.
63+
- [Define lab policies](devtest-lab-set-lab-policy.md). Learn how to set the various policies used to govern how your lab and its VMs are used.
64+
- [Create custom image](devtest-lab-create-template.md). When you create a VM, you specify a base. The base can be either a custom image or a Marketplace image. This article describes how to create a custom image from a VHD file.
65+
- [Configure Marketplace images](devtest-lab-configure-marketplace-images.md). DevTest Labs supports creating VMs based on Azure Marketplace images. This article illustrates how to specify Azure Marketplace images you can use when creating VMs in a lab.
66+
- [Create a VM in a lab](devtest-lab-add-vm.md). This article illustrates how to create a VM from a custom or Marketplace base image, and work with artifacts in the VM.
7.45 KB
Loading
154 KB
Loading
Binary file not shown.
43 KB
Loading
18.1 KB
Loading

0 commit comments

Comments
 (0)