Azure Powershell Resource Group Cost

Oleg Aronov 106 Reputation points
2022-01-27T22:16:21.447+00:00

Hello:

Is there a way to get the Cost of single Azure Resource Group (only) via PowerShell? Of course, the cost should include the cost of all resources in this RG...

Thank you!

Azure
Azure
A cloud computing platform and infrastructure for building, deploying and managing applications and services through a worldwide network of Microsoft-managed datacenters.
952 questions
Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,382 questions
0 comments No comments
{count} votes

Accepted answer
  1. Andreas Baumgarten 96,606 Reputation points MVP
    2022-01-29T01:11:50.173+00:00

    Hi @Oleg Aronov ,

    maybe this is helpful.

    You need to install and import the Az PowerShell module for this.

    # All information  
    Get-AzConsumptionUsageDetail -ResourceGroup "demo-rg" -StartDate 2021-12-01 -EndDate 2022-01-27 |  Select-Object *  
      
    #  Just some details  
    Get-AzConsumptionUsageDetail -ResourceGroup "demo-rg" -StartDate 2022-01-01 -EndDate 2022-01-27 | Select-Object InstanceName, Currency, PretaxCost | Sort-Object -Property PretaxCost -Descending  
    

    ----------

    (If the reply was helpful please don't forget to upvote and/or accept as answer, thank you)

    Regards
    Andreas Baumgarten

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful