Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

azurerm_subscription - Add support for adding MPA (Microsoft Partner Agreement) accounts #13723

Merged

Conversation

dhoeld
Copy link
Contributor

@dhoeld dhoeld commented Oct 13, 2021

fixes #12300

Test result

11:09 $ go test ./internal/services/billing/parse -v -timeout 1440m -run='TestMicrosoftPartnerAccountBillingScopeID' -run TestMicrosoftPartnerAccountBillingScopeIDFormatter -run TestMicrosoftPartnerAccountBillingScopeID
=== RUN   TestMicrosoftPartnerAccountBillingScopeIDFormatter
--- PASS: TestMicrosoftPartnerAccountBillingScopeIDFormatter (0.00s)
=== RUN   TestMicrosoftPartnerAccountBillingScopeID
    mpa_billing_scope_test.go:73: [DEBUG] Testing ""
    mpa_billing_scope_test.go:73: [DEBUG] Testing "/providers/Microsoft.Billing/"
    mpa_billing_scope_test.go:73: [DEBUG] Testing "/providers/Microsoft.Billing/billingAccounts/"
    mpa_billing_scope_test.go:73: [DEBUG] Testing "/providers/Microsoft.Billing/billingAccounts/e879cf0f-2b4d-5431-109a-f72fc9868693:024cabf4-7321-4cf9-be59-df0c77ca51de_2019-05-31/"
    mpa_billing_scope_test.go:73: [DEBUG] Testing "/providers/Microsoft.Billing/billingAccounts/e879cf0f-2b4d-5431-109a-f72fc9868693:024cabf4-7321-4cf9-be59-df0c77ca51de_2019-05-31/customers/"
    mpa_billing_scope_test.go:73: [DEBUG] Testing "/providers/Microsoft.Billing/billingAccounts/e879cf0f-2b4d-5431-109a-f72fc9868693:024cabf4-7321-4cf9-be59-df0c77ca51de_2019-05-31/customers/2281f543-7321-4cf9-1e23-edb4Oc31a31c"
    mpa_billing_scope_test.go:73: [DEBUG] Testing "/PROVIDERS/MICROSOFT.BILLING/BILLINGACCOUNTS/E879CF0F-2B4D-5431-109A-F72FC9868693:024CABF4-7321-4CF9-BE59-DF0C77CA51DE_2019-05-31/CUSTOMERS/2281F543-7321-4CF9-1E23-EDB4OC31A31C"
--- PASS: TestMicrosoftPartnerAccountBillingScopeID (0.00s)
PASS
ok      github.com/hashicorp/terraform-provider-azurerm/internal/services/billing/parse 0.018s

---

10:56 $ go test ./internal/services/billing/validate -v -timeout 1440m -run='TestMicrosoftPartnerAccountBillingScopeID'
=== RUN   TestMicrosoftPartnerAccountBillingScopeID
    mpa_billing_scope_id_test.go:54: [DEBUG] Testing Value 
    mpa_billing_scope_id_test.go:54: [DEBUG] Testing Value /providers/Microsoft.Billing/
    mpa_billing_scope_id_test.go:54: [DEBUG] Testing Value /providers/Microsoft.Billing/billingAccounts/
    mpa_billing_scope_id_test.go:54: [DEBUG] Testing Value /providers/Microsoft.Billing/billingAccounts/e879cf0f-2b4d-5431-109a-f72fc9868693:024cabf4-7321-4cf9-be59-df0c77ca51de_2019-05-31/
    mpa_billing_scope_id_test.go:54: [DEBUG] Testing Value /providers/Microsoft.Billing/billingAccounts/e879cf0f-2b4d-5431-109a-f72fc9868693:024cabf4-7321-4cf9-be59-df0c77ca51de_2019-05-31/customers/
    mpa_billing_scope_id_test.go:54: [DEBUG] Testing Value /providers/Microsoft.Billing/billingAccounts/e879cf0f-2b4d-5431-109a-f72fc9868693:024cabf4-7321-4cf9-be59-df0c77ca51de_2019-05-31/customers/2281f543-7321-4cf9-1e23-edb4Oc31a31c
    mpa_billing_scope_id_test.go:54: [DEBUG] Testing Value /PROVIDERS/MICROSOFT.BILLING/BILLINGACCOUNTS/E879CF0F-2B4D-5431-109A-F72FC9868693:024CABF4-7321-4CF9-BE59-DF0C77CA51DE_2019-05-31/CUSTOMERS/2281F543-7321-4CF9-1E23-EDB4OC31A31C
--- PASS: TestMicrosoftPartnerAccountBillingScopeID (0.00s)
PASS
ok      github.com/hashicorp/terraform-provider-azurerm/internal/services/billing/validate      0.012s

---

10:59 $ go test ./internal/services/billing -v -timeout 1440m -run='TestAccBillingMPAAccountDataSource_basic'
=== RUN   TestAccBillingMPAAccountDataSource_basic
=== PAUSE TestAccBillingMPAAccountDataSource_basic
=== CONT  TestAccBillingMPAAccountDataSource_basic
    testcase.go:88: Acceptance tests skipped unless env 'TF_ACC' set
--- SKIP: TestAccBillingMPAAccountDataSource_basic (0.00s)
PASS
ok      github.com/hashicorp/terraform-provider-azurerm/internal/services/billing       (cached)

Copy link
Member

@stephybun stephybun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @dhoeld, thanks for PR. Once those two minor comments are addressed this can be merged 🙂.

internal/services/billing/parse/mpa_billing_scope.go Outdated Show resolved Hide resolved
website/docs/r/subscription.html.markdown Outdated Show resolved Hide resolved
dhoeld and others added 2 commits October 28, 2021 08:51
This field isn't a valid one for MPA accounts and therefore it isn't used anywhere.
@dhoeld dhoeld requested a review from stephybun October 28, 2021 07:12
@stephybun
Copy link
Member

LGTM - Thanks @dhoeld!

@stephybun stephybun merged commit e9368a1 into hashicorp:main Oct 28, 2021
stephybun added a commit that referenced this pull request Oct 28, 2021
@dhoeld dhoeld deleted the r/azurerm_subscription-add-mpa-support branch October 28, 2021 08:53
@github-actions
Copy link

This functionality has been released in v2.83.0 of the Terraform Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 28, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Account scope for account type MPA(Microsoft Partner Agreement)/Azure Plan
2 participants