You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Error while destroying of multiple azuread_application_password - Directory_ObjectNotFound: Unable to read the company information from the directory.
#1578
I expect to add multiple ServicePrincipals with Applications and ApplicationPasswords and then remove all of them without retry :)
Actual Behavior
Unfortunately after migration to the AzureAD in version 3.0.2 our terraform code fails. While using for_each inside azuread-remove-password-foreach the first try of destroy fails. Second try pass.
What is important, execution of single module azuread-remove-password works every single time.
In the meantime, I figured out the potential workaround!
In logs we can find that in most cases the destroy of azuread_application_password takes ~21-22ms:
module.azuread-remove-password["1"].azuread_application_password.application_password: Destruction complete after 22s
module.azuread-remove-password["2"].azuread_application_password.application_password: Destruction complete after 22s
module.azuread-remove-password["3"].azuread_application_password.application_password: Destruction complete after 21s
module.azuread-remove-password["4"].azuread_application_password.application_password: Destruction complete after 21s
I've made couple of tests and looks like that adding some "delay" while destroy can help here:
Community Note
Terraform (and AzureAD Provider) Version
Affected Resource(s)
azuread_application_password
Terraform Configuration Files
Example modules you can find here https://github.com/banan1988/issues/tree/main/terraform/azuread-remove-password-issue
Debug Output
All logs from apply, first destroy and second destroy you can find here https://github.com/banan1988/issues/tree/main/terraform/azuread-remove-password-issue
Expected Behavior
I expect to add multiple ServicePrincipals with Applications and ApplicationPasswords and then remove all of them without retry :)
Actual Behavior
Unfortunately after migration to the AzureAD in version 3.0.2 our terraform code fails. While using for_each inside azuread-remove-password-foreach the first try of destroy fails. Second try pass.
What is important, execution of single module azuread-remove-password works every single time.
Steps to Reproduce
Go to azuread-remove-password-foreach and execute:
1st try - fails
2nd try - pass
Important Factoids
Running in a Azure - westeurope
The text was updated successfully, but these errors were encountered: