Skip to content

Commit 2521dfd

Browse files
authored
Merge pull request #180399 from bandersmsft/download-azure-daily-usage11182021
CM+B - Update View and download usage and charges
2 parents e2c42db + e885105 commit 2521dfd

File tree

1 file changed

+2
-18
lines changed

1 file changed

+2
-18
lines changed

articles/cost-management-billing/understand/download-azure-daily-usage.md

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ ms.service: cost-management-billing
1010
ms.subservice: billing
1111
ms.topic: conceptual
1212
ms.custom: devx-track-azurecli
13-
ms.date: 10/22/2021
13+
ms.date: 11/18/2021
1414
---
1515

1616
# View and download your Azure usage and charges
@@ -86,23 +86,7 @@ Start by preparing your environment for the Azure CLI:
8686

8787
[!INCLUDE [azure-cli-prepare-your-environment-no-header.md](../../../includes/azure-cli-prepare-your-environment-no-header.md)]
8888

89-
After you sign in, use the [az costmanagement query](/cli/azure/costmanagement#az_costmanagement_query) command to query month-to-date usage information for your subscription:
90-
91-
```azurecli
92-
az costmanagement query --timeframe MonthToDate --type Usage --dataset-aggregation '{\"totalCost\":{\"name\":\"PreTaxCost\",\"function\":\"Sum\"}}' --dataset-grouping name="ResourceGroup" type="Dimension"
93-
--scope "subscriptions/00000000-0000-0000-0000-000000000000"
94-
```
95-
96-
You can also narrow the query by using the **--dataset-filter** parameter or other parameters:
97-
98-
```azurecli
99-
'{\"totalCost\":{\"name\":\"PreTaxCost\",\"function\":\"Sum\"}}' --dataset-grouping name="ResourceGroup" type="Dimension"
100-
--scope "subscriptions/00000000-0000-0000-0000-000000000000" --dataset-filter "{\"and\":[{\"or\":[{\"dimension\":{\"name\":\"ResourceLocation\",\"operator\":\"In\",\"values\":[\"East US\",\"West Europe\"]}},{\"tag\":{\"name\":\"Environment\",\"operator\":\"In\",\"values\":[\"UAT\",\"Prod\"]}}]},{\"dimension\":{\"name\":\"ResourceGroup\",\"operator\":\"In\",\"values\":[\"API\"]}}]}"
101-
```
102-
103-
The **--dataset-filter** parameter takes a JSON string or `@json-file`.
104-
105-
You also have the option of using the [az costmanagement export](/cli/azure/costmanagement/export) commands to export usage data to an Azure storage account. You can download the data from there.
89+
Then use the [az costmanagement export](/cli/azure/costmanagement/export) commands to export usage data to an Azure storage account. You can download the data from there.
10690

10791
1. Create a resource group or use an existing resource group. To create a resource group, run the [az group create](/cli/azure/group#az_group_create) command:
10892

0 commit comments

Comments
 (0)