az costmanagement export

Costmanagement export.

Commands

az costmanagement export create

The operation to create an export.

az costmanagement export delete

The operation to delete an export.

az costmanagement export list

The operation to list all exports at the given scope.

az costmanagement export show

The operation to get the execution history of an export for the defined scope by export name.

az costmanagement export update

The operation to update an export.

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]
                                [--dataset-grouping]
                                [--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" --dataset-grouping name="SubscriptionName" type="Dimension" --dataset-grouping name="Environment" type="Tag" --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" --dataset-grouping name="SubscriptionName" type="Dimension" --dataset-grouping name="Environment" type="Tag" --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" --dataset-grouping name="SubscriptionName" type="Dimension" --dataset-grouping name="Environment" type="Tag" --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

--name

Export Name.

--scope

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.

--storage-account-id

The ID of the storage account to store exports.

--storage-container

The storage container to deliver exports.

--timeframe

The time frame for pulling data for the query. If custom, then a specific time period must be provided.

accepted values: BillingMonthToDate, Custom, MonthToDate, TheLastBillingMonth, TheLastMonth, WeekToDate

Optional Parameters

--dataset-configuration

Has configuration information for the data in the export. The configuration will be ignored if aggregation and grouping are provided. Expect value: columns=xx.

--dataset-grouping

Array of group by expression to use in the query. Query can have up to 2 group by clauses. Expect value: KEY1=VALUE1 KEY2=VALUE2 ... , available KEYs are: type, name.

--recurrence

The schedule recurrence.

accepted values: Annually, Daily, Monthly, Weekly
--recurrence-period

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.

--schedule-status

The status of the schedule.Whether active or not. If inactive, the export's scheduled execution is paused.

accepted values: Active, Inactive
--storage-directory

The root directory in the storage container to store exports.

--time-period

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.

--type

The type of the query.

accepted values: ActualCost, AmortizedCost, Usage

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

--name

Export Name.

--scope

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

--yes -y

Do not prompt for confirmation.

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

--scope

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.

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

--name

Export Name.

--scope

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.

az costmanagement export update

The operation to update an export.

az costmanagement export update --name
                                --scope
                                [--dataset-configuration]
                                [--dataset-grouping]
                                [--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" --dataset-grouping name="SubscriptionName" type="Dimension" --dataset-grouping name="Environment" type="Tag" --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" --dataset-grouping name="SubscriptionName" type="Dimension" --dataset-grouping name="Environment" type="Tag" --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" --dataset-grouping name="SubscriptionName" type="Dimension" --dataset-grouping name="Environment" type="Tag" --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

--name

Export Name.

--scope

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

--dataset-configuration

Has configuration information for the data in the export. The configuration will be ignored if aggregation and grouping are provided. Expect value: columns=xx.

--dataset-grouping

Array of group by expression to use in the query. Query can have up to 2 group by clauses. Expect value: KEY1=VALUE1 KEY2=VALUE2 ... , available KEYs are: type, name.

--recurrence

The schedule recurrence.

accepted values: Annually, Daily, Monthly, Weekly
--recurrence-period

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.

--schedule-status

The status of the schedule.Whether active or not. If inactive, the export's scheduled execution is paused.

accepted values: Active, Inactive
--storage-account-id

The ID of the storage account to store exports.

--storage-container

The storage container to deliver exports.

--storage-directory

The root directory in the storage container to store exports.

--time-period

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.

--timeframe

The time frame for pulling data for the query. If custom, then a specific time period must be provided.

accepted values: BillingMonthToDate, Custom, MonthToDate, TheLastBillingMonth, TheLastMonth, WeekToDate