Skip to main content

products

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

Overview

Nameproducts
TypeResource
Idazure.billing.products

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.
autoRenewstringIndicates whether auto renewal is turned on or off for a product. Known values are: "Off" and "On". (Off, On)
availabilityIdstringThe availability of the product.
billingFrequencystringThe frequency at which the product will be billed.
billingProfileDisplayNamestringThe name of the billing profile to which the product is billed.
billingProfileIdstringThe ID of the billing profile to which the product is billed.
customerDisplayNamestringThe name of the customer for whom the product was purchased. The field is applicable only for Microsoft Partner Agreement billing account.
customerIdstringThe ID of the customer for whom the product was purchased. The field is applicable only for Microsoft Partner Agreement billing account.
displayNamestringThe display name of the product.
endDatestringThe date when the product will be renewed or canceled.
invoiceSectionDisplayNamestringThe name of the invoice section to which the product is billed.
invoiceSectionIdstringThe ID of the invoice section to which the product is billed.
lastChargeobjectThe last month charges.
lastChargeDatestringThe date of the last charge.
productTypestringThe description of the type of product.
productTypeIdstringThe ID of the type of product.
purchaseDatestringThe date when the product was purchased.
quantityintegerThe quantity purchased for the product.
resellerobjectReseller for this product. The fields is not available for Microsoft Partner Agreement products.
skuDescriptionstringThe sku description of the product.
skuIdstringThe sku ID of the product.
statusstringThe status of the product. Known values are: "Other", "Active", "Disabled", "Deleted", "PastDue", "Expiring", "Expired", "AutoRenew", "Canceled", and "Suspended". (Other, Active, Disabled, Deleted, PastDue, Expiring, Expired, AutoRenew, Canceled, Suspended)
systemDataobjectAzure Resource Manager metadata containing createdBy and modifiedBy information.
tagsobjectDictionary of metadata associated with the resource. It may not be populated for all resource types. Maximum key/value length supported of 256 characters. Keys/value should not empty value nor null. Keys can not contain < > % & \ ? /.
tenantIdstringThe id of the tenant in which the product is used.
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
list_by_invoice_sectionselectbilling_account_name, billing_profile_name, invoice_section_namefilter, orderBy, top, skip, count, searchLists the products for an invoice section. These don't include products billed based on usage. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement.
getselectbilling_account_name, product_nameGets a product by ID. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement.
list_by_billing_profileselectbilling_account_name, billing_profile_namefilter, orderBy, top, skip, count, searchLists the products for a billing profile. These don't include products billed based on usage. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement.
list_by_customerselectbilling_account_name, customer_namefilter, orderBy, top, skip, count, searchLists the products for a customer. These don't include products billed based on usage.The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement.
list_by_billing_accountselectbilling_account_namefilter, orderBy, top, skip, count, searchLists the products for a billing account. These don't include products billed based on usage. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement.
updateupdatebilling_account_name, product_nameUpdates the properties of a Product. Currently, auto renew can be updated. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement.
moveexecbilling_account_name, product_name, destinationInvoiceSectionIdMoves a product's charges to a new invoice section. The new invoice section must belong to the same billing profile as the existing invoice section. This operation is supported only for products that are purchased with a recurring charge and for billing accounts with agreement type Microsoft Customer Agreement.
validate_move_eligibilityexecbilling_account_name, product_name, destinationInvoiceSectionIdValidates if a product's charges can be moved to a new invoice section. This operation is supported only for products that are purchased with a recurring charge and for billing accounts with agreement type Microsoft Customer Agreement.

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
billing_account_namestringThe ID that uniquely identifies a billing account. Required.
billing_profile_namestringThe ID that uniquely identifies a billing profile. Required.
customer_namestringThe ID that uniquely identifies a customer. Required.
invoice_section_namestringThe ID that uniquely identifies an invoice section. Required.
product_namestringThe ID that uniquely identifies a product. Required.
countbooleanThe count query option allows clients to request a count of the matching resources included with the resources in the response. Default value is None.
filterstringThe filter query option allows clients to filter a collection of resources that are addressed by a request URL. Default value is None.
orderBystringThe orderby query option allows clients to request resources in a particular order. Default value is None.
skipintegerThe skip query option requests the number of items in the queried collection that are to be skipped and not included in the result. Default value is None.
topintegerThe top query option requests the number of items in the queried collection to be included in the result. The maximum supported value for top is 50. Default value is None.

SELECT examples

Lists the products for an invoice section. These don't include products billed based on usage. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement.

SELECT
id,
name,
autoRenew,
availabilityId,
billingFrequency,
billingProfileDisplayName,
billingProfileId,
customerDisplayName,
customerId,
displayName,
endDate,
invoiceSectionDisplayName,
invoiceSectionId,
lastCharge,
lastChargeDate,
productType,
productTypeId,
purchaseDate,
quantity,
reseller,
skuDescription,
skuId,
status,
systemData,
tags,
tenantId,
type
FROM azure.billing.products
WHERE billing_account_name = '{{ billing_account_name }}' -- required
AND billing_profile_name = '{{ billing_profile_name }}' -- required
AND invoice_section_name = '{{ invoice_section_name }}' -- required
AND filter = '{{ filter }}'
AND orderBy = '{{ orderBy }}'
AND top = '{{ top }}'
AND skip = '{{ skip }}'
AND count = '{{ count }}'
AND search = '{{ search }}'
;

UPDATE examples

Updates the properties of a Product. Currently, auto renew can be updated. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement.

UPDATE azure.billing.products
SET
tags = '{{ tags }}',
properties = '{{ properties }}'
WHERE
billing_account_name = '{{ billing_account_name }}' --required
AND product_name = '{{ product_name }}' --required
RETURNING
id,
name,
properties,
systemData,
tags,
type;

Lifecycle Methods

Moves a product's charges to a new invoice section. The new invoice section must belong to the same billing profile as the existing invoice section. This operation is supported only for products that are purchased with a recurring charge and for billing accounts with agreement type Microsoft Customer Agreement.

EXEC azure.billing.products.move 
@billing_account_name='{{ billing_account_name }}' --required,
@product_name='{{ product_name }}' --required
@@json=
'{
"destinationInvoiceSectionId": "{{ destinationInvoiceSectionId }}"
}'
;