Skip to main content

sources

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

Overview

Namesources
TypeResource
Idazure.billing_benefits.sources

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.
creditobjectCommitment towards the benefit.
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).
impactedBillingPeriodstringThe billing period of the impact for the resource. Format YYYYMM.
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.
skuobjectThe resource model definition representing SKU.
sourceResourceIdstringThe uri of the resource impacted which lead to the grant of the credit.
statusstringStatus of the credit. Known values are: "Unknown", "Pending", "Active", "Succeeded", "Canceled", "Failed", "Expired", "Exhausted", and "NotStarted". (Unknown, Pending, Active, Succeeded, Canceled, Failed, Expired, Exhausted, NotStarted)
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, credit_name, source_name, subscription_idGet a credit source.
list_by_creditselectresource_group_name, credit_name, subscription_idList credit sources for a credit under a resource group from primary service admin.
createinsertresource_group_name, credit_name, source_name, subscription_id, locationCreate a credit source.
updateupdateresource_group_name, credit_name, source_name, subscription_idUpdate a credit source.
deletedeleteresource_group_name, credit_name, source_name, subscription_idDelete a credit source.

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
credit_namestringName of the credit. Required.
resource_group_namestringThe name of the resource group. The name is case insensitive. Required.
source_namestringName of the credit source. Required.
subscription_idstring

SELECT examples

Get a credit source.

SELECT
id,
name,
credit,
etag,
identity,
impactedBillingPeriod,
kind,
location,
managedBy,
plan,
sku,
sourceResourceId,
status,
systemData,
tags,
type
FROM azure.billing_benefits.sources
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND credit_name = '{{ credit_name }}' -- required
AND source_name = '{{ source_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;

INSERT examples

Create a credit source.

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

UPDATE examples

Update a credit source.

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

DELETE examples

Delete a credit source.

DELETE FROM azure.billing_benefits.sources
WHERE resource_group_name = '{{ resource_group_name }}' --required
AND credit_name = '{{ credit_name }}' --required
AND source_name = '{{ source_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
;