The costAllocationRules resource type can be deployed to:
For a list of changed properties in each API version, see change log.
To create a Microsoft.CostManagement/costAllocationRules resource, add the following JSON to your template.
{
"type": "Microsoft.CostManagement/costAllocationRules",
"apiVersion": "2020-03-01-preview",
"name": "string",
"properties": {
"description": "string",
"details": {
"sourceResources": [
{
"name": "string",
"resourceType": "string",
"values": [ "string" ]
}
],
"targetResources": [
{
"name": "string",
"policyType": "FixedProportion",
"resourceType": "string",
"values": [
{
"name": "string",
"percentage": "int"
}
]
}
]
},
"status": "string"
}
}
Name | Description | Value |
---|---|---|
type | The resource type | 'Microsoft.CostManagement/costAllocationRules' |
apiVersion | The resource api version | '2020-03-01-preview' |
name | The resource name | string (required) |
properties | Cost allocation rule properties | CostAllocationRuleProperties |
Name | Description | Value |
---|---|---|
description | Description of a cost allocation rule. | string |
details | Resource information for the cost allocation rule | CostAllocationRuleDetails (required) |
status | Status of the rule | 'Active' 'NotActive' 'Processing' (required) |
Name | Description | Value |
---|---|---|
sourceResources | Source resources for cost allocation. At this time, this list can contain no more than one element. | SourceCostAllocationResource[] |
targetResources | Target resources for cost allocation. At this time, this list can contain no more than one element. | TargetCostAllocationResource[] |
Name | Description | Value |
---|---|---|
name | If resource type is dimension, this must be either ResourceGroupName or SubscriptionId. If resource type is tag, this must be a valid Azure tag | string (required) |
resourceType | Type of resources contained in this cost allocation rule | 'Dimension' 'Tag' (required) |
values | Source Resources for cost allocation. This list cannot contain more than 25 values. | string[] (required) |
Name | Description | Value |
---|---|---|
name | If resource type is dimension, this must be either ResourceGroupName or SubscriptionId. If resource type is tag, this must be a valid Azure tag | string (required) |
policyType | Method of cost allocation for the rule | 'FixedProportion' (required) |
resourceType | Type of resources contained in this cost allocation rule | 'Dimension' 'Tag' (required) |
values | Target resources for cost allocation. This list cannot contain more than 25 values. | CostAllocationProportion[] (required) |
Name | Description | Value |
---|---|---|
name | Target resource for cost allocation | string (required) |
percentage | Percentage of source cost to allocate to this resource. This value can be specified to two decimal places and the total percentage of all resources in this rule must sum to 100.00. | int (required) |