Share via


Markup Rules - Create Or Update

Create or update a markup rule

PUT https://management.azure.com/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/providers/Microsoft.CostManagement/markupRules/{name}?api-version=2022-10-05-preview

URI Parameters

Name In Required Type Description
billingAccountId
path True

string

BillingAccount ID

billingProfileId
path True

string

BillingProfile ID

name
path True

string

Markup rule name.

api-version
query True

string

Version of the API to be used with the client request.

Request Body

Name Required Type Description
properties.customerDetails True

CustomerMetadata

Customer information for the markup rule.

properties.percentage True

number (double)

The markup percentage of the rule.

properties.startDate True

string (date-time)

Starting date of the markup rule.

eTag

string

eTag of the resource. To handle concurrent update scenario, this field will be used to determine whether the user is updating the latest version or not.

properties.description

string

The description of the markup rule.

properties.endDate

string (date-time)

Ending date of the markup rule.

Responses

Name Type Description
200 OK

MarkupRule

OK. The request has succeeded. Create or Update request processed successfully

201 Created

MarkupRule

Created.

Other Status Codes

ErrorResponse

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

CreateOrUpdatePrivateMarkupRules

Sample request

PUT https://management.azure.com/providers/Microsoft.Billing/billingAccounts/2af90bea-080c-438c-8977-17cddd5f115a:ef5ce3cf-f5af-4fcb-a5ed-c376e1d6d2b6/billingProfiles/cbf78278-f4b8-43d9-8f13-47112da1c63e/providers/Microsoft.CostManagement/markupRules/markup-2022?api-version=2022-10-05-preview

{
  "properties": {
    "description": "Markup rule for year 2022",
    "percentage": 5,
    "startDate": "2022-01-01T00:00:00Z",
    "endDate": "2022-12-31T00:00:00Z",
    "customerDetails": {
      "billingAccountId": "cff9aa6d-941c-43f2-b6cb-1d2bb34a02b4:780237f3-1aa6-4159-943b-498e0d647dd9",
      "billingProfileId": "08eeecee-efb2-40d5-817c-0a254d2e042c"
    }
  }
}

Sample response

{
  "id": "providers/Microsoft.CostManagement/markupRules/markup-2022",
  "name": "markup-2022",
  "type": "Microsoft.CostManagement/markupRules",
  "properties": {
    "description": "Markup rule for year 2022",
    "percentage": 5,
    "startDate": "2022-01-01T00:00:00Z",
    "endDate": "2022-12-31T00:00:00Z",
    "customerDetails": {
      "billingAccountId": "cff9aa6d-941c-43f2-b6cb-1d2bb34a02b4:780237f3-1aa6-4159-943b-498e0d647dd9",
      "billingProfileId": "08eeecee-efb2-40d5-817c-0a254d2e042c"
    }
  }
}
{
  "id": "providers/Microsoft.CostManagement/markupRules/markup-2022",
  "name": "markup-2022",
  "type": "Microsoft.CostManagement/markupRules",
  "properties": {
    "description": "Markup rule for year 2022",
    "percentage": 5,
    "startDate": "2022-01-01T00:00:00Z",
    "endDate": "2022-12-31T00:00:00Z",
    "customerDetails": {
      "billingAccountId": "cff9aa6d-941c-43f2-b6cb-1d2bb34a02b4:780237f3-1aa6-4159-943b-498e0d647dd9",
      "billingProfileId": "08eeecee-efb2-40d5-817c-0a254d2e042c"
    }
  }
}

Definitions

Name Description
CustomerMetadata

The customer billing metadata

ErrorDetails

The details of the error.

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.

MarkupRule

Markup rule

CustomerMetadata

The customer billing metadata

Name Type Description
billingAccountId

string

Customer billing account id

billingProfileId

string

Customer billing profile id

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

ErrorDetails

The details of the error.

MarkupRule

Markup rule

Name Type Description
eTag

string

eTag of the resource. To handle concurrent update scenario, this field will be used to determine whether the user is updating the latest version or not.

id

string

Resource Id.

name

string

Resource name.

properties.customerDetails

CustomerMetadata

Customer information for the markup rule.

properties.description

string

The description of the markup rule.

properties.endDate

string (date-time)

Ending date of the markup rule.

properties.percentage

number (double)

The markup percentage of the rule.

properties.startDate

string (date-time)

Starting date of the markup rule.

type

string

Resource type.