Forum Discussion
romanazurelabit
Oct 02, 2024Copper Contributor
How to export the monthly cost summary for all the azure subscriptions in tenant? (automated)
Hi, We have multiple azure subscriptions in directory. How to export the Cost summary by for all subscriptions at once with tags? I would like to automatically export / send the costs for the past ...
Kidd_Ip
Oct 03, 2024MVP
Below script for your reference, please make sure you fully understand before apply to your environment:
az costmanagement export create --name MonthlyExport --type Usage --scope "/subscriptions/{subscription-id}" --storage-account-id "/subscriptions/{subscription-id}/resourceGroups/{resource-group}/providers/Microsoft.Storage/storageAccounts/{storage-account}" --storage-container "costreports" --timeframe MonthToDate --storage-directory "monthlyreports"