Partilhar via


Savings Plan Order Alias - Create

Create a savings plan. Learn more about permissions needed at https://go.microsoft.com/fwlink/?linkid=2215851

PUT https://management.azure.com/providers/Microsoft.BillingBenefits/savingsPlanOrderAliases/{savingsPlanOrderAliasName}?api-version=2022-11-01

URI Parameters

Name In Required Type Description
savingsPlanOrderAliasName
path True

string

Name of the savings plan order alias

Regex pattern: ^[a-zA-Z0-9_\-\.]+$

api-version
query True

string

The api-version to be used by the service

Request Body

Name Required Type Description
sku True

Sku

Savings plan SKU

kind

string

Resource provider kind

properties.appliedScopeProperties

AppliedScopeProperties

Properties specific to applied scope type. Not required if not applicable.

properties.appliedScopeType

AppliedScopeType

Type of the Applied Scope.

properties.billingPlan

BillingPlan

Represents the billing plan in ISO 8601 format. Required only for monthly billing plans.

properties.billingScopeId

string

Subscription that will be charged for purchasing the benefit

properties.commitment

Commitment

Commitment towards the benefit.

properties.displayName

string

Display name

properties.renew

boolean

Setting this to true will automatically purchase a new benefit on the expiration date time.

properties.term

Term

Represent benefit term in ISO 8601 format.

Responses

Name Type Description
200 OK

SavingsPlanOrderAliasModel

The resource has been created.

201 Created

SavingsPlanOrderAliasModel

The request is being processed.

Headers

  • Azure-AsyncOperation: string
  • Retry-After: integer
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

SavingsPlanOrderAliasCreate
SavingsPlanOrderAliasCreateSingleScope

SavingsPlanOrderAliasCreate

Sample request

PUT https://management.azure.com/providers/Microsoft.BillingBenefits/savingsPlanOrderAliases/spAlias123?api-version=2022-11-01

{
  "sku": {
    "name": "Compute_Savings_Plan"
  },
  "properties": {
    "billingScopeId": "/subscriptions/30000000-0000-0000-0000-000000000000",
    "term": "P3Y",
    "appliedScopeType": "Shared",
    "appliedScopeProperties": null,
    "displayName": "Compute_SavingsPlan_10-28-2022_16-38",
    "billingPlan": "P1M",
    "commitment": {
      "grain": "Hourly",
      "currencyCode": "USD",
      "amount": 0.001
    }
  }
}

Sample response

Azure-AsyncOperation: https://management.azure.com/Microsoft.BillingBenefits/operationResults/4e2ffff7-b331-4fcb-ab11-b5fa49368188?api-version=2021-07-01-privatepreview
Retry-After: 5
{
  "id": "/providers/microsoft.billingbenefits/savingsPlanOrderAliases/SavingsPlan_1667000324595",
  "name": "SavingsPlan_1667000324595",
  "type": "Microsoft.BillingBenefits/savingsPlanOrderAliases",
  "kind": null,
  "sku": {
    "name": "Compute_Savings_Plan"
  },
  "properties": {
    "savingsPlanOrderId": "/providers/Microsoft.BillingBenefits/savingsPlanOrders/30000000-0000-0000-0000-000000000023",
    "billingScopeId": "/subscriptions/30000000-0000-0000-0000-000000000000",
    "billingPlan": "P1M",
    "appliedScopeProperties": null,
    "commitment": {
      "grain": "Hourly",
      "currencyCode": "USD",
      "amount": 0.001
    },
    "appliedScopeType": "Shared",
    "displayName": "Compute_SavingsPlan_10-28-2022_16-38",
    "provisioningState": "Created",
    "term": "P3Y"
  }
}
{
  "id": "/providers/microsoft.billingbenefits/savingsPlanOrderAliases/SavingsPlan_1667000324595",
  "name": "SavingsPlan_1667000324595",
  "type": "Microsoft.BillingBenefits/savingsPlanOrderAliases",
  "kind": null,
  "sku": {
    "name": "Compute_Savings_Plan"
  },
  "properties": {
    "savingsPlanOrderId": "/providers/Microsoft.BillingBenefits/savingsPlanOrders/30000000-0000-0000-0000-000000000023",
    "billingScopeId": "/subscriptions/30000000-0000-0000-0000-000000000000",
    "billingPlan": "P1M",
    "appliedScopeProperties": null,
    "commitment": {
      "grain": "Hourly",
      "currencyCode": "USD",
      "amount": 0.001
    },
    "appliedScopeType": "Shared",
    "displayName": "Compute_SavingsPlan_10-28-2022_16-38",
    "provisioningState": "Created",
    "term": "P3Y"
  }
}

SavingsPlanOrderAliasCreateSingleScope

Sample request

PUT https://management.azure.com/providers/Microsoft.BillingBenefits/savingsPlanOrderAliases/spAlias123?api-version=2022-11-01

{
  "sku": {
    "name": "Compute_Savings_Plan"
  },
  "properties": {
    "billingScopeId": "/providers/Microsoft.Billing/billingAccounts/1234567/billingSubscriptions/30000000-0000-0000-0000-000000000000",
    "appliedScopeType": "Single",
    "appliedScopeProperties": {
      "subscriptionId": "/subscriptions/30000000-0000-0000-0000-000000000000"
    },
    "term": "P3Y",
    "displayName": "Compute_SavingsPlan_10-28-2022_16-38",
    "billingPlan": "P1M",
    "commitment": {
      "grain": "Hourly",
      "currencyCode": "USD",
      "amount": 0.001
    }
  }
}

Sample response

Azure-AsyncOperation: https://management.azure.com/Microsoft.BillingBenefits/operationResults/4e2ffff7-b331-4fcb-ab11-b5fa49368188?api-version=2021-07-01-privatepreview
Retry-After: 5
{
  "id": "/providers/microsoft.billingbenefits/savingsPlanOrderAliases/SavingsPlan_1667000324595",
  "name": "SavingsPlan_1667000324595",
  "type": "Microsoft.BillingBenefits/savingsPlanOrderAliases",
  "kind": null,
  "sku": {
    "name": "Compute_Savings_Plan"
  },
  "properties": {
    "savingsPlanOrderId": "/providers/Microsoft.BillingBenefits/savingsPlanOrders/30000000-0000-0000-0000-000000000023",
    "billingPlan": "P1M",
    "billingScopeId": "/providers/Microsoft.Billing/billingAccounts/1234567/billingSubscriptions/30000000-0000-0000-0000-000000000000",
    "appliedScopeType": "Single",
    "appliedScopeProperties": {
      "subscriptionId": "/subscriptions/30000000-0000-0000-0000-000000000000"
    },
    "commitment": {
      "grain": "Hourly",
      "currencyCode": "USD",
      "amount": 0.001
    },
    "displayName": "Compute_SavingsPlan_10-28-2022_16-38",
    "provisioningState": "Created",
    "term": "P3Y"
  }
}
{
  "id": "/providers/microsoft.billingbenefits/savingsPlanOrderAliases/SavingsPlan_1667000324595",
  "name": "SavingsPlan_1667000324595",
  "type": "Microsoft.BillingBenefits/savingsPlanOrderAliases",
  "kind": null,
  "sku": {
    "name": "Compute_Savings_Plan"
  },
  "properties": {
    "savingsPlanOrderId": "/providers/Microsoft.BillingBenefits/savingsPlanOrders/30000000-0000-0000-0000-000000000023",
    "billingPlan": "P1M",
    "billingScopeId": "/providers/Microsoft.Billing/billingAccounts/1234567/billingSubscriptions/30000000-0000-0000-0000-000000000000",
    "appliedScopeType": "Single",
    "appliedScopeProperties": {
      "subscriptionId": "/subscriptions/30000000-0000-0000-0000-000000000000"
    },
    "commitment": {
      "grain": "Hourly",
      "currencyCode": "USD",
      "amount": 0.001
    },
    "displayName": "Compute_SavingsPlan_10-28-2022_16-38",
    "provisioningState": "Created",
    "term": "P3Y"
  }
}

Definitions

Name Description
AppliedScopeProperties

Properties specific to applied scope type. Not required if not applicable.

AppliedScopeType

Type of the Applied Scope.

BillingPlan

Represents the billing plan in ISO 8601 format. Required only for monthly billing plans.

Commitment

Commitment towards the benefit.

CommitmentGrain

Commitment grain.

createdByType

The type of identity that created the resource.

ErrorAdditionalInfo

The resource management error additional info.

ErrorDetail

The error detail.

ErrorResponse

Error response

ProvisioningState

Provisioning state

SavingsPlanOrderAliasModel

Savings plan order alias

Sku

The SKU to be applied for this resource

systemData

Metadata pertaining to creation and last modification of the resource.

Term

Represent benefit term in ISO 8601 format.

AppliedScopeProperties

Properties specific to applied scope type. Not required if not applicable.

Name Type Description
displayName

string

Display name

managementGroupId

string

Fully-qualified identifier of the management group where the benefit must be applied.

resourceGroupId

string

Fully-qualified identifier of the resource group.

subscriptionId

string

Fully-qualified identifier of the subscription.

tenantId

string

Tenant ID where the benefit is applied.

AppliedScopeType

Type of the Applied Scope.

Name Type Description
ManagementGroup

string

Shared

string

Single

string

BillingPlan

Represents the billing plan in ISO 8601 format. Required only for monthly billing plans.

Name Type Description
P1M

string

Commitment

Commitment towards the benefit.

Name Type Description
amount

number

currencyCode

string

The ISO 4217 3-letter currency code for the currency used by this purchase record.

grain

CommitmentGrain

Commitment grain.

CommitmentGrain

Commitment grain.

Name Type Description
Hourly

string

createdByType

The type of identity that created the resource.

Name Type Description
Application

string

Key

string

ManagedIdentity

string

User

string

ErrorAdditionalInfo

The resource management error additional info.

Name Type Description
info

object

The additional info.

type

string

The additional info type.

ErrorDetail

The error detail.

Name Type Description
additionalInfo

ErrorAdditionalInfo[]

The error additional info.

code

string

The error code.

details

ErrorDetail[]

The error details.

message

string

The error message.

target

string

The error target.

ErrorResponse

Error response

Name Type Description
error

ErrorDetail

The error object.

ProvisioningState

Provisioning state

Name Type Description
Cancelled

string

ConfirmedBilling

string

Created

string

Creating

string

Expired

string

Failed

string

PendingBilling

string

Succeeded

string

SavingsPlanOrderAliasModel

Savings plan order alias

Name Type Default value Description
id

string

Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}

kind

string

Resource provider kind

name

string

The name of the resource

properties.appliedScopeProperties

AppliedScopeProperties

Properties specific to applied scope type. Not required if not applicable.

properties.appliedScopeType

AppliedScopeType

Type of the Applied Scope.

properties.billingPlan

BillingPlan

Represents the billing plan in ISO 8601 format. Required only for monthly billing plans.

properties.billingScopeId

string

Subscription that will be charged for purchasing the benefit

properties.commitment

Commitment

Commitment towards the benefit.

properties.displayName

string

Display name

properties.provisioningState

ProvisioningState

Provisioning state

properties.renew

boolean

False

Setting this to true will automatically purchase a new benefit on the expiration date time.

properties.savingsPlanOrderId

string

Identifier of the savings plan created

properties.term

Term

Represent benefit term in ISO 8601 format.

sku

Sku

Savings plan SKU

systemData

systemData

Azure Resource Manager metadata containing createdBy and modifiedBy information.

type

string

The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"

Sku

The SKU to be applied for this resource

Name Type Description
name

string

Name of the SKU to be applied

systemData

Metadata pertaining to creation and last modification of the resource.

Name Type Description
createdAt

string

The timestamp of resource creation (UTC).

createdBy

string

The identity that created the resource.

createdByType

createdByType

The type of identity that created the resource.

lastModifiedAt

string

The timestamp of resource last modification (UTC)

lastModifiedBy

string

The identity that last modified the resource.

lastModifiedByType

createdByType

The type of identity that last modified the resource.

Term

Represent benefit term in ISO 8601 format.

Name Type Description
P1Y

string

P3Y

string

P5Y

string