policies
Creates, updates, deletes, gets or lists a policies resource.
Overview
| Name | policies |
| Type | Resource |
| Id | azure.billing.policies |
Fields
The following fields are returned by SELECT queries:
- get_by_customer
- get_by_customer_at_billing_account
- get_by_billing_profile
- get_by_billing_account
- get_by_subscription
| 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. |
policies | array | List of all policies defined at the billing scope. |
provisioningState | string | The provisioning state of the resource during a long-running operation. Known values are: "Succeeded", "Canceled", "Failed", "New", "Pending", "Provisioning", "PendingBilling", "ConfirmedBilling", "Creating", "Created", and "Expired". (Succeeded, Canceled, Failed, New, Pending, Provisioning, PendingBilling, ConfirmedBilling, Creating, Created, Expired) |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
tags | object | Dictionary 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 < > % & \ ? /. |
type | string | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". |
viewCharges | string | The policy that controls whether the users in customer's organization can view charges at pay-as-you-go prices. Required. Known values are: "Other", "Allowed", and "NotAllowed". (Other, Allowed, NotAllowed) |
| 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. |
policies | array | List of all policies defined at the billing scope. |
provisioningState | string | The provisioning state of the resource during a long-running operation. Known values are: "Succeeded", "Canceled", "Failed", "New", "Pending", "Provisioning", "PendingBilling", "ConfirmedBilling", "Creating", "Created", and "Expired". (Succeeded, Canceled, Failed, New, Pending, Provisioning, PendingBilling, ConfirmedBilling, Creating, Created, Expired) |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
tags | object | Dictionary 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 < > % & \ ? /. |
type | string | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". |
viewCharges | string | The policy that controls whether the users in customer's organization can view charges at pay-as-you-go prices. Required. Known values are: "Other", "Allowed", and "NotAllowed". (Other, Allowed, NotAllowed) |
| 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. |
enterpriseAgreementPolicies | object | The policies for Enterprise Agreement enrollments. |
invoiceSectionLabelManagement | string | The policy that controls invoice section label management at invoice section scope. This is allowed by default. Known values are: "Other", "Allowed", and "NotAllowed". (Other, Allowed, NotAllowed) |
marketplacePurchases | string | The policy that controls whether Azure marketplace purchases are allowed. Known values are: "Other", "AllAllowed", "Disabled", "NotAllowed", and "OnlyFreeAllowed". (Other, AllAllowed, Disabled, NotAllowed, OnlyFreeAllowed) |
policies | array | List of all policies defined at the billing scope. |
provisioningState | string | The provisioning state of the resource during a long-running operation. Known values are: "Succeeded", "Canceled", "Failed", "New", "Pending", "Provisioning", "PendingBilling", "ConfirmedBilling", "Creating", "Created", and "Expired". (Succeeded, Canceled, Failed, New, Pending, Provisioning, PendingBilling, ConfirmedBilling, Creating, Created, Expired) |
reservationPurchases | string | The policy that controls whether Azure reservation purchases are allowed. Known values are: "Other", "Allowed", "Disabled", and "NotAllowed". (Other, Allowed, Disabled, NotAllowed) |
savingsPlanPurchases | string | The policy that controls whether users with Azure savings plan purchase are allowed. Known values are: "Other", "Allowed", "Disabled", and "NotAllowed". (Other, Allowed, Disabled, NotAllowed) |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
tags | object | Dictionary 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 < > % & \ ? /. |
type | string | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". |
viewCharges | string | The policy that controls whether the users in customer's organization can view charges at pay-as-you-go prices. Known values are: "Other", "Allowed", and "NotAllowed". (Other, Allowed, NotAllowed) |
| 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. |
enterpriseAgreementPolicies | object | The policies for Enterprise Agreement enrollments. |
marketplacePurchases | string | The policy that controls whether Azure marketplace purchases are allowed. Known values are: "Other", "AllAllowed", "Disabled", "NotAllowed", and "OnlyFreeAllowed". (Other, AllAllowed, Disabled, NotAllowed, OnlyFreeAllowed) |
policies | array | List of all policies defined at the billing scope. |
provisioningState | string | The provisioning state of the resource during a long-running operation. Known values are: "Succeeded", "Canceled", "Failed", "New", "Pending", "Provisioning", "PendingBilling", "ConfirmedBilling", "Creating", "Created", and "Expired". (Succeeded, Canceled, Failed, New, Pending, Provisioning, PendingBilling, ConfirmedBilling, Creating, Created, Expired) |
reservationPurchases | string | The policy that controls whether Azure reservation purchases are allowed. Known values are: "Other", "Allowed", "Disabled", and "NotAllowed". (Other, Allowed, Disabled, NotAllowed) |
savingsPlanPurchases | string | The policy that controls whether users with Azure savings plan purchase are allowed. Known values are: "Other", "Allowed", "Disabled", and "NotAllowed". (Other, Allowed, Disabled, NotAllowed) |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
tags | object | Dictionary 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 < > % & \ ? /. |
type | string | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". |
| 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. |
policies | array | List of all policies defined at the billing scope. |
provisioningState | string | The provisioning state of the resource during a long-running operation. Known values are: "Succeeded", "Canceled", "Failed", "New", "Pending", "Provisioning", "PendingBilling", "ConfirmedBilling", "Creating", "Created", and "Expired". (Succeeded, Canceled, Failed, New, Pending, Provisioning, PendingBilling, ConfirmedBilling, Creating, Created, Expired) |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
tags | object | Dictionary 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 < > % & \ ? /. |
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_by_customer | select | billing_account_name, billing_profile_name, customer_name, policy_name | Lists the policies for a customer. This operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. | |
get_by_customer_at_billing_account | select | billing_account_name, customer_name | Lists the policies for a customer at billing account scope. This operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. | |
get_by_billing_profile | select | billing_account_name, billing_profile_name | Lists the policies for a billing profile. This operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. | |
get_by_billing_account | select | billing_account_name | Get the policies for a billing account of Enterprise Agreement type. | |
get_by_subscription | select | subscription_id | Lists the policies that are managed by the Billing Admin for the defined subscriptions. This is supported for Microsoft Online Services Program, Microsoft Customer Agreement and Microsoft Partner Agreement. | |
create_or_update_by_customer | insert | billing_account_name, billing_profile_name, customer_name | Updates the policies for a customer. This operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. | |
create_or_update_by_customer_at_billing_account | insert | billing_account_name, customer_name | Updates the policies for a customer at billing account scope. This operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. | |
create_or_update_by_billing_profile | insert | billing_account_name, billing_profile_name | Updates the policies for a billing profile. This operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. | |
create_or_update_by_billing_account | insert | billing_account_name | Update the policies for a billing account of Enterprise Agreement type. | |
create_or_update_by_customer | replace | billing_account_name, billing_profile_name, customer_name | Updates the policies for a customer. This operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. | |
create_or_update_by_customer_at_billing_account | replace | billing_account_name, customer_name | Updates the policies for a customer at billing account scope. This operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. | |
create_or_update_by_billing_profile | replace | billing_account_name, billing_profile_name | Updates the policies for a billing profile. This operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. | |
create_or_update_by_billing_account | replace | billing_account_name | Update the policies for a billing account of Enterprise Agreement type. |
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 |
|---|---|---|
billing_account_name | string | The ID that uniquely identifies a billing account. Required. |
billing_profile_name | string | The ID that uniquely identifies a billing profile. Required. |
customer_name | string | The ID that uniquely identifies a customer. Required. |
policy_name | string | Service-defined resource names such as 'default' which are reserved resource names. "default" Required. |
subscription_id | string |
SELECT examples
- get_by_customer
- get_by_customer_at_billing_account
- get_by_billing_profile
- get_by_billing_account
- get_by_subscription
Lists the policies for a customer. This operation is supported only for billing accounts with agreement type Microsoft Partner Agreement.
SELECT
id,
name,
policies,
provisioningState,
systemData,
tags,
type,
viewCharges
FROM azure.billing.policies
WHERE billing_account_name = '{{ billing_account_name }}' -- required
AND billing_profile_name = '{{ billing_profile_name }}' -- required
AND customer_name = '{{ customer_name }}' -- required
AND policy_name = '{{ policy_name }}' -- required
;
Lists the policies for a customer at billing account scope. This operation is supported only for billing accounts with agreement type Microsoft Partner Agreement.
SELECT
id,
name,
policies,
provisioningState,
systemData,
tags,
type,
viewCharges
FROM azure.billing.policies
WHERE billing_account_name = '{{ billing_account_name }}' -- required
AND customer_name = '{{ customer_name }}' -- required
;
Lists the policies for a billing profile. This operation is supported only for billing accounts with agreement type Microsoft Customer Agreement.
SELECT
id,
name,
enterpriseAgreementPolicies,
invoiceSectionLabelManagement,
marketplacePurchases,
policies,
provisioningState,
reservationPurchases,
savingsPlanPurchases,
systemData,
tags,
type,
viewCharges
FROM azure.billing.policies
WHERE billing_account_name = '{{ billing_account_name }}' -- required
AND billing_profile_name = '{{ billing_profile_name }}' -- required
;
Get the policies for a billing account of Enterprise Agreement type.
SELECT
id,
name,
enterpriseAgreementPolicies,
marketplacePurchases,
policies,
provisioningState,
reservationPurchases,
savingsPlanPurchases,
systemData,
tags,
type
FROM azure.billing.policies
WHERE billing_account_name = '{{ billing_account_name }}' -- required
;
Lists the policies that are managed by the Billing Admin for the defined subscriptions. This is supported for Microsoft Online Services Program, Microsoft Customer Agreement and Microsoft Partner Agreement.
SELECT
id,
name,
policies,
provisioningState,
systemData,
tags,
type
FROM azure.billing.policies
WHERE subscription_id = '{{ subscription_id }}' -- required
;
INSERT examples
- create_or_update_by_customer
- create_or_update_by_customer_at_billing_account
- create_or_update_by_billing_profile
- create_or_update_by_billing_account
- Manifest
Updates the policies for a customer. This operation is supported only for billing accounts with agreement type Microsoft Partner Agreement.
INSERT INTO azure.billing.policies (
properties,
tags,
billing_account_name,
billing_profile_name,
customer_name
)
SELECT
'{{ properties }}',
'{{ tags }}',
'{{ billing_account_name }}',
'{{ billing_profile_name }}',
'{{ customer_name }}'
RETURNING
id,
name,
properties,
systemData,
tags,
type
;
Updates the policies for a customer at billing account scope. This operation is supported only for billing accounts with agreement type Microsoft Partner Agreement.
INSERT INTO azure.billing.policies (
properties,
tags,
billing_account_name,
customer_name
)
SELECT
'{{ properties }}',
'{{ tags }}',
'{{ billing_account_name }}',
'{{ customer_name }}'
RETURNING
id,
name,
properties,
systemData,
tags,
type
;
Updates the policies for a billing profile. This operation is supported only for billing accounts with agreement type Microsoft Customer Agreement.
INSERT INTO azure.billing.policies (
properties,
tags,
billing_account_name,
billing_profile_name
)
SELECT
'{{ properties }}',
'{{ tags }}',
'{{ billing_account_name }}',
'{{ billing_profile_name }}'
RETURNING
id,
name,
properties,
systemData,
tags,
type
;
Update the policies for a billing account of Enterprise Agreement type.
INSERT INTO azure.billing.policies (
properties,
tags,
billing_account_name
)
SELECT
'{{ properties }}',
'{{ tags }}',
'{{ billing_account_name }}'
RETURNING
id,
name,
properties,
systemData,
tags,
type
;
# Description fields are for documentation purposes
- name: policies
props:
- name: billing_account_name
value: "{{ billing_account_name }}"
description: Required parameter for the policies resource.
- name: billing_profile_name
value: "{{ billing_profile_name }}"
description: Required parameter for the policies resource.
- name: customer_name
value: "{{ customer_name }}"
description: Required parameter for the policies resource.
- name: properties
description: |
A policy at billing account scope.
value:
provisioningState: "{{ provisioningState }}"
enterpriseAgreementPolicies:
authenticationType: "{{ authenticationType }}"
accountOwnerViewCharges: "{{ accountOwnerViewCharges }}"
departmentAdminViewCharges: "{{ departmentAdminViewCharges }}"
marketplacePurchases: "{{ marketplacePurchases }}"
reservationPurchases: "{{ reservationPurchases }}"
savingsPlanPurchases: "{{ savingsPlanPurchases }}"
policies:
- name: "{{ name }}"
value: "{{ value }}"
policyType: "{{ policyType }}"
scope: "{{ scope }}"
- name: tags
value: "{{ tags }}"
description: |
Dictionary 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 < > % & ? /.
REPLACE examples
- create_or_update_by_customer
- create_or_update_by_customer_at_billing_account
- create_or_update_by_billing_profile
- create_or_update_by_billing_account
Updates the policies for a customer. This operation is supported only for billing accounts with agreement type Microsoft Partner Agreement.
REPLACE azure.billing.policies
SET
properties = '{{ properties }}',
tags = '{{ tags }}'
WHERE
billing_account_name = '{{ billing_account_name }}' --required
AND billing_profile_name = '{{ billing_profile_name }}' --required
AND customer_name = '{{ customer_name }}' --required
RETURNING
id,
name,
properties,
systemData,
tags,
type;
Updates the policies for a customer at billing account scope. This operation is supported only for billing accounts with agreement type Microsoft Partner Agreement.
REPLACE azure.billing.policies
SET
properties = '{{ properties }}',
tags = '{{ tags }}'
WHERE
billing_account_name = '{{ billing_account_name }}' --required
AND customer_name = '{{ customer_name }}' --required
RETURNING
id,
name,
properties,
systemData,
tags,
type;
Updates the policies for a billing profile. This operation is supported only for billing accounts with agreement type Microsoft Customer Agreement.
REPLACE azure.billing.policies
SET
properties = '{{ properties }}',
tags = '{{ tags }}'
WHERE
billing_account_name = '{{ billing_account_name }}' --required
AND billing_profile_name = '{{ billing_profile_name }}' --required
RETURNING
id,
name,
properties,
systemData,
tags,
type;
Update the policies for a billing account of Enterprise Agreement type.
REPLACE azure.billing.policies
SET
properties = '{{ properties }}',
tags = '{{ tags }}'
WHERE
billing_account_name = '{{ billing_account_name }}' --required
RETURNING
id,
name,
properties,
systemData,
tags,
type;