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

New resource: azurerm_api_management_identity_provider_aadb2c #10240

Merged
merged 6 commits into from
Feb 4, 2021

Conversation

manicminer
Copy link
Contributor

@manicminer manicminer commented Jan 19, 2021

Add new resource azurerm_api_management_identity_provider_aadb2c.

This is tricky to test because creation requires a preexisting B2C tenant with matching policies already configured, plus an application registration in that tenant with sufficient privileges to create another application configured for the APIM instance.

I've set one up by hand (it's the only way at present) and confirmed it works locally. Any B2C tenant can be used, using the basic configuration described at https://docs.microsoft.com/en-us/azure/api-management/api-management-howto-aad-b2c

Accordingly, the acctests rely on additional environment variables to be set (and be valid). The tests are skipped if these are not set.

Very much open to suggestions if there's a better way to inject/detect/consume these!

Variable Description
ARM_TEST_B2C_TENANT_ID the UUID of the B2C tenant
ARM_TEST_B2C_TENANT_SLUG the first part of the *.onmicrosoft.com domain of the B2C tenant
ARM_TEST_B2C_CLIENT_ID client ID of an application in the B2C domain with privileges to create applications
ARM_TEST_B2C_CLIENT_SECRET client secret for that application

Test results

GOROOT=/Users/tom/.goenv/versions/1.14.5 #gosetup
GOPATH=/Users/tom/go #gosetup
/Users/tom/.goenv/versions/1.14.5/bin/go test -c -o /private/var/folders/56/y8d3vjgj1qg6mqv6c_m0cy_w0000gp/T/___TestAccAzureRMApiManagementIdentityProviderAADB2C_basic_in_github.com_terraform_providers_terraform_provider_azurerm_azurerm_internal_services_apimanagement github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/apimanagement #gosetup
/Users/tom/.goenv/versions/1.14.5/bin/go tool test2json -t /private/var/folders/56/y8d3vjgj1qg6mqv6c_m0cy_w0000gp/T/___TestAccAzureRMApiManagementIdentityProviderAADB2C_basic_in_github.com_terraform_providers_terraform_provider_azurerm_azurerm_internal_services_apimanagement -test.v -test.run ^\QTestAccAzureRMApiManagementIdentityProviderAADB2C_basic\E$
=== RUN   TestAccAzureRMApiManagementIdentityProviderAADB2C_basic
=== PAUSE TestAccAzureRMApiManagementIdentityProviderAADB2C_basic
=== CONT  TestAccAzureRMApiManagementIdentityProviderAADB2C_basic
--- PASS: TestAccAzureRMApiManagementIdentityProviderAADB2C_basic (2189.53s)
PASS

Process finished with exit code 0

Replaces: #7785

@favoretti
Copy link
Collaborator

Since I just finished creating generators for all APIM resources, would you also mind adding one here? :)

@ghost ghost added size/XXL and removed size/XL labels Jan 20, 2021
@manicminer
Copy link
Contributor Author

Test results for the resources with updated ID parsers

Screenshot 2021-01-20 at 01 53 13

@tombuildsstuff
Copy link
Contributor

@manicminer would you mind rebasing this one?

Copy link
Contributor

@tombuildsstuff tombuildsstuff left a comment

Choose a reason for hiding this comment

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

hey @manicminer

Thanks for this PR - I've taken a look through and left some comments inline but if we can fix those up (and rebase this) then this otherwise LGTM 👍

Thanks!

@manicminer
Copy link
Contributor Author

Thanks for the review! I've fixed it up per the suggestions. Test results pending.

@manicminer manicminer force-pushed the r/api-management-aadb2c branch 2 times, most recently from 5bd2691 to 216395c Compare January 22, 2021 19:55
@manicminer
Copy link
Contributor Author

Test Results for other azurerm_api_management_identity_service_* resources:

Screenshot 2021-01-22 at 16 18 27

Test results for this resource:

Screenshot 2021-01-22 at 19 54 40

Copy link
Collaborator

@katbyte katbyte left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@manicminer manicminer merged commit 4e5224c into master Feb 4, 2021
@manicminer manicminer deleted the r/api-management-aadb2c branch February 4, 2021 03:59
manicminer added a commit that referenced this pull request Feb 4, 2021
@ghost
Copy link

ghost commented Feb 5, 2021

This has been released in version 2.46.0 of the provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. As an example:

provider "azurerm" {
    version = "~> 2.46.0"
}
# ... other configuration ...

@ghost
Copy link

ghost commented Mar 6, 2021

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks!

@ghost ghost locked as resolved and limited conversation to collaborators Mar 6, 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.

4 participants