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

azuread_application: avoid update after create #367

Merged
merged 2 commits into from
Nov 26, 2020

Conversation

manicminer
Copy link
Contributor

@manicminer manicminer commented Nov 26, 2020

There are a set of small bugs which can occur by updating immediately after creating an application, mostly around the reliance on d.GetChange(), which is always true in this scenario.

This PR refactors the update logic for the app_role and oauth2_permissions properties into a helper function, and stops returning applicationResourceUpdate() at the end of applicationResourceCreate(). Additionally fixes up the setting of prevent_duplicate_names on read to avoid unwanted diffs, and adds regression test coverage for that attribute.

Sets ConfigMode: schema.SchemaConfigModeAttr on the app_role attribute to enable specifying an empty list in order to remove existing app roles. As with the other optional+computed attributes, this only works on update and if a config change is detected. Test also amended for this case.

Resolves #364

@manicminer manicminer added this to the v1.1.1 milestone Nov 26, 2020
@manicminer manicminer requested a review from a team November 26, 2020 11:37
@ghost ghost added the size/L label Nov 26, 2020
@manicminer manicminer force-pushed the bug/application-prevent-duplicate-names branch from 0c7129e to 66edeed Compare November 26, 2020 12:55
@ghost ghost added size/XL and removed size/L labels Nov 26, 2020
@manicminer manicminer force-pushed the bug/application-prevent-duplicate-names branch from 66edeed to 96e713d Compare November 26, 2020 12:58
Copy link
Member

@jackofallops jackofallops left a comment

Choose a reason for hiding this comment

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

Thanks @manicminer - LGTM 👍

@manicminer
Copy link
Contributor Author

Linters passing locally

Acceptance test results:

Screenshot 2020-11-26 at 16 25 13

@manicminer manicminer merged commit b2c8c64 into master Nov 26, 2020
@manicminer manicminer deleted the bug/application-prevent-duplicate-names branch November 26, 2020 16:26
manicminer added a commit that referenced this pull request Nov 26, 2020
@ghost
Copy link

ghost commented Nov 26, 2020

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

provider "azuread" {
    version = "~> 1.1.1"
}
# ... other configuration ...

@ghost
Copy link

ghost commented Dec 26, 2020

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 Dec 26, 2020
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.

Azure app registration fails when using prevent_duplicate_names
2 participants