Skip to main content

scheduled_actions

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

Overview

Namescheduled_actions
TypeResource
Idazure.cost_management.scheduled_actions

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.
displayNamestringScheduled action name. Required.
eTagstringResource Etag. For update calls, eTag is optional and can be specified to achieve optimistic concurrency. Fetch the resource's eTag by doing a 'GET' call first and then including the latest eTag as part of the request body or 'If-Match' header while performing the update. For create calls, eTag is not required.
fileDestinationobjectDestination format of the view data. This is optional.
kindstringKind of the scheduled action. Known values are: "Email" and "InsightAlert". (Email, InsightAlert)
notificationobjectNotification properties based on scheduled action kind. Required.
notificationEmailstringEmail address of the point of contact that should get the unsubscribe requests and notification emails.
scheduleobjectSchedule of the scheduled action. Required.
scopestringFor private scheduled action(Create or Update), scope will be empty. For shared scheduled action(Create or Update By Scope), Cost Management scope can be '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.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for ExternalBillingAccount scope, and '/providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for ExternalSubscription scope.
statusstringStatus of the scheduled action. Required. Known values are: "Enabled", "Expired", and "Disabled". (Enabled, Expired, Disabled)
systemDataobjectAzure Resource Manager metadata containing createdBy and modifiedBy information.
typestringThe type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts".
viewIdstringCost analysis viewId used for scheduled action. For example, '/providers/Microsoft.CostManagement/views/swaggerExample'. Required.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_by_scopeselectscope, nameGet the shared scheduled action from the given scope by name.
getselectnameGet the private scheduled action by name.
list_by_scopeselectscope$filterList all shared scheduled actions within the given scope.
listselect$filterList all private scheduled actions.
create_or_update_by_scopeinsertscope, nameCreate or update a shared scheduled action within the given scope.
create_or_updateinsertnameCreate or update a private scheduled action.
create_or_update_by_scopereplacescope, nameCreate or update a shared scheduled action within the given scope.
create_or_updatereplacenameCreate or update a private scheduled action.
delete_by_scopedeletescope, nameDelete a scheduled action within the given scope.
deletedeletenameDelete a private scheduled action.
runexecnameProcesses a private scheduled action.
run_by_scopeexecscope, nameRuns a shared scheduled action within the given scope.
check_name_availabilityexecChecks availability and correctness of the name for a scheduled action.
check_name_availability_by_scopeexecscopeChecks availability and correctness of the name for a scheduled action within the given scope.

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
namestringScheduled action name. Required.
scopestringThe scope associated with scheduled action 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.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for External Billing Account scope and 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for External Subscription scope. Note: Insight Alerts are only available on subscription scope. Required.
$filterstringMay be used to filter scheduled actions by properties/viewId. Supported operator is 'eq'. Default value is None.

SELECT examples

Get the shared scheduled action from the given scope by name.

SELECT
id,
name,
displayName,
eTag,
fileDestination,
kind,
notification,
notificationEmail,
schedule,
scope,
status,
systemData,
type,
viewId
FROM azure.cost_management.scheduled_actions
WHERE scope = '{{ scope }}' -- required
AND name = '{{ name }}' -- required
;

INSERT examples

Create or update a shared scheduled action within the given scope.

INSERT INTO azure.cost_management.scheduled_actions (
properties,
eTag,
kind,
scope,
name
)
SELECT
'{{ properties }}',
'{{ eTag }}',
'{{ kind }}',
'{{ scope }}',
'{{ name }}'
RETURNING
id,
name,
eTag,
kind,
properties,
systemData,
type
;

REPLACE examples

Create or update a shared scheduled action within the given scope.

REPLACE azure.cost_management.scheduled_actions
SET
properties = '{{ properties }}',
eTag = '{{ eTag }}',
kind = '{{ kind }}'
WHERE
scope = '{{ scope }}' --required
AND name = '{{ name }}' --required
RETURNING
id,
name,
eTag,
kind,
properties,
systemData,
type;

DELETE examples

Delete a scheduled action within the given scope.

DELETE FROM azure.cost_management.scheduled_actions
WHERE scope = '{{ scope }}' --required
AND name = '{{ name }}' --required
;

Lifecycle Methods

Processes a private scheduled action.

EXEC azure.cost_management.scheduled_actions.run 
@name='{{ name }}' --required
;