discounts
Creates, updates, deletes, gets or lists a discounts resource.
Overview
| Name | discounts |
| Type | Resource |
| Id | azure.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:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
create | insert | resource_group_name, discount_name, subscription_id, location | Create discount. | |
delete | delete | resource_group_name, discount_name, subscription_id | Delete discount. Clears the metadata from the user's view. | |
resource_group_list | exec | resource_group_name, subscription_id | List discounts at resource group level. | |
subscription_list | exec | subscription_id | List discounts at subscription level. | |
cancel | exec | resource_group_name, discount_name, subscription_id | Cancel discount. Stops applying the benefit. | |
scope_list | exec | scope | List 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.
| Name | Datatype | Description |
|---|---|---|
discount_name | string | Name of the discount. Required. |
resource_group_name | string | The name of the resource group. The name is case insensitive. Required. |
scope | string | The scope at which the benefits are listed. Required. |
subscription_id | string |
INSERT examples
- create
- Manifest
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
;
# Description fields are for documentation purposes
- name: discounts
props:
- name: resource_group_name
value: "{{ resource_group_name }}"
description: Required parameter for the discounts resource.
- name: discount_name
value: "{{ discount_name }}"
description: Required parameter for the discounts resource.
- name: subscription_id
value: "{{ subscription_id }}"
description: Required parameter for the discounts resource.
- name: tags
value: "{{ tags }}"
description: |
Resource tags.
- name: location
value: "{{ location }}"
description: |
The geo-location where the resource lives. Required.
- name: properties
description: |
Discount properties.
value:
entityType: "{{ entityType }}"
productCode: "{{ productCode }}"
startAt: "{{ startAt }}"
systemId: "{{ systemId }}"
provisioningState: "{{ provisioningState }}"
billingAccountResourceId: "{{ billingAccountResourceId }}"
billingProfileResourceId: "{{ billingProfileResourceId }}"
customerResourceId: "{{ customerResourceId }}"
displayName: "{{ displayName }}"
status: "{{ status }}"
benefitResourceId: "{{ benefitResourceId }}"
appliedScopeType: "{{ appliedScopeType }}"
- name: managedBy
value: "{{ managedBy }}"
description: |
The fully qualified resource ID of the resource that manages this resource. Indicates if this resource is managed by another Azure resource. If this is present, complete mode deployment will not delete the resource if it is removed from the template since it is managed by another resource.
- name: kind
value: "{{ kind }}"
description: |
Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type. E.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist this value.
- name: identity
description: |
Managed service identity (system assigned and/or user assigned identities).
value:
principalId: "{{ principalId }}"
tenantId: "{{ tenantId }}"
type: "{{ type }}"
userAssignedIdentities: "{{ userAssignedIdentities }}"
- name: sku
description: |
The resource model definition representing SKU.
value:
name: "{{ name }}"
tier: "{{ tier }}"
size: "{{ size }}"
family: "{{ family }}"
capacity: {{ capacity }}
- name: plan
description: |
Plan for the resource.
value:
name: "{{ name }}"
publisher: "{{ publisher }}"
product: "{{ product }}"
promotionCode: "{{ promotionCode }}"
version: "{{ version }}"
DELETE examples
- delete
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
- resource_group_list
- subscription_list
- cancel
- scope_list
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
;
List discounts at subscription level.
EXEC azure.billing_benefits.discounts.subscription_list
@subscription_id='{{ subscription_id }}' --required
;
Cancel discount. Stops applying the benefit.
EXEC azure.billing_benefits.discounts.cancel
@resource_group_name='{{ resource_group_name }}' --required,
@discount_name='{{ discount_name }}' --required,
@subscription_id='{{ subscription_id }}' --required
;
List discounts that are applicable for a given scope. Currently supported scopes: billing accounts.
EXEC azure.billing_benefits.discounts.scope_list
@scope='{{ scope }}' --required
;