Skip to main content

exports

Creates, updates, deletes, gets or lists an exports resource.

Overview

Nameexports
TypeResource
Idazure.cost_management.exports

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringFully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
namestringThe name of the resource.
compressionModestringAllow customers to select compress data for exports. This setting will enable destination file compression scheme at runtime. By default set to None. Gzip is for csv and snappy for parquet. Known values are: "gzip", "snappy", and "none". (gzip, snappy, none)
dataOverwriteBehaviorstringAllow customers to select overwrite data(OverwritePreviousReport) for exports. This setting will enable overwrite data for the same month in customer storage account. By default set to CreateNewReport. Known values are: "OverwritePreviousReport" and "CreateNewReport". (OverwritePreviousReport, CreateNewReport)
definitionobjectHas the definition for the export. Required.
deliveryInfoobjectHas delivery information for the export. Required.
eTagstringeTag of the resource. To handle concurrent update scenario, this field will be used to determine whether the user is updating the latest version or not.
exportDescriptionstringThe export description set by customer at time of export creation/update.
formatstringThe format of the export being delivered. Known values are: "Csv" and "Parquet". (Csv, Parquet)
identityobjectThe managed identity associated with Export.
locationstringThe location of the Export's managed identity. Only required when utilizing managed identity.
nextRunTimeEstimatestring (date-time)If the export has an active schedule, provides an estimate of the next run time.
partitionDatabooleanIf set to true, exported data will be partitioned by size and placed in a blob directory together with a manifest file.
runHistoryobjectIf requested, has the most recent run history for the export.
scheduleobjectHas schedule information for the export.
systemDataobjectAzure Resource Manager metadata containing createdBy and modifiedBy information.
systemSuspensionContextobjectThe export suspension reason if export is in SystemSuspended state. This is not populated currently.
typestringThe type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts".

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectscope, export_name$expandThe operation to get the export for the defined scope by export name.
listselectscope$expandThe operation to list all exports at the given scope.
create_or_updateinsertscope, export_nameThe operation to create or update a export. Update operation requires latest eTag to be set in the request. You may obtain the latest eTag by performing a get operation. Create operation does not require eTag.
create_or_updatereplacescope, export_nameThe operation to create or update a export. Update operation requires latest eTag to be set in the request. You may obtain the latest eTag by performing a get operation. Create operation does not require eTag.
deletedeletescope, export_nameThe operation to delete a export.
get_execution_historyexecscope, export_nameThe operation to get the run history of an export for the defined scope and export name.
executeexecscope, export_nameThe operation to run an export.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
export_namestringExport Name. Required.
scopestringThe fully qualified Azure Resource manager identifier of the resource. Required.
$expandstringMay be used to expand the properties within an export. Currently only 'runHistory' is supported and will return information for the last run of each export. Default value is None.

SELECT examples

The operation to get the export for the defined scope by export name.

SELECT
id,
name,
compressionMode,
dataOverwriteBehavior,
definition,
deliveryInfo,
eTag,
exportDescription,
format,
identity,
location,
nextRunTimeEstimate,
partitionData,
runHistory,
schedule,
systemData,
systemSuspensionContext,
type
FROM azure.cost_management.exports
WHERE scope = '{{ scope }}' -- required
AND export_name = '{{ export_name }}' -- required
AND $expand = '{{ $expand }}'
;

INSERT examples

The operation to create or update a export. Update operation requires latest eTag to be set in the request. You may obtain the latest eTag by performing a get operation. Create operation does not require eTag.

INSERT INTO azure.cost_management.exports (
properties,
identity,
location,
eTag,
scope,
export_name
)
SELECT
'{{ properties }}',
'{{ identity }}',
'{{ location }}',
'{{ eTag }}',
'{{ scope }}',
'{{ export_name }}'
RETURNING
id,
name,
eTag,
identity,
location,
properties,
systemData,
type
;

REPLACE examples

The operation to create or update a export. Update operation requires latest eTag to be set in the request. You may obtain the latest eTag by performing a get operation. Create operation does not require eTag.

REPLACE azure.cost_management.exports
SET
properties = '{{ properties }}',
identity = '{{ identity }}',
location = '{{ location }}',
eTag = '{{ eTag }}'
WHERE
scope = '{{ scope }}' --required
AND export_name = '{{ export_name }}' --required
RETURNING
id,
name,
eTag,
identity,
location,
properties,
systemData,
type;

DELETE examples

The operation to delete a export.

DELETE FROM azure.cost_management.exports
WHERE scope = '{{ scope }}' --required
AND export_name = '{{ export_name }}' --required
;

Lifecycle Methods

The operation to get the run history of an export for the defined scope and export name.

EXEC azure.cost_management.exports.get_execution_history 
@scope='{{ scope }}' --required,
@export_name='{{ export_name }}' --required
;