Closed svenclaesson closed 2 months ago
Hi @svenclaesson, thanks for opening this issue. This is expected behavior when using the azuread_application_registration
resource as we intentionally let the API set a default owner, which is typically the calling principal. This was a design goal for that resource, since the larger azuread_application
resource takes the opposite approach and ensures an explicit list of owners. If you require this functionality, it's recommended to use azuread_application
instead of azuread_application_registration
- though you may need to use the ignore_changes
lifecycle meta-argument to prevent management of properties you are setting elsewhere.
Since the import message you are seeing is to be expected, I'm going to close this issue with my recommendation above. Please feel free to open further issues for any other potential bugs you might encounter. Thanks!
Community Note
Terraform (and AzureAD Provider) Version
v2.47
Affected Resource(s)
azuread_application_owner
Terraform Configuration Files
The following will throw an error (only for my user, not my colleague)
Error: A resource with the ID "/applications/.../owners/..." already exists - to be managed via Terraform this resource needs to be imported into the State. Please see the resource documentation for "azuread_application_owner" for more information.
This works without any issues
Expected Behavior
No error thrown
Actual Behavior
Since i was automatically added as owner when running terraform apply azuread_application_registration this error occurs.
Steps to Reproduce
terraform apply