az costmanagement export
Note
This reference is part of the costmanagement extension for the Azure CLI (version 2.55.0 or higher). The extension will automatically install the first time you run an az costmanagement export command. Learn more about extensions.
Costmanagement export.
Commands
Name | Description | Type | Status |
---|---|---|---|
az costmanagement export create |
The operation to create an export. |
Extension | GA |
az costmanagement export delete |
The operation to delete an export. |
Extension | GA |
az costmanagement export list |
The operation to list all exports at the given scope. |
Extension | GA |
az costmanagement export show |
The operation to get the execution history of an export for the defined scope by export name. |
Extension | GA |
az costmanagement export update |
The operation to update an export. |
Extension | GA |
az costmanagement export create
The operation to create an export.
az costmanagement export create --name
--scope
--storage-account-id
--storage-container
--timeframe {BillingMonthToDate, Custom, MonthToDate, TheLastBillingMonth, TheLastMonth, WeekToDate}
[--dataset-configuration]
[--recurrence {Annually, Daily, Monthly, Weekly}]
[--recurrence-period]
[--schedule-status {Active, Inactive}]
[--storage-directory]
[--time-period]
[--type {ActualCost, AmortizedCost, Usage}]
Examples
Create an export for ManagementGroup scope
az costmanagement export create --name "TestExport" --type "Usage" --dataset-configuration columns="Date" columns="MeterId" columns="InstanceId" columns="ResourceLocation" columns="PreTaxCost" --timeframe "MonthToDate" --storage-container="exports" --storage-account-id="/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182" --storage-directory="ad-hoc" --recurrence "Weekly" --recurrence-period from="2018-06-01T00:00:00Z" to="2018-10-31T00:00:00Z" --schedule-status "Active" --scope "providers/Microsoft.Management/managementGroups/TestMG"
Create an export for ResourceGroup scope
az costmanagement export create --name "TestExport" --type "Usage" --dataset-configuration columns="Date" columns="MeterId" columns="InstanceId" columns="ResourceLocation" columns="PreTaxCost" --timeframe "MonthToDate" --storage-container="exports" --storage-account-id="/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182" --storage-directory="ad-hoc" --recurrence "Weekly" --recurrence-period from="2018-06-01T00:00:00Z" to="2018-10-31T00:00:00Z" --schedule-status "Active" --scope "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG"
Create an export for Subscription scope
az costmanagement export create --name "TestExport" --type "Usage" --dataset-configuration columns="Date" columns="MeterId" columns="InstanceId" columns="ResourceLocation" columns="PreTaxCost" --timeframe "MonthToDate" --storage-container="exports" --storage-account-id="/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182" --storage-directory="ad-hoc" --recurrence "Weekly" --recurrence-period from="2018-06-01T00:00:00Z" to="2018-10-31T00:00:00Z" --schedule-status "Active" --scope "subscriptions/00000000-0000-0000-0000-000000000000"
Required Parameters
Export Name.
The scope associated with query and export operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group scope.
The ID of the storage account to store exports.
Property | Value |
---|---|
Parameter group: | Delivery Destination Info Arguments |
The storage container to deliver exports.
Property | Value |
---|---|
Parameter group: | Delivery Destination Info Arguments |
The time frame for pulling data for the query. If custom, then a specific time period must be provided.
Property | Value |
---|---|
Parameter group: | Export Definition Arguments |
Accepted values: | BillingMonthToDate, Custom, MonthToDate, TheLastBillingMonth, TheLastMonth, WeekToDate |
Optional Parameters
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
Has configuration information for the data in the export. The configuration will be ignored if aggregation and grouping are provided. Expect value: columns=xx.
Property | Value |
---|---|
Parameter group: | Export Definition Arguments |
The schedule recurrence.
Property | Value |
---|---|
Parameter group: | Schedule Info Arguments |
Accepted values: | Annually, Daily, Monthly, Weekly |
Has start and end date of the recurrence. The start date must be in future. If present, the end date must be greater than start date. Expect value: KEY1=VALUE1 KEY2=VALUE2 ... , available KEYs are: from, to. The time format is like 2020-05-01T00:00:00.
Property | Value |
---|---|
Parameter group: | Schedule Info Arguments |
The status of the export's schedule. If inactive, the export's scheduled execution is paused.
Property | Value |
---|---|
Parameter group: | Schedule Info Arguments |
Default value: | Inactive |
Accepted values: | Active, Inactive |
The root directory in the storage container to store exports.
Property | Value |
---|---|
Parameter group: | Delivery Destination Info Arguments |
Has time period for pulling data for the query. Expect value: from=TIMESTAMP1 to=TIMESTAMP2. The timestamp format is like 2020-05-01T00:00:00.The TIMESTAMP1 must in the future and TIMESTAMP2 must be greater than TIMESTAMP1.
Property | Value |
---|---|
Parameter group: | Export Definition Arguments |
The type of the query.
Property | Value |
---|---|
Parameter group: | Export Definition Arguments |
Default value: | Usage |
Accepted values: | ActualCost, AmortizedCost, Usage |
Global Parameters
Increase logging verbosity to show all debug logs.
Property | Value |
---|---|
Default value: | False |
Show this help message and exit.
Only show errors, suppressing warnings.
Property | Value |
---|---|
Default value: | False |
Output format.
Property | Value |
---|---|
Default value: | json |
Accepted values: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
Property | Value |
---|---|
Default value: | False |
az costmanagement export delete
The operation to delete an export.
az costmanagement export delete --name
--scope
[--yes]
Examples
delete an export for a ManagementGroup scope
az costmanagement export delete --name "TestExport" --scope "providers/Microsoft.Management/managementGroups/TestMG"
delete an export for ResourceGroup scope
az costmanagement export delete --name "TestExport" --scope "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG"
delete an export for Subscription scope
az costmanagement export delete --name "TestExport" --scope "subscriptions/00000000-0000-0000-0000-000000000000"
Required Parameters
Export Name.
The scope associated with query and export operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group scope.
Optional Parameters
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
Do not prompt for confirmation.
Property | Value |
---|---|
Default value: | False |
Global Parameters
Increase logging verbosity to show all debug logs.
Property | Value |
---|---|
Default value: | False |
Show this help message and exit.
Only show errors, suppressing warnings.
Property | Value |
---|---|
Default value: | False |
Output format.
Property | Value |
---|---|
Default value: | json |
Accepted values: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
Property | Value |
---|---|
Default value: | False |
az costmanagement export list
The operation to list all exports at the given scope.
az costmanagement export list --scope
Examples
list exports in a ManagementGroup scope
az costmanagement export list --scope "providers/Microsoft.Management/managementGroups/TestMG"
list exports in a ResourceGroup scope
az costmanagement export list --scope "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG"
list exports in a Subscription scope
az costmanagement export list --scope "subscriptions/00000000-0000-0000-0000-000000000000"
Required Parameters
The scope associated with query and export operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group scope.
Global Parameters
Increase logging verbosity to show all debug logs.
Property | Value |
---|---|
Default value: | False |
Show this help message and exit.
Only show errors, suppressing warnings.
Property | Value |
---|---|
Default value: | False |
Output format.
Property | Value |
---|---|
Default value: | json |
Accepted values: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
Property | Value |
---|---|
Default value: | False |
az costmanagement export show
The operation to get the execution history of an export for the defined scope by export name.
az costmanagement export show --name
--scope
Examples
Show an export in a ManagementGroup scope
az costmanagement export show --name "TestExport" --scope "providers/Microsoft.Management/managementGroups/TestMG"
Show an export in a ResourceGroup scope
az costmanagement export show --name "TestExport" --scope "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG"
Show an export in a Subscription scope
az costmanagement export show --name "TestExport" --scope "subscriptions/00000000-0000-0000-0000-000000000000"
Required Parameters
Export Name.
The scope associated with query and export operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group scope.
Global Parameters
Increase logging verbosity to show all debug logs.
Property | Value |
---|---|
Default value: | False |
Show this help message and exit.
Only show errors, suppressing warnings.
Property | Value |
---|---|
Default value: | False |
Output format.
Property | Value |
---|---|
Default value: | json |
Accepted values: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
Property | Value |
---|---|
Default value: | False |
az costmanagement export update
The operation to update an export.
az costmanagement export update --name
--scope
[--dataset-configuration]
[--recurrence {Annually, Daily, Monthly, Weekly}]
[--recurrence-period]
[--schedule-status {Active, Inactive}]
[--storage-account-id]
[--storage-container]
[--storage-directory]
[--time-period]
[--timeframe {BillingMonthToDate, Custom, MonthToDate, TheLastBillingMonth, TheLastMonth, WeekToDate}]
Examples
Update an export in a ManagementGroup scope
az costmanagement export update --name "TestExport" --dataset-configuration columns="Date" columns="MeterId" columns="InstanceId" columns="ResourceLocation" columns="PreTaxCost" --timeframe "MonthToDate" --storage-container="exports" --storage-account-id="/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182" --storage-directory="ad-hoc" --recurrence "Weekly" --recurrence-period from="2018-06-01T00:00:00Z" to="2018-10-31T00:00:00Z" --schedule-status "Active" --scope "providers/Microsoft.Management/managementGroups/TestMG"
Update an export in a ResourceGroup scope
az costmanagement export update --name "TestExport" --dataset-configuration columns="Date" columns="MeterId" columns="InstanceId" columns="ResourceLocation" columns="PreTaxCost" --timeframe "MonthToDate" --storage-container="exports" --storage-account-id="/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182" --storage-directory="ad-hoc" --recurrence "Weekly" --recurrence-period from="2018-06-01T00:00:00Z" to="2018-10-31T00:00:00Z" --schedule-status "Active" --scope "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG"
Update an export in a Subscription scope
az costmanagement export update --name "TestExport" --dataset-configuration columns="Date" columns="MeterId" columns="InstanceId" columns="ResourceLocation" columns="PreTaxCost" --timeframe "MonthToDate" --storage-container="exports" --storage-account-id="/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182" --storage-directory="ad-hoc" --recurrence "Weekly" --recurrence-period from="2018-06-01T00:00:00Z" to="2018-10-31T00:00:00Z" --schedule-status "Active" --scope "subscriptions/00000000-0000-0000-0000-000000000000"
Required Parameters
Export Name.
The scope associated with query and export operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group scope.
Optional Parameters
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
Has configuration information for the data in the export. The configuration will be ignored if aggregation and grouping are provided. Expect value: columns=xx.
Property | Value |
---|---|
Parameter group: | Export Definition Arguments |
The schedule recurrence.
Property | Value |
---|---|
Parameter group: | Schedule Info Arguments |
Accepted values: | Annually, Daily, Monthly, Weekly |
Has start and end date of the recurrence. The start date must be in future. If present, the end date must be greater than start date. Expect value: KEY1=VALUE1 KEY2=VALUE2 ... , available KEYs are: from, to. The time format is like 2020-05-01T00:00:00.
Property | Value |
---|---|
Parameter group: | Schedule Info Arguments |
The status of the export's schedule. If inactive, the export's scheduled execution is paused.
Property | Value |
---|---|
Parameter group: | Schedule Info Arguments |
Accepted values: | Active, Inactive |
The ID of the storage account to store exports.
Property | Value |
---|---|
Parameter group: | Delivery Destination Info Arguments |
The storage container to deliver exports.
Property | Value |
---|---|
Parameter group: | Delivery Destination Info Arguments |
The root directory in the storage container to store exports.
Property | Value |
---|---|
Parameter group: | Delivery Destination Info Arguments |
Has time period for pulling data for the query. Expect value: from=TIMESTAMP1 to=TIMESTAMP2. The timestamp format is like 2020-05-01T00:00:00.The TIMESTAMP1 must in the future and TIMESTAMP2 must be greater than TIMESTAMP1.
Property | Value |
---|---|
Parameter group: | Export Definition Arguments |
The time frame for pulling data for the query. If custom, then a specific time period must be provided.
Property | Value |
---|---|
Parameter group: | Export Definition Arguments |
Accepted values: | BillingMonthToDate, Custom, MonthToDate, TheLastBillingMonth, TheLastMonth, WeekToDate |
Global Parameters
Increase logging verbosity to show all debug logs.
Property | Value |
---|---|
Default value: | False |
Show this help message and exit.
Only show errors, suppressing warnings.
Property | Value |
---|---|
Default value: | False |
Output format.
Property | Value |
---|---|
Default value: | json |
Accepted values: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
Property | Value |
---|---|
Default value: | False |