discount
Creates, updates, deletes, gets or lists a discount resource.
Overview
| Name | discount |
| Type | Resource |
| Id | azure.billing_benefits.discount |
Fields
The following fields are returned by SELECT queries:
- get
| Name | Datatype | Description |
|---|---|---|
id | string | Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. |
name | string | The name of the resource. |
appliedScopeType | string | List of applied scopes supported for discounts. Known values are: "BillingAccount", "BillingProfile", and "Customer". (BillingAccount, BillingProfile, Customer) |
benefitResourceId | string | Fully-qualified identifier of the benefit under applicable benefit list. |
billingAccountResourceId | string | Billing account resource id where the discount metadata is present. |
billingProfileResourceId | string | Billing profile resource id where the discount is scoped to. |
customerResourceId | string | Customer resource id where the discount is scoped to. |
displayName | string | This defines a user friendly display name for the discount. |
entityType | string | This defines whether the entity being created is primary or affiliate. Supported values: primary, affiliate. Validation: Required, must match one of the 2 values. Required. Known values are: "Primary" and "Affiliate". |
etag | string | The etag field is not required. If it is provided in the response body, it must also be provided as a header per the normal etag convention. Entity tags are used for comparing two or more entities from the same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields. |
identity | object | Managed service identity (system assigned and/or user assigned identities). |
kind | string | 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. |
location | string | The geo-location where the resource lives. Required. |
managedBy | string | 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. |
plan | object | Plan for the resource. |
productCode | string | This is the catalog UPN for the product. Required. |
provisioningState | string | The state of the resource. Supported values are Pending, Failed, Succeeded, Canceled. Known values are: "Unknown", "Pending", "Succeeded", "Canceled", and "Failed". (Unknown, Pending, Succeeded, Canceled, Failed) |
sku | object | The resource model definition representing SKU. |
startAt | string (date-time) | Start date of the discount. Value is the date the discount started or will start in the future. Required. |
status | string | Represents the current status of the discount. Known values are: "Active", "Pending", "Failed", "Canceled", and "Expired". (Active, Pending, Failed, Canceled, Expired) |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
systemId | string | This is the globally unique identifier of the Discount which will not change for the lifetime of the Discount. |
tags | object | Resource tags. |
type | string | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | resource_group_name, discount_name, subscription_id | Get discount at resource group level. | |
update | update | resource_group_name, discount_name, subscription_id | Update discounts. |
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. |
subscription_id | string |
SELECT examples
- get
Get discount at resource group level.
SELECT
id,
name,
appliedScopeType,
benefitResourceId,
billingAccountResourceId,
billingProfileResourceId,
customerResourceId,
displayName,
entityType,
etag,
identity,
kind,
location,
managedBy,
plan,
productCode,
provisioningState,
sku,
startAt,
status,
systemData,
systemId,
tags,
type
FROM azure.billing_benefits.discount
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND discount_name = '{{ discount_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;
UPDATE examples
- update
Update discounts.
UPDATE azure.billing_benefits.discount
SET
properties = '{{ properties }}',
tags = '{{ tags }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND discount_name = '{{ discount_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
RETURNING
id,
name,
etag,
identity,
kind,
location,
managedBy,
plan,
properties,
sku,
systemData,
tags,
type;