Movatterモバイル変換


[0]ホーム

URL:


Skip to main content

This browser is no longer supported.

Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.

Download Microsoft EdgeMore info about Internet Explorer and Microsoft Edge
Table of contentsExit editor mode

Track costs associated with a lab in Azure DevTest Labs

Feedback

In this article

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.

Apply Cost Management for DevTest Labs

The process for using Cost Management for DevTest Labs includes four steps:

  1. Create tags and enable tag inheritance in the Azure portal.
  2. Apply the tags to your DevTest Labs resources.
  3. Provide permissions to allow users to view their resource costs.
  4. Use Cost Management to view and filter costs for your DevTest Labs resources, based on your tags.

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.

Create tags and enable tag inheritance

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:

Screenshot that shows that Tag inheritance is Enabled for Cost Management in the Azure portal.

Apply tags to DevTest Labs

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.

Screenshot that shows tags added for a DevTest Labs resource in the Azure portal.

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.

Provide permissions to view costs

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.

View and filter costs

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:

  1. In theAzure portal, go to your lab and select a resource group that has tags.

  2. In the left pane, expandCost Management and selectCost analysis.

  3. On theCost analysis page, in theView list, selectDaily Costs:

    Screenshot that shows how to view daily costs for resources in the Azure portal.

  4. On theCost Analysis page, expand theGroup By filter, selectTag, and then select one of your applied tags:

    Screenshot that shows how to change the Group by filter to show cost details based on 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.

Related content


Feedback

Was this page helpful?

YesNoNo

Need help with this topic?

Want to try using Ask Learn to clarify or guide you through this topic?

Suggest a fix?

  • Last updated on

In this article

Was this page helpful?

YesNo
NoNeed help with this topic?

Want to try using Ask Learn to clarify or guide you through this topic?

Suggest a fix?