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:

OK. The request has succeeded.

NameDatatypeDescription
idstringResource Id.
namestringResource name.
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.
identityobjectThe managed identity associated with Export
locationstringThe location of the Export's managed identity. Only required when utilizing managed identity.
propertiesobjectThe properties of the export. (title: Export properties)
typestringResource type.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectscope, exportName$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, exportNameThe 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, exportNameThe operation to delete a export.
executeexecscope, exportNameThe 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
exportNamestringExport Name.
scopestringThe scope associated with export operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' for invoiceSection scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners.
$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.

SELECT examples

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

SELECT
id,
name,
eTag,
identity,
location,
properties,
type
FROM azure.cost_management.exports
WHERE scope = '{{ scope }}' -- required
AND exportName = '{{ exportName }}' -- 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 (
data__eTag,
data__identity,
data__location,
data__properties,
scope,
exportName
)
SELECT
'{{ eTag }}',
'{{ identity }}',
'{{ location }}',
'{{ properties }}',
'{{ scope }}',
'{{ exportName }}'
RETURNING
id,
name,
eTag,
identity,
location,
properties,
type
;

DELETE examples

The operation to delete a export.

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

Lifecycle Methods

The operation to run an export.

EXEC azure.cost_management.exports.execute 
@scope='{{ scope }}' --required,
@exportName='{{ exportName }}' --required
;