Skip to main content

discounts

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

Overview

Namediscounts
TypeResource
Idazure.billing_benefits.discounts

Fields

The following fields are returned by SELECT queries:

SELECT not supported for this resource, use SHOW METHODS to view available operations for the resource.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
createinsertresource_group_name, discount_name, subscription_id, locationCreate discount.
deletedeleteresource_group_name, discount_name, subscription_idDelete discount. Clears the metadata from the user's view.
resource_group_listexecresource_group_name, subscription_idList discounts at resource group level.
subscription_listexecsubscription_idList discounts at subscription level.
cancelexecresource_group_name, discount_name, subscription_idCancel discount. Stops applying the benefit.
scope_listexecscopeList discounts that are applicable for a given scope. Currently supported scopes: billing accounts.

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
discount_namestringName of the discount. Required.
resource_group_namestringThe name of the resource group. The name is case insensitive. Required.
scopestringThe scope at which the benefits are listed. Required.
subscription_idstring

INSERT examples

Create discount.

INSERT INTO azure.billing_benefits.discounts (
tags,
location,
properties,
managedBy,
kind,
identity,
sku,
plan,
resource_group_name,
discount_name,
subscription_id
)
SELECT
'{{ tags }}',
'{{ location }}' /* required */,
'{{ properties }}',
'{{ managedBy }}',
'{{ kind }}',
'{{ identity }}',
'{{ sku }}',
'{{ plan }}',
'{{ resource_group_name }}',
'{{ discount_name }}',
'{{ subscription_id }}'
RETURNING
id,
name,
etag,
identity,
kind,
location,
managedBy,
plan,
properties,
sku,
systemData,
tags,
type
;

DELETE examples

Delete discount. Clears the metadata from the user's view.

DELETE FROM azure.billing_benefits.discounts
WHERE resource_group_name = '{{ resource_group_name }}' --required
AND discount_name = '{{ discount_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
;

Lifecycle Methods

List discounts at resource group level.

EXEC azure.billing_benefits.discounts.resource_group_list 
@resource_group_name='{{ resource_group_name }}' --required,
@subscription_id='{{ subscription_id }}' --required
;