Skip to main content

views

Creates, updates, deletes, gets or lists a views resource.

Overview

Nameviews
TypeResource
Idazure.cost_management.views

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.
propertiesobjectThe properties of the view. (title: View properties)
typestringResource type.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_by_scopeselectscope, viewNameGets the view for the defined scope by view name.
list_by_scopeselectscopeLists all views at the given scope.
getselectviewNameGets the view by view name.
listselectLists all views by tenant and object.
create_or_updateinsertviewNameThe operation to create or update a view. 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.
delete_by_scopedeletescope, viewNameThe operation to delete a view.
deletedeleteviewNameThe operation to delete a view.

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
scopestringThe scope associated with view operations. This includes 'subscriptions/{subscriptionId}' for subscription scope, 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for BillingProfile scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for InvoiceSection scope, 'providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for External Billing Account scope and 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for External Subscription scope.
viewNamestringView name

SELECT examples

Gets the view for the defined scope by view name.

SELECT
id,
name,
eTag,
properties,
type
FROM azure.cost_management.views
WHERE scope = '{{ scope }}' -- required
AND viewName = '{{ viewName }}' -- required
;

INSERT examples

The operation to create or update a view. 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.views (
data__eTag,
data__properties,
viewName
)
SELECT
'{{ eTag }}',
'{{ properties }}',
'{{ viewName }}'
RETURNING
id,
name,
eTag,
properties,
type
;

DELETE examples

The operation to delete a view.

DELETE FROM azure.cost_management.views
WHERE scope = '{{ scope }}' --required
AND viewName = '{{ viewName }}' --required
;