The azure-native:billingbenefits:Discount resource, part of the Pulumi Azure Native provider, defines billing discounts that reduce costs for Azure products based on negotiated agreements, SKU-level rules, or custom pricing arrangements. This guide focuses on three capabilities: affiliate discount tracking with external systems, SKU-level discounts with conditional filtering, and custom pricing locks and price guarantees.
Discounts reference product codes and SKU IDs from the Azure catalog, and affiliate discounts may reference external partner system IDs. The examples are intentionally small. Combine them with your own billing account structure and product catalog references.
Create an affiliate discount with external system tracking
Organizations that manage discounts through external partner systems need to track those agreements in Azure while maintaining references to the originating 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 set to “Affiliate” indicates this discount originates from an external partner system. The systemId links back to that external system’s identifier, while productCode identifies which Azure product receives the discount. The startAt timestamp defines when the discount becomes active.
Apply SKU-level discounts with conditional filtering
Billing teams often negotiate discounts that apply to specific SKUs within a product family, with conditions that limit where the discount applies.
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 a SKU-level discount (discountType: “Sku”) that applies a 14% reduction to purchases. The conditions array filters where the discount applies; here, it targets the “US-Sec” cloud environment. The appliedScopeType set to “BillingAccount” means the discount applies across the entire billing account. The discountCombinationRule determines how this discount interacts with others when multiple discounts could apply.
Lock custom pricing for specific markets and catalogs
Enterprise agreements sometimes include negotiated fixed prices that override standard catalog pricing, with specific terms tied to market regions and catalog versions.
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
The customPriceProperties block defines fixed pricing that overrides catalog rates. The marketSetPrices array specifies the locked price (125.16 USD) for designated markets (US). The ruleType set to “FixedPriceLock” prevents price increases, while catalogId and termUnits tie the pricing to specific catalog versions and term structures. The catalogClaims array adds metadata about which national cloud environment this pricing applies to.
Protect against price increases with guarantee dates
Long-term commitments often include price protection clauses that shield customers from catalog price increases 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 locks current pricing until the priceGuaranteeDate. The pricingPolicy set to “Protected” prevents catalog price increases from affecting this discount. This configuration doesn’t specify a discount percentage; instead, it guarantees that whatever pricing is in effect at the start date remains unchanged until the guarantee expires.
Beyond these examples
These snippets focus on specific discount-level features: affiliate and primary discount entity types, SKU-level and custom pricing models, and conditional filtering and price guarantees. They’re intentionally minimal rather than full billing management solutions.
The examples may reference pre-existing infrastructure such as Azure resource groups, product codes and SKU IDs from the Azure catalog, and external partner system IDs for affiliate discounts. They focus on configuring the discount rather than provisioning the surrounding billing infrastructure.
To keep things focused, common discount patterns are omitted, including:
- Product family-level discounts (DiscountProductFamily type)
- Multi-currency custom pricing (DiscountCustomPriceMultiCurrency type)
- Backfill scenarios with systemId for primary discounts
- Applied scope variations (Shared, Single, ManagementGroup)
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 FREEFrequently Asked Questions
Discount Types & Structure
displayName, productCode, startAt, and systemId. Primary discounts include detailed configuration like appliedScopeType, discountTypeProperties with conditions, discount percentages, and optional endAt timestamps.discountType: Sku (specific SKU-level), ProductFamily (product family-level), CustomPrice (fixed price in single currency), and CustomPriceMultiCurrency (fixed prices across multiple currencies).entityType to Primary, use discountType of Sku, and specify both productId and skuId within discountTypeProperties.Scope & Targeting
appliedScopeType to define the scope. Examples show BillingAccount as the scope for Primary discounts.conditions with conditionName set to Cloud, type as equalAny, and a value array containing cloud identifiers like US-Sec.location of global across all examples, and this property is immutable after creation.Pricing & Guarantees
discountType of CustomPrice with customPriceProperties containing catalogId, marketSetPrices (with currency, markets, and value), ruleType, and termUnits.discountType of CustomPriceMultiCurrency and provide multiple entries in marketSetPrices, each with its own currency, markets array, and value.priceGuaranteeProperties with priceGuaranteeDate (ISO 8601 timestamp) and pricingPolicy set to Protected.Time Management & Validity
startAt and endAt with ISO 8601 timestamps (e.g., 2023-07-01T00:00:00Z to 2024-07-01T23:59:59Z). Affiliate discounts require startAt, while Primary discounts can include both.Advanced Configuration
systemId links discounts to external systems and appears in Affiliate discounts and Primary backfill scenarios.discountCombinationRule determines how this discount combines with others. Examples show BestOf as the value for Primary discounts.Using a different cloud?
Explore integration guides for other cloud providers: