Configure Azure Billing Benefits Discounts

The azure-native:billingbenefits:Discount resource, part of the Pulumi Azure Native provider, defines billing discounts that apply negotiated rates, custom pricing, or partner agreements to Azure purchases. This guide focuses on four capabilities: affiliate discount registration, SKU-specific percentage discounts, custom pricing with market and currency controls, and price guarantee protection.

Discounts reference Azure product catalogs and may require partner agreements for affiliate types. The examples are intentionally small. Combine them with your own resource groups and billing scope configuration.

Create an affiliate discount with system ID

Organizations receiving discounts through partner programs register those agreements by referencing external system identifiers that track the discount in the partner’s billing system.

import * as pulumi from "@pulumi/pulumi";
import * as azure_native from "@pulumi/azure-native";

const discount = new azure_native.billingbenefits.Discount("discount", {
    discountName: "testaffiliatediscount",
    location: "global",
    properties: {
        displayName: "Virtual Machines D Series",
        entityType: "Affiliate",
        productCode: "0001d726-0000-0160-330f-a0b98cdbbdc4",
        startAt: "2023-07-01T00:00:00Z",
        systemId: "13810867107109237",
    },
    resourceGroupName: "testrg",
    tags: {
        key1: "value1",
        key2: "value2",
    },
});
import pulumi
import pulumi_azure_native as azure_native

discount = azure_native.billingbenefits.Discount("discount",
    discount_name="testaffiliatediscount",
    location="global",
    properties={
        "display_name": "Virtual Machines D Series",
        "entity_type": "Affiliate",
        "product_code": "0001d726-0000-0160-330f-a0b98cdbbdc4",
        "start_at": "2023-07-01T00:00:00Z",
        "system_id": "13810867107109237",
    },
    resource_group_name="testrg",
    tags={
        "key1": "value1",
        "key2": "value2",
    })
package main

import (
	billingbenefits "github.com/pulumi/pulumi-azure-native-sdk/billingbenefits/v3"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := billingbenefits.NewDiscount(ctx, "discount", &billingbenefits.DiscountArgs{
			DiscountName: pulumi.String("testaffiliatediscount"),
			Location:     pulumi.String("global"),
			Properties: &billingbenefits.EntityTypeAffiliateDiscountArgs{
				DisplayName: pulumi.String("Virtual Machines D Series"),
				EntityType:  pulumi.String("Affiliate"),
				ProductCode: pulumi.String("0001d726-0000-0160-330f-a0b98cdbbdc4"),
				StartAt:     pulumi.String("2023-07-01T00:00:00Z"),
				SystemId:    pulumi.String("13810867107109237"),
			},
			ResourceGroupName: pulumi.String("testrg"),
			Tags: pulumi.StringMap{
				"key1": pulumi.String("value1"),
				"key2": pulumi.String("value2"),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;

return await Deployment.RunAsync(() => 
{
    var discount = new AzureNative.BillingBenefits.Discount("discount", new()
    {
        DiscountName = "testaffiliatediscount",
        Location = "global",
        Properties = new AzureNative.BillingBenefits.Inputs.EntityTypeAffiliateDiscountArgs
        {
            DisplayName = "Virtual Machines D Series",
            EntityType = "Affiliate",
            ProductCode = "0001d726-0000-0160-330f-a0b98cdbbdc4",
            StartAt = "2023-07-01T00:00:00Z",
            SystemId = "13810867107109237",
        },
        ResourceGroupName = "testrg",
        Tags = 
        {
            { "key1", "value1" },
            { "key2", "value2" },
        },
    });

});
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.billingbenefits.Discount;
import com.pulumi.azurenative.billingbenefits.DiscountArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var discount = new Discount("discount", DiscountArgs.builder()
            .discountName("testaffiliatediscount")
            .location("global")
            .properties(EntityTypeAffiliateDiscountArgs.builder()
                .displayName("Virtual Machines D Series")
                .entityType("Affiliate")
                .productCode("0001d726-0000-0160-330f-a0b98cdbbdc4")
                .startAt("2023-07-01T00:00:00Z")
                .systemId("13810867107109237")
                .build())
            .resourceGroupName("testrg")
            .tags(Map.ofEntries(
                Map.entry("key1", "value1"),
                Map.entry("key2", "value2")
            ))
            .build());

    }
}
resources:
  discount:
    type: azure-native:billingbenefits:Discount
    properties:
      discountName: testaffiliatediscount
      location: global
      properties:
        displayName: Virtual Machines D Series
        entityType: Affiliate
        productCode: 0001d726-0000-0160-330f-a0b98cdbbdc4
        startAt: 2023-07-01T00:00:00Z
        systemId: '13810867107109237'
      resourceGroupName: testrg
      tags:
        key1: value1
        key2: value2

The entityType property distinguishes affiliate discounts from primary discounts. The systemId links this discount to the partner’s tracking system. The productCode identifies which Azure product receives the discount, and startAt defines when the discount becomes active. Affiliate discounts don’t include discount percentages or custom pricing; those terms are managed in the partner agreement.

Apply percentage discounts to specific SKUs

Billing administrators create primary discounts to apply negotiated rates across their organization, targeting specific products with conditions that filter qualifying purchases.

import * as pulumi from "@pulumi/pulumi";
import * as azure_native from "@pulumi/azure-native";

const discount = new azure_native.billingbenefits.Discount("discount", {
    discountName: "testprimarydiscount",
    location: "global",
    properties: {
        appliedScopeType: azure_native.billingbenefits.DiscountAppliedScopeType.BillingAccount,
        discountTypeProperties: {
            applyDiscountOn: azure_native.billingbenefits.ApplyDiscountOn.Purchase,
            conditions: [{
                conditionName: "Cloud",
                type: "equalAny",
                value: ["US-Sec"],
            }],
            discountCombinationRule: azure_native.billingbenefits.DiscountCombinationRule.BestOf,
            discountPercentage: 14,
            discountType: "Sku",
            productFamilyName: "Azure",
            productId: "DZH318Z0BQ35",
            skuId: "0001",
        },
        displayName: "Virtual Machines D Series",
        endAt: "2024-07-01T23:59:59Z",
        entityType: "Primary",
        productCode: "0001d726-0000-0160-330f-a0b98cdbbdc4",
        startAt: "2023-07-01T00:00:00Z",
    },
    resourceGroupName: "testrg",
    tags: {
        key1: "value1",
        key2: "value2",
    },
});
import pulumi
import pulumi_azure_native as azure_native

discount = azure_native.billingbenefits.Discount("discount",
    discount_name="testprimarydiscount",
    location="global",
    properties={
        "applied_scope_type": azure_native.billingbenefits.DiscountAppliedScopeType.BILLING_ACCOUNT,
        "discount_type_properties": {
            "apply_discount_on": azure_native.billingbenefits.ApplyDiscountOn.PURCHASE,
            "conditions": [{
                "condition_name": "Cloud",
                "type": "equalAny",
                "value": ["US-Sec"],
            }],
            "discount_combination_rule": azure_native.billingbenefits.DiscountCombinationRule.BEST_OF,
            "discount_percentage": 14,
            "discount_type": "Sku",
            "product_family_name": "Azure",
            "product_id": "DZH318Z0BQ35",
            "sku_id": "0001",
        },
        "display_name": "Virtual Machines D Series",
        "end_at": "2024-07-01T23:59:59Z",
        "entity_type": "Primary",
        "product_code": "0001d726-0000-0160-330f-a0b98cdbbdc4",
        "start_at": "2023-07-01T00:00:00Z",
    },
    resource_group_name="testrg",
    tags={
        "key1": "value1",
        "key2": "value2",
    })
package main

import (
	billingbenefits "github.com/pulumi/pulumi-azure-native-sdk/billingbenefits/v3"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := billingbenefits.NewDiscount(ctx, "discount", &billingbenefits.DiscountArgs{
			DiscountName: pulumi.String("testprimarydiscount"),
			Location:     pulumi.String("global"),
			Properties: &billingbenefits.EntityTypePrimaryDiscountArgs{
				AppliedScopeType: pulumi.String(billingbenefits.DiscountAppliedScopeTypeBillingAccount),
				DiscountTypeProperties: billingbenefits.DiscountTypeProductSku{
					ApplyDiscountOn: billingbenefits.ApplyDiscountOnPurchase,
					Conditions: []billingbenefits.ConditionsItem{
						{
							ConditionName: "Cloud",
							Type:          "equalAny",
							Value: []string{
								"US-Sec",
							},
						},
					},
					DiscountCombinationRule: billingbenefits.DiscountCombinationRuleBestOf,
					DiscountPercentage:      14,
					DiscountType:            "Sku",
					ProductFamilyName:       "Azure",
					ProductId:               "DZH318Z0BQ35",
					SkuId:                   "0001",
				},
				DisplayName: pulumi.String("Virtual Machines D Series"),
				EndAt:       pulumi.String("2024-07-01T23:59:59Z"),
				EntityType:  pulumi.String("Primary"),
				ProductCode: pulumi.String("0001d726-0000-0160-330f-a0b98cdbbdc4"),
				StartAt:     pulumi.String("2023-07-01T00:00:00Z"),
			},
			ResourceGroupName: pulumi.String("testrg"),
			Tags: pulumi.StringMap{
				"key1": pulumi.String("value1"),
				"key2": pulumi.String("value2"),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;

return await Deployment.RunAsync(() => 
{
    var discount = new AzureNative.BillingBenefits.Discount("discount", new()
    {
        DiscountName = "testprimarydiscount",
        Location = "global",
        Properties = new AzureNative.BillingBenefits.Inputs.EntityTypePrimaryDiscountArgs
        {
            AppliedScopeType = AzureNative.BillingBenefits.DiscountAppliedScopeType.BillingAccount,
            DiscountTypeProperties = new AzureNative.BillingBenefits.Inputs.DiscountTypeProductSkuArgs
            {
                ApplyDiscountOn = AzureNative.BillingBenefits.ApplyDiscountOn.Purchase,
                Conditions = new[]
                {
                    new AzureNative.BillingBenefits.Inputs.ConditionsItemArgs
                    {
                        ConditionName = "Cloud",
                        Type = "equalAny",
                        Value = new[]
                        {
                            "US-Sec",
                        },
                    },
                },
                DiscountCombinationRule = AzureNative.BillingBenefits.DiscountCombinationRule.BestOf,
                DiscountPercentage = 14,
                DiscountType = "Sku",
                ProductFamilyName = "Azure",
                ProductId = "DZH318Z0BQ35",
                SkuId = "0001",
            },
            DisplayName = "Virtual Machines D Series",
            EndAt = "2024-07-01T23:59:59Z",
            EntityType = "Primary",
            ProductCode = "0001d726-0000-0160-330f-a0b98cdbbdc4",
            StartAt = "2023-07-01T00:00:00Z",
        },
        ResourceGroupName = "testrg",
        Tags = 
        {
            { "key1", "value1" },
            { "key2", "value2" },
        },
    });

});
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.billingbenefits.Discount;
import com.pulumi.azurenative.billingbenefits.DiscountArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var discount = new Discount("discount", DiscountArgs.builder()
            .discountName("testprimarydiscount")
            .location("global")
            .properties(EntityTypePrimaryDiscountArgs.builder()
                .appliedScopeType("BillingAccount")
                .discountTypeProperties(DiscountTypeProductSkuArgs.builder()
                    .applyDiscountOn("Purchase")
                    .conditions(ConditionsItemArgs.builder()
                        .conditionName("Cloud")
                        .type("equalAny")
                        .value("US-Sec")
                        .build())
                    .discountCombinationRule("BestOf")
                    .discountPercentage(14)
                    .discountType("Sku")
                    .productFamilyName("Azure")
                    .productId("DZH318Z0BQ35")
                    .skuId("0001")
                    .build())
                .displayName("Virtual Machines D Series")
                .endAt("2024-07-01T23:59:59Z")
                .entityType("Primary")
                .productCode("0001d726-0000-0160-330f-a0b98cdbbdc4")
                .startAt("2023-07-01T00:00:00Z")
                .build())
            .resourceGroupName("testrg")
            .tags(Map.ofEntries(
                Map.entry("key1", "value1"),
                Map.entry("key2", "value2")
            ))
            .build());

    }
}
resources:
  discount:
    type: azure-native:billingbenefits:Discount
    properties:
      discountName: testprimarydiscount
      location: global
      properties:
        appliedScopeType: BillingAccount
        discountTypeProperties:
          applyDiscountOn: Purchase
          conditions:
            - conditionName: Cloud
              type: equalAny
              value:
                - US-Sec
          discountCombinationRule: BestOf
          discountPercentage: 14
          discountType: Sku
          productFamilyName: Azure
          productId: DZH318Z0BQ35
          skuId: '0001'
        displayName: Virtual Machines D Series
        endAt: 2024-07-01T23:59:59Z
        entityType: Primary
        productCode: 0001d726-0000-0160-330f-a0b98cdbbdc4
        startAt: 2023-07-01T00:00:00Z
      resourceGroupName: testrg
      tags:
        key1: value1
        key2: value2

The discountTypeProperties block defines how the discount applies. The discountPercentage sets the rate reduction (14% in this case). The conditions array filters purchases; here, it restricts the discount to the US-Sec cloud environment. The productId and skuId properties target specific VM offerings. The appliedScopeType determines whether the discount applies at the billing account level or to specific subscriptions.

Lock custom pricing for specific markets

Enterprise agreements sometimes include fixed pricing that overrides standard catalog rates, protecting against future price increases.

import * as pulumi from "@pulumi/pulumi";
import * as azure_native from "@pulumi/azure-native";

const discount = new azure_native.billingbenefits.Discount("discount", {
    discountName: "testprimarydiscount",
    location: "global",
    properties: {
        appliedScopeType: azure_native.billingbenefits.DiscountAppliedScopeType.BillingAccount,
        discountTypeProperties: {
            applyDiscountOn: azure_native.billingbenefits.ApplyDiscountOn.Purchase,
            conditions: [{
                conditionName: "Cloud",
                type: "equalAny",
                value: ["US-Sec"],
            }],
            customPriceProperties: {
                catalogClaims: [{
                    catalogClaimsItemType: "NationalCloud",
                    value: "USSec",
                }],
                catalogId: "4",
                marketSetPrices: [{
                    currency: "USD",
                    markets: ["US"],
                    value: 125.16,
                }],
                ruleType: azure_native.billingbenefits.DiscountRuleType.FixedPriceLock,
                termUnits: "ASI1251A",
            },
            discountCombinationRule: azure_native.billingbenefits.DiscountCombinationRule.BestOf,
            discountPercentage: 14,
            discountType: "CustomPrice",
            productFamilyName: "Azure",
            productId: "DZH318Z0BQ35",
            skuId: "0001",
        },
        displayName: "Virtual Machines D Series",
        endAt: "2024-07-01T23:59:59Z",
        entityType: "Primary",
        productCode: "0001d726-0000-0160-330f-a0b98cdbbdc4",
        startAt: "2023-07-01T00:00:00Z",
    },
    resourceGroupName: "testrg",
    tags: {
        key1: "value1",
        key2: "value2",
    },
});
import pulumi
import pulumi_azure_native as azure_native

discount = azure_native.billingbenefits.Discount("discount",
    discount_name="testprimarydiscount",
    location="global",
    properties={
        "applied_scope_type": azure_native.billingbenefits.DiscountAppliedScopeType.BILLING_ACCOUNT,
        "discount_type_properties": {
            "apply_discount_on": azure_native.billingbenefits.ApplyDiscountOn.PURCHASE,
            "conditions": [{
                "condition_name": "Cloud",
                "type": "equalAny",
                "value": ["US-Sec"],
            }],
            "custom_price_properties": {
                "catalog_claims": [{
                    "catalog_claims_item_type": "NationalCloud",
                    "value": "USSec",
                }],
                "catalog_id": "4",
                "market_set_prices": [{
                    "currency": "USD",
                    "markets": ["US"],
                    "value": 125.16,
                }],
                "rule_type": azure_native.billingbenefits.DiscountRuleType.FIXED_PRICE_LOCK,
                "term_units": "ASI1251A",
            },
            "discount_combination_rule": azure_native.billingbenefits.DiscountCombinationRule.BEST_OF,
            "discount_percentage": 14,
            "discount_type": "CustomPrice",
            "product_family_name": "Azure",
            "product_id": "DZH318Z0BQ35",
            "sku_id": "0001",
        },
        "display_name": "Virtual Machines D Series",
        "end_at": "2024-07-01T23:59:59Z",
        "entity_type": "Primary",
        "product_code": "0001d726-0000-0160-330f-a0b98cdbbdc4",
        "start_at": "2023-07-01T00:00:00Z",
    },
    resource_group_name="testrg",
    tags={
        "key1": "value1",
        "key2": "value2",
    })
package main

import (
	billingbenefits "github.com/pulumi/pulumi-azure-native-sdk/billingbenefits/v3"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := billingbenefits.NewDiscount(ctx, "discount", &billingbenefits.DiscountArgs{
			DiscountName: pulumi.String("testprimarydiscount"),
			Location:     pulumi.String("global"),
			Properties: &billingbenefits.EntityTypePrimaryDiscountArgs{
				AppliedScopeType: pulumi.String(billingbenefits.DiscountAppliedScopeTypeBillingAccount),
				DiscountTypeProperties: billingbenefits.DiscountCustomPrice{
					ApplyDiscountOn: billingbenefits.ApplyDiscountOnPurchase,
					Conditions: []billingbenefits.ConditionsItem{
						{
							ConditionName: "Cloud",
							Type:          "equalAny",
							Value: []string{
								"US-Sec",
							},
						},
					},
					CustomPriceProperties: billingbenefits.CustomPriceProperties{
						CatalogClaims: []billingbenefits.CatalogClaimsItem{
							{
								CatalogClaimsItemType: "NationalCloud",
								Value:                 "USSec",
							},
						},
						CatalogId: "4",
						MarketSetPrices: []billingbenefits.MarketSetPricesItems{
							{
								Currency: "USD",
								Markets: []string{
									"US",
								},
								Value: 125.16,
							},
						},
						RuleType:  billingbenefits.DiscountRuleTypeFixedPriceLock,
						TermUnits: "ASI1251A",
					},
					DiscountCombinationRule: billingbenefits.DiscountCombinationRuleBestOf,
					DiscountPercentage:      14,
					DiscountType:            "CustomPrice",
					ProductFamilyName:       "Azure",
					ProductId:               "DZH318Z0BQ35",
					SkuId:                   "0001",
				},
				DisplayName: pulumi.String("Virtual Machines D Series"),
				EndAt:       pulumi.String("2024-07-01T23:59:59Z"),
				EntityType:  pulumi.String("Primary"),
				ProductCode: pulumi.String("0001d726-0000-0160-330f-a0b98cdbbdc4"),
				StartAt:     pulumi.String("2023-07-01T00:00:00Z"),
			},
			ResourceGroupName: pulumi.String("testrg"),
			Tags: pulumi.StringMap{
				"key1": pulumi.String("value1"),
				"key2": pulumi.String("value2"),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;

return await Deployment.RunAsync(() => 
{
    var discount = new AzureNative.BillingBenefits.Discount("discount", new()
    {
        DiscountName = "testprimarydiscount",
        Location = "global",
        Properties = new AzureNative.BillingBenefits.Inputs.EntityTypePrimaryDiscountArgs
        {
            AppliedScopeType = AzureNative.BillingBenefits.DiscountAppliedScopeType.BillingAccount,
            DiscountTypeProperties = new AzureNative.BillingBenefits.Inputs.DiscountCustomPriceArgs
            {
                ApplyDiscountOn = AzureNative.BillingBenefits.ApplyDiscountOn.Purchase,
                Conditions = new[]
                {
                    new AzureNative.BillingBenefits.Inputs.ConditionsItemArgs
                    {
                        ConditionName = "Cloud",
                        Type = "equalAny",
                        Value = new[]
                        {
                            "US-Sec",
                        },
                    },
                },
                CustomPriceProperties = new AzureNative.BillingBenefits.Inputs.CustomPricePropertiesArgs
                {
                    CatalogClaims = new[]
                    {
                        new AzureNative.BillingBenefits.Inputs.CatalogClaimsItemArgs
                        {
                            CatalogClaimsItemType = "NationalCloud",
                            Value = "USSec",
                        },
                    },
                    CatalogId = "4",
                    MarketSetPrices = new[]
                    {
                        new AzureNative.BillingBenefits.Inputs.MarketSetPricesItemsArgs
                        {
                            Currency = "USD",
                            Markets = new[]
                            {
                                "US",
                            },
                            Value = 125.16,
                        },
                    },
                    RuleType = AzureNative.BillingBenefits.DiscountRuleType.FixedPriceLock,
                    TermUnits = "ASI1251A",
                },
                DiscountCombinationRule = AzureNative.BillingBenefits.DiscountCombinationRule.BestOf,
                DiscountPercentage = 14,
                DiscountType = "CustomPrice",
                ProductFamilyName = "Azure",
                ProductId = "DZH318Z0BQ35",
                SkuId = "0001",
            },
            DisplayName = "Virtual Machines D Series",
            EndAt = "2024-07-01T23:59:59Z",
            EntityType = "Primary",
            ProductCode = "0001d726-0000-0160-330f-a0b98cdbbdc4",
            StartAt = "2023-07-01T00:00:00Z",
        },
        ResourceGroupName = "testrg",
        Tags = 
        {
            { "key1", "value1" },
            { "key2", "value2" },
        },
    });

});
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.billingbenefits.Discount;
import com.pulumi.azurenative.billingbenefits.DiscountArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var discount = new Discount("discount", DiscountArgs.builder()
            .discountName("testprimarydiscount")
            .location("global")
            .properties(EntityTypePrimaryDiscountArgs.builder()
                .appliedScopeType("BillingAccount")
                .discountTypeProperties(DiscountCustomPriceArgs.builder()
                    .applyDiscountOn("Purchase")
                    .conditions(ConditionsItemArgs.builder()
                        .conditionName("Cloud")
                        .type("equalAny")
                        .value("US-Sec")
                        .build())
                    .customPriceProperties(CustomPricePropertiesArgs.builder()
                        .catalogClaims(CatalogClaimsItemArgs.builder()
                            .catalogClaimsItemType("NationalCloud")
                            .value("USSec")
                            .build())
                        .catalogId("4")
                        .marketSetPrices(MarketSetPricesItemsArgs.builder()
                            .currency("USD")
                            .markets("US")
                            .value(125.16)
                            .build())
                        .ruleType("FixedPriceLock")
                        .termUnits("ASI1251A")
                        .build())
                    .discountCombinationRule("BestOf")
                    .discountPercentage(14)
                    .discountType("CustomPrice")
                    .productFamilyName("Azure")
                    .productId("DZH318Z0BQ35")
                    .skuId("0001")
                    .build())
                .displayName("Virtual Machines D Series")
                .endAt("2024-07-01T23:59:59Z")
                .entityType("Primary")
                .productCode("0001d726-0000-0160-330f-a0b98cdbbdc4")
                .startAt("2023-07-01T00:00:00Z")
                .build())
            .resourceGroupName("testrg")
            .tags(Map.ofEntries(
                Map.entry("key1", "value1"),
                Map.entry("key2", "value2")
            ))
            .build());

    }
}
resources:
  discount:
    type: azure-native:billingbenefits:Discount
    properties:
      discountName: testprimarydiscount
      location: global
      properties:
        appliedScopeType: BillingAccount
        discountTypeProperties:
          applyDiscountOn: Purchase
          conditions:
            - conditionName: Cloud
              type: equalAny
              value:
                - US-Sec
          customPriceProperties:
            catalogClaims:
              - catalogClaimsItemType: NationalCloud
                value: USSec
            catalogId: '4'
            marketSetPrices:
              - currency: USD
                markets:
                  - US
                value: 125.16
            ruleType: FixedPriceLock
            termUnits: ASI1251A
          discountCombinationRule: BestOf
          discountPercentage: 14
          discountType: CustomPrice
          productFamilyName: Azure
          productId: DZH318Z0BQ35
          skuId: '0001'
        displayName: Virtual Machines D Series
        endAt: 2024-07-01T23:59:59Z
        entityType: Primary
        productCode: 0001d726-0000-0160-330f-a0b98cdbbdc4
        startAt: 2023-07-01T00:00:00Z
      resourceGroupName: testrg
      tags:
        key1: value1
        key2: value2

Custom price discounts use the customPriceProperties block instead of discountPercentage. The marketSetPrices array specifies the locked price ($125.16) and which markets it applies to (US). The ruleType of FixedPriceLock prevents price increases. The catalogId and termUnits reference the Azure pricing catalog structure. This configuration replaces percentage-based discounts with absolute pricing control.

Set custom pricing across multiple currencies

Global organizations with operations in multiple regions lock pricing in different currencies, specifying rates for each market independently.

import * as pulumi from "@pulumi/pulumi";
import * as azure_native from "@pulumi/azure-native";

const discount = new azure_native.billingbenefits.Discount("discount", {
    discountName: "testprimarydiscount",
    location: "global",
    properties: {
        appliedScopeType: azure_native.billingbenefits.DiscountAppliedScopeType.BillingAccount,
        discountTypeProperties: {
            applyDiscountOn: azure_native.billingbenefits.ApplyDiscountOn.Purchase,
            conditions: [{
                conditionName: "Cloud",
                type: "equalAny",
                value: ["US-Sec"],
            }],
            customPriceProperties: {
                catalogClaims: [{
                    catalogClaimsItemType: "NationalCloud",
                    value: "USSec",
                }],
                catalogId: "4",
                marketSetPrices: [
                    {
                        currency: "USD",
                        markets: ["US"],
                        value: 125.16,
                    },
                    {
                        currency: "EUR",
                        markets: ["FR"],
                        value: 110.16,
                    },
                ],
                ruleType: azure_native.billingbenefits.DiscountRuleType.FixedPriceLock,
                termUnits: "ASI1251A",
            },
            discountCombinationRule: azure_native.billingbenefits.DiscountCombinationRule.BestOf,
            discountPercentage: 14,
            discountType: "CustomPriceMultiCurrency",
            productFamilyName: "Azure",
            productId: "DZH318Z0BQ35",
            skuId: "0001",
        },
        displayName: "Virtual Machines D Series",
        endAt: "2024-07-01T23:59:59Z",
        entityType: "Primary",
        productCode: "0001d726-0000-0160-330f-a0b98cdbbdc4",
        startAt: "2023-07-01T00:00:00Z",
    },
    resourceGroupName: "testrg",
    tags: {
        key1: "value1",
        key2: "value2",
    },
});
import pulumi
import pulumi_azure_native as azure_native

discount = azure_native.billingbenefits.Discount("discount",
    discount_name="testprimarydiscount",
    location="global",
    properties={
        "applied_scope_type": azure_native.billingbenefits.DiscountAppliedScopeType.BILLING_ACCOUNT,
        "discount_type_properties": {
            "apply_discount_on": azure_native.billingbenefits.ApplyDiscountOn.PURCHASE,
            "conditions": [{
                "condition_name": "Cloud",
                "type": "equalAny",
                "value": ["US-Sec"],
            }],
            "custom_price_properties": {
                "catalog_claims": [{
                    "catalog_claims_item_type": "NationalCloud",
                    "value": "USSec",
                }],
                "catalog_id": "4",
                "market_set_prices": [
                    {
                        "currency": "USD",
                        "markets": ["US"],
                        "value": 125.16,
                    },
                    {
                        "currency": "EUR",
                        "markets": ["FR"],
                        "value": 110.16,
                    },
                ],
                "rule_type": azure_native.billingbenefits.DiscountRuleType.FIXED_PRICE_LOCK,
                "term_units": "ASI1251A",
            },
            "discount_combination_rule": azure_native.billingbenefits.DiscountCombinationRule.BEST_OF,
            "discount_percentage": 14,
            "discount_type": "CustomPriceMultiCurrency",
            "product_family_name": "Azure",
            "product_id": "DZH318Z0BQ35",
            "sku_id": "0001",
        },
        "display_name": "Virtual Machines D Series",
        "end_at": "2024-07-01T23:59:59Z",
        "entity_type": "Primary",
        "product_code": "0001d726-0000-0160-330f-a0b98cdbbdc4",
        "start_at": "2023-07-01T00:00:00Z",
    },
    resource_group_name="testrg",
    tags={
        "key1": "value1",
        "key2": "value2",
    })
package main

import (
	billingbenefits "github.com/pulumi/pulumi-azure-native-sdk/billingbenefits/v3"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := billingbenefits.NewDiscount(ctx, "discount", &billingbenefits.DiscountArgs{
			DiscountName: pulumi.String("testprimarydiscount"),
			Location:     pulumi.String("global"),
			Properties: &billingbenefits.EntityTypePrimaryDiscountArgs{
				AppliedScopeType: pulumi.String(billingbenefits.DiscountAppliedScopeTypeBillingAccount),
				DiscountTypeProperties: billingbenefits.DiscountCustomPriceMultiCurrency{
					ApplyDiscountOn: billingbenefits.ApplyDiscountOnPurchase,
					Conditions: []billingbenefits.ConditionsItem{
						{
							ConditionName: "Cloud",
							Type:          "equalAny",
							Value: []string{
								"US-Sec",
							},
						},
					},
					CustomPriceProperties: billingbenefits.CustomPriceProperties{
						CatalogClaims: []billingbenefits.CatalogClaimsItem{
							{
								CatalogClaimsItemType: "NationalCloud",
								Value:                 "USSec",
							},
						},
						CatalogId: "4",
						MarketSetPrices: []billingbenefits.MarketSetPricesItems{
							{
								Currency: "USD",
								Markets: []string{
									"US",
								},
								Value: 125.16,
							},
							{
								Currency: "EUR",
								Markets: []string{
									"FR",
								},
								Value: 110.16,
							},
						},
						RuleType:  billingbenefits.DiscountRuleTypeFixedPriceLock,
						TermUnits: "ASI1251A",
					},
					DiscountCombinationRule: billingbenefits.DiscountCombinationRuleBestOf,
					DiscountPercentage:      14,
					DiscountType:            "CustomPriceMultiCurrency",
					ProductFamilyName:       "Azure",
					ProductId:               "DZH318Z0BQ35",
					SkuId:                   "0001",
				},
				DisplayName: pulumi.String("Virtual Machines D Series"),
				EndAt:       pulumi.String("2024-07-01T23:59:59Z"),
				EntityType:  pulumi.String("Primary"),
				ProductCode: pulumi.String("0001d726-0000-0160-330f-a0b98cdbbdc4"),
				StartAt:     pulumi.String("2023-07-01T00:00:00Z"),
			},
			ResourceGroupName: pulumi.String("testrg"),
			Tags: pulumi.StringMap{
				"key1": pulumi.String("value1"),
				"key2": pulumi.String("value2"),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;

return await Deployment.RunAsync(() => 
{
    var discount = new AzureNative.BillingBenefits.Discount("discount", new()
    {
        DiscountName = "testprimarydiscount",
        Location = "global",
        Properties = new AzureNative.BillingBenefits.Inputs.EntityTypePrimaryDiscountArgs
        {
            AppliedScopeType = AzureNative.BillingBenefits.DiscountAppliedScopeType.BillingAccount,
            DiscountTypeProperties = new AzureNative.BillingBenefits.Inputs.DiscountCustomPriceMultiCurrencyArgs
            {
                ApplyDiscountOn = AzureNative.BillingBenefits.ApplyDiscountOn.Purchase,
                Conditions = new[]
                {
                    new AzureNative.BillingBenefits.Inputs.ConditionsItemArgs
                    {
                        ConditionName = "Cloud",
                        Type = "equalAny",
                        Value = new[]
                        {
                            "US-Sec",
                        },
                    },
                },
                CustomPriceProperties = new AzureNative.BillingBenefits.Inputs.CustomPricePropertiesArgs
                {
                    CatalogClaims = new[]
                    {
                        new AzureNative.BillingBenefits.Inputs.CatalogClaimsItemArgs
                        {
                            CatalogClaimsItemType = "NationalCloud",
                            Value = "USSec",
                        },
                    },
                    CatalogId = "4",
                    MarketSetPrices = new[]
                    {
                        new AzureNative.BillingBenefits.Inputs.MarketSetPricesItemsArgs
                        {
                            Currency = "USD",
                            Markets = new[]
                            {
                                "US",
                            },
                            Value = 125.16,
                        },
                        new AzureNative.BillingBenefits.Inputs.MarketSetPricesItemsArgs
                        {
                            Currency = "EUR",
                            Markets = new[]
                            {
                                "FR",
                            },
                            Value = 110.16,
                        },
                    },
                    RuleType = AzureNative.BillingBenefits.DiscountRuleType.FixedPriceLock,
                    TermUnits = "ASI1251A",
                },
                DiscountCombinationRule = AzureNative.BillingBenefits.DiscountCombinationRule.BestOf,
                DiscountPercentage = 14,
                DiscountType = "CustomPriceMultiCurrency",
                ProductFamilyName = "Azure",
                ProductId = "DZH318Z0BQ35",
                SkuId = "0001",
            },
            DisplayName = "Virtual Machines D Series",
            EndAt = "2024-07-01T23:59:59Z",
            EntityType = "Primary",
            ProductCode = "0001d726-0000-0160-330f-a0b98cdbbdc4",
            StartAt = "2023-07-01T00:00:00Z",
        },
        ResourceGroupName = "testrg",
        Tags = 
        {
            { "key1", "value1" },
            { "key2", "value2" },
        },
    });

});
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.billingbenefits.Discount;
import com.pulumi.azurenative.billingbenefits.DiscountArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var discount = new Discount("discount", DiscountArgs.builder()
            .discountName("testprimarydiscount")
            .location("global")
            .properties(EntityTypePrimaryDiscountArgs.builder()
                .appliedScopeType("BillingAccount")
                .discountTypeProperties(DiscountCustomPriceMultiCurrencyArgs.builder()
                    .applyDiscountOn("Purchase")
                    .conditions(ConditionsItemArgs.builder()
                        .conditionName("Cloud")
                        .type("equalAny")
                        .value("US-Sec")
                        .build())
                    .customPriceProperties(CustomPricePropertiesArgs.builder()
                        .catalogClaims(CatalogClaimsItemArgs.builder()
                            .catalogClaimsItemType("NationalCloud")
                            .value("USSec")
                            .build())
                        .catalogId("4")
                        .marketSetPrices(                        
                            MarketSetPricesItemsArgs.builder()
                                .currency("USD")
                                .markets("US")
                                .value(125.16)
                                .build(),
                            MarketSetPricesItemsArgs.builder()
                                .currency("EUR")
                                .markets("FR")
                                .value(110.16)
                                .build())
                        .ruleType("FixedPriceLock")
                        .termUnits("ASI1251A")
                        .build())
                    .discountCombinationRule("BestOf")
                    .discountPercentage(14)
                    .discountType("CustomPriceMultiCurrency")
                    .productFamilyName("Azure")
                    .productId("DZH318Z0BQ35")
                    .skuId("0001")
                    .build())
                .displayName("Virtual Machines D Series")
                .endAt("2024-07-01T23:59:59Z")
                .entityType("Primary")
                .productCode("0001d726-0000-0160-330f-a0b98cdbbdc4")
                .startAt("2023-07-01T00:00:00Z")
                .build())
            .resourceGroupName("testrg")
            .tags(Map.ofEntries(
                Map.entry("key1", "value1"),
                Map.entry("key2", "value2")
            ))
            .build());

    }
}
resources:
  discount:
    type: azure-native:billingbenefits:Discount
    properties:
      discountName: testprimarydiscount
      location: global
      properties:
        appliedScopeType: BillingAccount
        discountTypeProperties:
          applyDiscountOn: Purchase
          conditions:
            - conditionName: Cloud
              type: equalAny
              value:
                - US-Sec
          customPriceProperties:
            catalogClaims:
              - catalogClaimsItemType: NationalCloud
                value: USSec
            catalogId: '4'
            marketSetPrices:
              - currency: USD
                markets:
                  - US
                value: 125.16
              - currency: EUR
                markets:
                  - FR
                value: 110.16
            ruleType: FixedPriceLock
            termUnits: ASI1251A
          discountCombinationRule: BestOf
          discountPercentage: 14
          discountType: CustomPriceMultiCurrency
          productFamilyName: Azure
          productId: DZH318Z0BQ35
          skuId: '0001'
        displayName: Virtual Machines D Series
        endAt: 2024-07-01T23:59:59Z
        entityType: Primary
        productCode: 0001d726-0000-0160-330f-a0b98cdbbdc4
        startAt: 2023-07-01T00:00:00Z
      resourceGroupName: testrg
      tags:
        key1: value1
        key2: value2

The marketSetPrices array accepts multiple entries, each with its own currency and markets. This example locks USD pricing at $125.16 for the US market and EUR pricing at €110.16 for France. Each market-currency pair operates independently, allowing you to reflect regional pricing agreements without converting between currencies.

Protect against price increases with guarantees

Organizations planning long-term deployments protect their budgets by locking in current pricing until a specified date.

import * as pulumi from "@pulumi/pulumi";
import * as azure_native from "@pulumi/azure-native";

const discount = new azure_native.billingbenefits.Discount("discount", {
    discountName: "testprimarydiscount",
    location: "global",
    properties: {
        appliedScopeType: azure_native.billingbenefits.DiscountAppliedScopeType.BillingAccount,
        discountTypeProperties: {
            applyDiscountOn: azure_native.billingbenefits.ApplyDiscountOn.Purchase,
            conditions: [{
                conditionName: "Cloud",
                type: "equalAny",
                value: ["US-Sec"],
            }],
            discountCombinationRule: azure_native.billingbenefits.DiscountCombinationRule.BestOf,
            discountType: "Sku",
            priceGuaranteeProperties: {
                priceGuaranteeDate: "2024-11-01T00:00:00",
                pricingPolicy: azure_native.billingbenefits.PricingPolicy.Protected,
            },
            productFamilyName: "Azure",
            productId: "DZH318Z0BQ35",
            skuId: "0001",
        },
        displayName: "Virtual Machines D Series",
        endAt: "2024-07-01T23:59:59Z",
        entityType: "Primary",
        productCode: "0001d726-0000-0160-330f-a0b98cdbbdc4",
        startAt: "2023-07-01T00:00:00Z",
    },
    resourceGroupName: "testrg",
    tags: {
        key1: "value1",
        key2: "value2",
    },
});
import pulumi
import pulumi_azure_native as azure_native

discount = azure_native.billingbenefits.Discount("discount",
    discount_name="testprimarydiscount",
    location="global",
    properties={
        "applied_scope_type": azure_native.billingbenefits.DiscountAppliedScopeType.BILLING_ACCOUNT,
        "discount_type_properties": {
            "apply_discount_on": azure_native.billingbenefits.ApplyDiscountOn.PURCHASE,
            "conditions": [{
                "condition_name": "Cloud",
                "type": "equalAny",
                "value": ["US-Sec"],
            }],
            "discount_combination_rule": azure_native.billingbenefits.DiscountCombinationRule.BEST_OF,
            "discount_type": "Sku",
            "price_guarantee_properties": {
                "price_guarantee_date": "2024-11-01T00:00:00",
                "pricing_policy": azure_native.billingbenefits.PricingPolicy.PROTECTED,
            },
            "product_family_name": "Azure",
            "product_id": "DZH318Z0BQ35",
            "sku_id": "0001",
        },
        "display_name": "Virtual Machines D Series",
        "end_at": "2024-07-01T23:59:59Z",
        "entity_type": "Primary",
        "product_code": "0001d726-0000-0160-330f-a0b98cdbbdc4",
        "start_at": "2023-07-01T00:00:00Z",
    },
    resource_group_name="testrg",
    tags={
        "key1": "value1",
        "key2": "value2",
    })
package main

import (
	billingbenefits "github.com/pulumi/pulumi-azure-native-sdk/billingbenefits/v3"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := billingbenefits.NewDiscount(ctx, "discount", &billingbenefits.DiscountArgs{
			DiscountName: pulumi.String("testprimarydiscount"),
			Location:     pulumi.String("global"),
			Properties: &billingbenefits.EntityTypePrimaryDiscountArgs{
				AppliedScopeType: pulumi.String(billingbenefits.DiscountAppliedScopeTypeBillingAccount),
				DiscountTypeProperties: billingbenefits.DiscountTypeProductSku{
					ApplyDiscountOn: billingbenefits.ApplyDiscountOnPurchase,
					Conditions: []billingbenefits.ConditionsItem{
						{
							ConditionName: "Cloud",
							Type:          "equalAny",
							Value: []string{
								"US-Sec",
							},
						},
					},
					DiscountCombinationRule: billingbenefits.DiscountCombinationRuleBestOf,
					DiscountType:            "Sku",
					PriceGuaranteeProperties: billingbenefits.PriceGuaranteeProperties{
						PriceGuaranteeDate: "2024-11-01T00:00:00",
						PricingPolicy:      billingbenefits.PricingPolicyProtected,
					},
					ProductFamilyName: "Azure",
					ProductId:         "DZH318Z0BQ35",
					SkuId:             "0001",
				},
				DisplayName: pulumi.String("Virtual Machines D Series"),
				EndAt:       pulumi.String("2024-07-01T23:59:59Z"),
				EntityType:  pulumi.String("Primary"),
				ProductCode: pulumi.String("0001d726-0000-0160-330f-a0b98cdbbdc4"),
				StartAt:     pulumi.String("2023-07-01T00:00:00Z"),
			},
			ResourceGroupName: pulumi.String("testrg"),
			Tags: pulumi.StringMap{
				"key1": pulumi.String("value1"),
				"key2": pulumi.String("value2"),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;

return await Deployment.RunAsync(() => 
{
    var discount = new AzureNative.BillingBenefits.Discount("discount", new()
    {
        DiscountName = "testprimarydiscount",
        Location = "global",
        Properties = new AzureNative.BillingBenefits.Inputs.EntityTypePrimaryDiscountArgs
        {
            AppliedScopeType = AzureNative.BillingBenefits.DiscountAppliedScopeType.BillingAccount,
            DiscountTypeProperties = new AzureNative.BillingBenefits.Inputs.DiscountTypeProductSkuArgs
            {
                ApplyDiscountOn = AzureNative.BillingBenefits.ApplyDiscountOn.Purchase,
                Conditions = new[]
                {
                    new AzureNative.BillingBenefits.Inputs.ConditionsItemArgs
                    {
                        ConditionName = "Cloud",
                        Type = "equalAny",
                        Value = new[]
                        {
                            "US-Sec",
                        },
                    },
                },
                DiscountCombinationRule = AzureNative.BillingBenefits.DiscountCombinationRule.BestOf,
                DiscountType = "Sku",
                PriceGuaranteeProperties = new AzureNative.BillingBenefits.Inputs.PriceGuaranteePropertiesArgs
                {
                    PriceGuaranteeDate = "2024-11-01T00:00:00",
                    PricingPolicy = AzureNative.BillingBenefits.PricingPolicy.Protected,
                },
                ProductFamilyName = "Azure",
                ProductId = "DZH318Z0BQ35",
                SkuId = "0001",
            },
            DisplayName = "Virtual Machines D Series",
            EndAt = "2024-07-01T23:59:59Z",
            EntityType = "Primary",
            ProductCode = "0001d726-0000-0160-330f-a0b98cdbbdc4",
            StartAt = "2023-07-01T00:00:00Z",
        },
        ResourceGroupName = "testrg",
        Tags = 
        {
            { "key1", "value1" },
            { "key2", "value2" },
        },
    });

});
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.billingbenefits.Discount;
import com.pulumi.azurenative.billingbenefits.DiscountArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var discount = new Discount("discount", DiscountArgs.builder()
            .discountName("testprimarydiscount")
            .location("global")
            .properties(EntityTypePrimaryDiscountArgs.builder()
                .appliedScopeType("BillingAccount")
                .discountTypeProperties(DiscountTypeProductSkuArgs.builder()
                    .applyDiscountOn("Purchase")
                    .conditions(ConditionsItemArgs.builder()
                        .conditionName("Cloud")
                        .type("equalAny")
                        .value("US-Sec")
                        .build())
                    .discountCombinationRule("BestOf")
                    .discountType("Sku")
                    .priceGuaranteeProperties(PriceGuaranteePropertiesArgs.builder()
                        .priceGuaranteeDate("2024-11-01T00:00:00")
                        .pricingPolicy("Protected")
                        .build())
                    .productFamilyName("Azure")
                    .productId("DZH318Z0BQ35")
                    .skuId("0001")
                    .build())
                .displayName("Virtual Machines D Series")
                .endAt("2024-07-01T23:59:59Z")
                .entityType("Primary")
                .productCode("0001d726-0000-0160-330f-a0b98cdbbdc4")
                .startAt("2023-07-01T00:00:00Z")
                .build())
            .resourceGroupName("testrg")
            .tags(Map.ofEntries(
                Map.entry("key1", "value1"),
                Map.entry("key2", "value2")
            ))
            .build());

    }
}
resources:
  discount:
    type: azure-native:billingbenefits:Discount
    properties:
      discountName: testprimarydiscount
      location: global
      properties:
        appliedScopeType: BillingAccount
        discountTypeProperties:
          applyDiscountOn: Purchase
          conditions:
            - conditionName: Cloud
              type: equalAny
              value:
                - US-Sec
          discountCombinationRule: BestOf
          discountType: Sku
          priceGuaranteeProperties:
            priceGuaranteeDate: 2024-11-01T00:00:00
            pricingPolicy: Protected
          productFamilyName: Azure
          productId: DZH318Z0BQ35
          skuId: '0001'
        displayName: Virtual Machines D Series
        endAt: 2024-07-01T23:59:59Z
        entityType: Primary
        productCode: 0001d726-0000-0160-330f-a0b98cdbbdc4
        startAt: 2023-07-01T00:00:00Z
      resourceGroupName: testrg
      tags:
        key1: value1
        key2: value2

The priceGuaranteeProperties block sets a priceGuaranteeDate (November 1, 2024) and pricingPolicy (Protected). This prevents rate increases even if catalog prices rise. Unlike custom pricing, price guarantees don’t specify absolute prices; they lock in whatever the current rate is at the time the discount activates. The discount still targets specific products via productId and skuId.

Beyond these examples

These snippets focus on specific discount-level features: affiliate and primary discount types, percentage-based and custom pricing models, and price guarantees and market-specific rates. They’re intentionally minimal rather than full billing management solutions.

The examples may reference pre-existing infrastructure such as Azure resource groups, partner agreements with system IDs (for affiliate discounts), and product codes and SKU IDs from the Azure catalog. They focus on configuring the discount rather than provisioning the surrounding billing infrastructure.

To keep things focused, common discount patterns are omitted, including:

  • Discount scope targeting (appliedScopes for subscription/resource group level)
  • Discount combination rules beyond BestOf
  • Product family-level discounts (DiscountProductFamily type)
  • Backfill scenarios with systemId for primary discounts

These omissions are intentional: the goal is to illustrate how each discount feature is wired, not provide drop-in billing modules. See the Discount resource reference for all available configuration options.

Let's configure Azure Billing Benefits Discounts

Get started with Pulumi Cloud, then follow our quick setup guide to deploy this infrastructure.

Try Pulumi Cloud for FREE

Frequently Asked Questions

Discount Types & Configuration
What's the difference between Affiliate and Primary discounts?
Affiliate discounts are simpler partner discounts requiring systemId, displayName, productCode, and startAt. Primary discounts offer advanced configuration including discount percentages, conditions, combination rules, and multiple pricing options.
What discount types are available for Primary discounts?

Primary discounts support four types via discountType:

  1. Sku - Targets specific product SKU with productId and skuId
  2. ProductFamily - Targets entire product family with productFamilyName
  3. CustomPrice - Fixed pricing with catalog claims and market prices
  4. CustomPriceMultiCurrency - Custom pricing with multiple currency support
How do I filter which resources receive a discount?
Use the conditions array within discountTypeProperties. Each condition has conditionName, type (typically “equalAny”), and value array. For example, to filter by cloud environment, use conditionName: "Cloud" with value: ["US-Sec"].
Pricing & Scope
How do I set up custom pricing for a discount?
Set discountType to “CustomPrice” and configure customPriceProperties with catalogId, catalogClaims (e.g., NationalCloud), marketSetPrices (currency, markets, value), ruleType (e.g., “FixedPriceLock”), and termUnits.
Can I apply different prices for different currencies?
Yes, use discountType: "CustomPriceMultiCurrency" and specify multiple entries in marketSetPrices. Each entry includes currency (e.g., “USD”, “EUR”), markets array (e.g., [“US”], [“FR”]), and value.
What does appliedScopeType control?
appliedScopeType determines where the discount applies. Examples show “BillingAccount” as the scope, applying the discount at the billing account level.
Time & Lifecycle
How do I set the validity period for a discount?
Use startAt and endAt properties with ISO 8601 formatted timestamps (e.g., “2023-07-01T00:00:00Z” and “2024-07-01T23:59:59Z”). Affiliate discounts require only startAt, while Primary discounts typically include both.
What properties can't be changed after creation?
The following properties are immutable: location, discountName, resourceGroupName, and kind. These cannot be modified after the discount is created.
Advanced Features
What is price guarantee and how do I enable it?
Price guarantee protects against price increases. Configure priceGuaranteeProperties within discountTypeProperties with priceGuaranteeDate (ISO 8601 timestamp) and pricingPolicy set to “Protected”.
Why is location always set to 'global'?
Discount resources are global resources and must have location: "global". This property is immutable and cannot be changed after creation.

Using a different cloud?

Explore integration guides for other cloud providers: