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!
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!
Hi @olegarr ,
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
@AndreasBaumgarten Baumgarten,
Thanks a lot! Exactly what I needed... for some reason I missed something when tried myself ;-)
Thank you!
20 people are following this question.