This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Note
Access to this page requires authorization. You can trysigning in orchanging directories.
Access to this page requires authorization. You can trychanging directories.
This article provides information on how to track the cost of your lab by applying tags to the lab to filter costs so that you can useMicrosoft Cost Management.
DevTest Labs can create extra resource groups for resources related to your lab. The number of resource groups created depends on the features used by the lab and their settings. Because of the extra resource groups, it's not always easy to get a view of the total costs for your lab just by looking atResource groups in the Azure portal. To create a single view of costs per lab in the Azure portal, you can use resource groupTags.
The process for using Cost Management for DevTest Labs includes four steps:
You might create tags to allow users to track billed charges by cost center, business unit, team project, and so on.
The details for these steps are described in the following sections.
When DevTest Labs createsenvironments, it places each environment in its own resource group. For billing purposes, you must enable tag inheritance to ensure the lab tag definitions flow down from the resource group to the resources.
You can enable tag inheritance by using billing properties or by using Azure Policy. The billing properties method is the easiest and fastest. However, it might affect billing reporting for other resources in the subscription.
The following articles describe how to create tags and enable tag inheritance:
If the lab is updated correctly by using the billing properties method, you can see thatTag inheritance isEnabled on the Cost ManagementConfiguration page:
DevTest Labs automatically propagates tags applied at the lab level to resources created by the lab. For virtual machines, tags are applied to the billable resources. For environments, tags are applied to the resource group for the environment. To apply tags to your labs, complete the steps inAdd tags to a lab.
Note
After you apply a new tag to your lab, the tag is automatically applied to new lab resources when they're created. If you want to apply a new or updated tag to existing resources, you can use a script to propagate the tag correctly. Use theUpdate-DevTestLabsTags script that's in the DevTest Labs GitHub repository.
DevTest Labs users don't automatically have permission to view costs for their resources by using Cost Management. To add the permissions, follow the instructions inenable users to view billing information. Assign theBilling Reader permission to users at the subscription level, if they don't already have permissions that include Billing Reader access.
For more information, seeManage access to Azure billing.
After DevTest Labs is configured to provide the lab-specific information for Cost Management, you're ready to get started withCost Management reporting. You can visualize the costs in the Azure portal, download cost reporting information, or use Power BI to visualize the costs.
For a quick view of costs per lab, complete these steps:
In theAzure portal, go to your lab and select a resource group that has tags.
In the left pane, expandCost Management and selectCost analysis.
On theCost analysis page, in theView list, selectDaily Costs:
On theCost Analysis page, expand theGroup By filter, selectTag, and then select one of your applied tags:

The updated view shows costs in the subscription grouped by the tag according to the lab resources. For more information, seeGroup and filter options in Cost Analysis and Budgets.
Was this page helpful?
Need help with this topic?
Want to try using Ask Learn to clarify or guide you through this topic?
Was this page helpful?
Want to try using Ask Learn to clarify or guide you through this topic?