Skip to content

How to fetch the Cost/Month for the VMSize using AZ Powershell? #14193

Answered by dingmeng-xue
AviKrish asked this question in Q&A
Discussion options

You must be logged in to vote

@AviKrish , you can try below cmdlet from Az.CostManagement to get cost on resource group level.

Invoke-AzCostManagementQuery -Scope "/{sub}/resourceGroups/{rg}" -Timeframe YearToDate  -type Usage -DatasetGranularity 'Daily'

Install Az.CostManagement via Install-Module Az.CostManagement -Repository PSGallery

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by dcaro
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
Consumption - Query All issues in cost management and Consumption for query API associated to tags, dimensions and forec
2 participants