Settings - Create Or Update By Scope
Create or update a setting within the given scope.
PUT https://management.azure.com/{scope}/providers/Microsoft.CostManagement/settings/taginheritance?api-version=2024-08-01
URI Parameters
Name | In | Required | Type | Description |
---|---|---|---|---|
scope
|
path | True |
string |
The scope associated with this setting. This includes 'subscriptions/{subscriptionId}' for subscription scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billing profile scope. |
type
|
path | True |
Setting type. |
|
api-version
|
query | True |
string |
The API version to use for this operation. |
Request Body
TagInheritanceSetting
Tag Inheritance Setting definition.
Name | Required | Type | Description |
---|---|---|---|
kind | True |
string:
taginheritance |
Specifies the kind of settings. |
properties |
The properties of the tag inheritance setting. |
Responses
Name | Type | Description |
---|---|---|
200 OK | Setting: |
Setting Updated. |
201 Created | Setting: |
Setting Created. |
Other Status Codes |
Error response describing why the operation failed. |
Security
azure_auth
Azure Active Directory OAuth2 Flow.
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize
Scopes
Name | Description |
---|---|
user_impersonation | impersonate your user account |
Examples
CreateOrUpdateSettingByScope
Sample request
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.CostManagement/settings/taginheritance?api-version=2024-08-01
{
"kind": "taginheritance",
"properties": {
"preferContainerTags": false
}
}
Sample response
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.CostManagement/settings/taginheritance",
"name": "taginheritance",
"type": "Microsoft.CostManagement/Settings",
"kind": "taginheritance",
"properties": {
"preferContainerTags": false
}
}
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.CostManagement/settings/taginheritance",
"name": "taginheritance",
"type": "Microsoft.CostManagement/Settings",
"kind": "taginheritance",
"properties": {
"preferContainerTags": false
}
}
Definitions
Name | Description |
---|---|
Error |
The details of the error. |
Error |
Error response indicates that the service is not able to process the incoming request. The reason is provided in the error message. Some Error responses:
|
Setting |
Setting type. |
Tag |
The properties of the tag inheritance setting. |
Tag |
Tag Inheritance Setting definition. |
ErrorDetails
The details of the error.
Name | Type | Description |
---|---|---|
code |
string |
Error code. |
message |
string |
Error message indicating why the operation failed. |
ErrorResponse
Error response indicates that the service is not able to process the incoming request. The reason is provided in the error message.
Some Error responses:
429 TooManyRequests - Request is throttled. Retry after waiting for the time specified in the "x-ms-ratelimit-microsoft.consumption-retry-after" header.
503 ServiceUnavailable - Service is temporarily unavailable. Retry after waiting for the time specified in the "Retry-After" header.
Name | Type | Description |
---|---|---|
error |
The details of the error. |
SettingType
Setting type.
Name | Type | Description |
---|---|---|
taginheritance |
string |
This setting applies billing profile, invoice section, subscription and resource group tags to current month's usage data of child resources. |
TagInheritanceProperties
The properties of the tag inheritance setting.
Name | Type | Description |
---|---|---|
preferContainerTags |
boolean |
This property defines the behavior when an inherited tag being applied matches a lower scope tag (Eg. Subscription tag matches the resource tag). If set to true - when tags match, the highest scope tags will be applied. Billing profile is the highest scope, followed by invoice sections, subscriptions and resource groups (allows overriding of lower scope tag values). If set to false - when tags match, the lowest scope tags will be applied. So, if a resource has the same tag as a subscription tag, the resource tag will be applied (does not allow overriding of lower scope tag values). |
TagInheritanceSetting
Tag Inheritance Setting definition.
Name | Type | Description |
---|---|---|
id |
string |
Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} |
kind |
string:
taginheritance |
Specifies the kind of settings. |
name |
string |
The name of the resource |
properties |
The properties of the tag inheritance setting. |
|
type |
string |
The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" |