Bemærk
Adgang til denne side kræver godkendelse. Du kan prøve at logge på eller ændre mapper.
Adgang til denne side kræver godkendelse. Du kan prøve at ændre mapper.
Important
APIs under the /beta version are subject to change. Use of these APIs in production applications is not supported.
A policy that governs Copilot Credits consumption for an audience. This is an abstract type. Every policy is one of its derived types, identified by the @odata.type property on create:
The audience type can't be changed by updating a policy. Changing the audience type requires deleting and recreating the policy, which creates a new identifier and resets the new policy's consumption accounting.
Policies are created disabled. For a group-scoped policy, link at least one group before the service can enable it. Read status to observe the policy lifecycle, not billing resource provisioning; clients don't write this property, and at least one service must remain enabled. Read serviceSettings, emailThresholdSettings, and group assignments through their own endpoints; these relationships aren't expandable.
For pay-as-you-go funding, the optional billingInstrument describes the complete Azure provisioning target and its resource lifecycle. Read billingInstrument.provisioningStatus independently of the policy's status. A successfully provisioned billing resource doesn't mean that the policy is enabled.
Updates, deletion, and changes to child settings or references use the parent policy's ETag through If-Match. Read a fresh policy before a mutation and use the returned ETag for the next mutation. Updates aren't permitted while a policy is provisioning, provisioning has failed, or the service has disabled it because of subscription or linked-resource state.
Related settings and audience
A spending policy brings together an audience, consumption limits, service settings, and optional alerts. Use the following resources and operations with the policy:
| Task | Resource or operation |
|---|---|
| Apply limits to every user in the tenant | allUsersSpendingPolicy |
| Apply limits to selected security groups | selectedGroupsSpendingPolicy; list, add, or remove assigned groups |
| Configure the services governed by the policy | spendingPolicyServiceSetting |
| Supply an Azure billing target and read resource provisioning state | costManagementBillingInstrument, through the existing policy create, update, and get operations |
| Configure notify-only thresholds and recipients | costManagementAlertSetting |
| Diagnose which policy governs a user's service access | costManagementUserServiceBalance, including spendingPolicyId and accessDecisionReason |
For consumption reports rather than policy configuration, see Usage reports.
Methods
| Method | Return type | Description |
|---|---|---|
| List | spendingPolicy collection | Get a list of spendingPolicy objects. |
| Create | spendingPolicy | Create a new spendingPolicy object. |
| Get | spendingPolicy | Retrieve the properties and relationships of a spendingPolicy object. |
| Update | spendingPolicy | Update a spendingPolicy object. |
| Delete | None | Delete a spendingPolicy object. |
Properties
| Property | Type | Description |
|---|---|---|
billingInstrument |
costManagementBillingInstrument | The Azure billing target for pay-as-you-go funding. Optional in a create request: you can create a policy without supplying Azure provisioning coordinates. To specify an explicit target, supply all three writable coordinates. Required when an update changes stored non-pay-as-you-go funding to include payAsYouGo. Doesn't support nested partial updates or replacement of an already-pay-as-you-go instrument. Supports $select, including nested properties; doesn't support $filter or $orderby. |
billingMethods |
costManagementBillingMethods | How consumption under this policy is funded. This is a flags value, so combined values such as prepaidCredits,payAsYouGo are valid. Optional at creation and updatable with PATCH. When omitted at creation, the value is notSpecified. |
createdBy |
identitySet | The identity that created the policy. An identity detail that isn't available is returned as null. Read-only. |
createdDateTime |
DateTimeOffset | When the policy was created. Read-only. Supports $filter (eq, ne) and $orderby. |
displayName |
String | The policy display name. Must be 10-64 characters, letters, digits, and spaces only. Required on create. Supports $filter (eq, ne) and $orderby. |
id |
String | Inherited entity key. Read-only. |
lastModifiedBy |
identitySet | The identity that last modified the policy. Read-only. |
lastModifiedDateTime |
DateTimeOffset | When the policy was last modified. Read-only. |
periodLimit |
costManagementQuantity | The consumption limit for one period. A period is a UTC calendar month: consumption is counted month-to-date and resets at 00:00 UTC on the first of each month. Required on create. |
perUserLimit |
costManagementQuantity | The uniform per-user consumption limit over the same period. Required on create. Supply an unlimitedCostManagementQuantity when no per-user cap is wanted. |
status |
spendingPolicyStatus | The policy lifecycle status. A policy is created disabled and becomes enabled once its audience is in place. Read-only. Supports $filter (eq, ne). |
costManagementBillingMethods enumeration
A flags evolvable enumeration with the following possible values. Because it's a flags enumeration, combined values such as prepaidCredits,payAsYouGo are valid.
| Value | Description |
|---|---|
notSpecified |
No billing method is known or was specified. The value is 0. |
prepaidCredits |
Prepaid Copilot Credits, purchased through the pre-purchase plan. The value is 1. |
payAsYouGo |
Consumption billed on demand, with no prepaid pool. The value is 2. |
unknownFutureValue |
Evolvable enumeration sentinel value. The value is 4. |
spendingPolicyStatus enumeration
An evolvable enumeration with the following possible values.
| Value | Description |
|---|---|
enabled |
The policy is active and enforced. |
disabled |
The policy isn't enforced. This is the initial state of a newly created policy. A policy is also disabled when every group assigned to it has been deleted, or when the service disables it in response to a change in the tenant's subscription. |
provisioning |
The policy is being created or transitioned; group links and validation are in progress. |
provisioningFailed |
The most recent provisioning attempt failed; the policy isn't enforced. |
unknownFutureValue |
Evolvable enumeration sentinel value. |
Relationships
| Relationship | Type | Description |
|---|---|---|
emailThresholdSettings |
costManagementAlertSetting | Nullable. Notify-only email threshold configuration. Addressed beneath the policy rather than returned inline. |
serviceSettings |
spendingPolicyServiceSetting collection | Per-service settings contained by the policy. Required on create. |
JSON representation
The following JSON representation shows the resource type.
{
"@odata.type": "#microsoft.graph.spendingPolicy",
"billingInstrument": {
"@odata.type": "microsoft.graph.costManagementBillingInstrument"
},
"billingMethods": "String",
"createdBy": {
"@odata.type": "microsoft.graph.identitySet"
},
"createdDateTime": "DateTimeOffset",
"displayName": "String",
"id": "String",
"lastModifiedBy": {
"@odata.type": "microsoft.graph.identitySet"
},
"lastModifiedDateTime": "DateTimeOffset",
"periodLimit": {
"@odata.type": "microsoft.graph.costManagementQuantity"
},
"perUserLimit": {
"@odata.type": "microsoft.graph.costManagementQuantity"
},
"status": "String"
}