Skip to main content

conditional_credits

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

Overview

Nameconditional_credits
TypeResource
Idazure.billing_benefits.conditional_credits

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.
benefitResourceIdstringFully-qualified identifier of the benefit under applicable benefit list.
billingAccountResourceIdstringThe billing account resource ID.
displayNamestringDisplay name for the conditional credit.
endAtstring (date-time)End date of the conditional credit (derived from last milestone).
entityTypestringType of conditional credit entity. Required. Known values are: "Primary" and "Contributor".
etagstringThe 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.
identityobjectManaged service identity (system assigned and/or user assigned identities).
kindstringMetadata 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.
locationstringThe geo-location where the resource lives. Required.
managedBystringThe 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.
planobjectPlan for the resource.
productCodestringProduct code for the conditional credit.
provisioningStatestringThe provisioning state of the resource. Known values are: "Unknown", "Succeeded", "Failed", "Canceled", and "Pending". (Unknown, Succeeded, Failed, Canceled, Pending)
resourceIdstringFully-qualified resource identifier of the resource. Format: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BillingBenefits/{benefitType}/{benefitName}.
skuobjectThe resource model definition representing SKU.
startAtstring (date-time)Start date of the conditional credit.
statusstringThe status of the conditional credit. Known values are: "Unknown", "Scheduled", "Active", "Pending", "Failed", "Canceled", "Completed", "Stopped", and "PendingSettlement". (Unknown, Scheduled, Active, Pending, Failed, Canceled, Completed, Stopped, PendingSettlement)
systemDataobjectAzure Resource Manager metadata containing createdBy and modifiedBy information.
tagsobjectResource tags.
typestringThe type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts".

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectresource_group_name, conditional_credit_name, subscription_idGet a conditional credit.
list_by_resource_groupselectresource_group_name, subscription_idList conditional credits by resource group.
list_by_subscriptionselectsubscription_idList conditional credits by subscription.
create_or_updateinsertresource_group_name, conditional_credit_name, subscription_id, locationCreate or update a conditional credit.
updateupdateresource_group_name, conditional_credit_name, subscription_idUpdate a conditional credit.
create_or_updatereplaceresource_group_name, conditional_credit_name, subscription_id, locationCreate or update a conditional credit.
deletedeleteresource_group_name, conditional_credit_name, subscription_idDelete a conditional credit.
cancelexecresource_group_name, conditional_credit_name, subscription_idCancel conditional credit. Stops applying the benefit.
scope_listexecscopeList conditional credits 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
conditional_credit_namestringName of the conditional credit. 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

SELECT examples

Get a conditional credit.

SELECT
id,
name,
benefitResourceId,
billingAccountResourceId,
displayName,
endAt,
entityType,
etag,
identity,
kind,
location,
managedBy,
plan,
productCode,
provisioningState,
resourceId,
sku,
startAt,
status,
systemData,
tags,
type
FROM azure.billing_benefits.conditional_credits
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND conditional_credit_name = '{{ conditional_credit_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;

INSERT examples

Create or update a conditional credit.

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

UPDATE examples

Update a conditional credit.

UPDATE azure.billing_benefits.conditional_credits
SET
properties = '{{ properties }}',
tags = '{{ tags }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND conditional_credit_name = '{{ conditional_credit_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
RETURNING
id,
name,
etag,
identity,
kind,
location,
managedBy,
plan,
properties,
sku,
systemData,
tags,
type;

REPLACE examples

Create or update a conditional credit.

REPLACE azure.billing_benefits.conditional_credits
SET
tags = '{{ tags }}',
location = '{{ location }}',
properties = '{{ properties }}',
managedBy = '{{ managedBy }}',
kind = '{{ kind }}',
identity = '{{ identity }}',
sku = '{{ sku }}',
plan = '{{ plan }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND conditional_credit_name = '{{ conditional_credit_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
AND location = '{{ location }}' --required
RETURNING
id,
name,
etag,
identity,
kind,
location,
managedBy,
plan,
properties,
sku,
systemData,
tags,
type;

DELETE examples

Delete a conditional credit.

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

Lifecycle Methods

Cancel conditional credit. Stops applying the benefit.

EXEC azure.billing_benefits.conditional_credits.cancel 
@resource_group_name='{{ resource_group_name }}' --required,
@conditional_credit_name='{{ conditional_credit_name }}' --required,
@subscription_id='{{ subscription_id }}' --required
;