From f21adf77a8b8350979a80436e5be8987a7ce1bfa Mon Sep 17 00:00:00 2001 From: Tom Bamford Date: Mon, 6 Feb 2023 11:15:05 +0200 Subject: [PATCH] Subscriptions: update tests for MCA account --- .../subscription/subscription_resource_test.go | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/internal/services/subscription/subscription_resource_test.go b/internal/services/subscription/subscription_resource_test.go index 5f19c3e3d720..de9af51012dc 100644 --- a/internal/services/subscription/subscription_resource_test.go +++ b/internal/services/subscription/subscription_resource_test.go @@ -113,23 +113,25 @@ func (SubscriptionResource) Exists(ctx context.Context, client *clients.Client, // TODO - Need Env vars in CI for Billing Account and Enrollment Account - Testing disabled for now func (SubscriptionResource) basicEnrollmentAccount(data acceptance.TestData) string { billingAccount := os.Getenv("ARM_BILLING_ACCOUNT") - enrollmentAccount := os.Getenv("ARM_BILLING_ENROLLMENT_ACCOUNT") + billingProfile := os.Getenv("ARM_BILLING_PROFILE") + invoiceSection := os.Getenv("ARM_INVOICE_SECTION") return fmt.Sprintf(` provider "azurerm" { features {} } -data "azurerm_billing_enrollment_account_scope" "test" { - billing_account = "%s" - enrollment_account = "%s" +data "azurerm_billing_mca_account_scope" "test" { + billing_account_name = "%[1]s" + billing_profile_name = "%[2]s" + invoice_section_name = "%[3]s" } resource "azurerm_subscription" "test" { - alias = "testAcc-%[3]d" - subscription_name = "testAccSubscription %[3]d" - billing_scope_id = data.azurerm_billing_enrollment_account_scope.test.id + alias = "testAcc-%[4]d" + subscription_name = "testAccSubscription %[4]d" + billing_scope_id = data.azurerm_billing_mca_account_scope.test.id } -`, billingAccount, enrollmentAccount, data.RandomInteger) +`, billingAccount, billingProfile, invoiceSection, data.RandomInteger) } func (SubscriptionResource) basicEnrollmentAccountUpdate(data acceptance.TestData) string {