Fix eventual consistency issues in App Registration, Group, and Service Principal resources - #1821
Fix eventual consistency issues in App Registration, Group, and Service Principal resources#1821ms-henglu wants to merge 2 commits into
Conversation
…ce Principal resources
|
Apologies if this isn't the right place for this feedback. We forked this branch and pushed it to our private registry for testing as the issue it resolves has become a major blocker for us. The code changes resolved the problems with app registrations, service principals and groups (thank you for that), but the same problem persists with I'm not a Golang dev, so I stole then tweaked the consistency changes from this PR and applied them to |
jaredfholgate
left a comment
There was a problem hiding this comment.
@ms-henglu you are probably already aware, but I think this needs applying to every resource.
|
When we can expect this fix to be released? Thank you! |
I'm afraid I can't comment on the timescales. @ms-henglu is aware of the urgency and trying hard to get something out ASAP. |
@ms-henglu, thanks for the new commit but seems that is only to address The fix appears need to be applied to every resource, eg. |
It's not finished yet, a review will be requested when it is ready to be merged. |
|
Any update on this issue ? I'm facing this issue and can't provision anything. If there is a work arround, please tell us. If we have to wait, please tell us. |
@KrisBoeckx maybe try pinning the provider version to v3.6.0, this helped me move along with my work until the issue is resolved. |
Reverting back to version 3.6 is what I first did. But it did not resolve the issue. |
The problem is one of eventual consistency, meaning Entra / MS Graph will become eventually consistent at some point (often pretty soon), but due to the error, Terraform has marked the resource as tainted and will proceed to destroy and recreate it, creating a never-ending loop. If you are not automating this at scale, you could apply a manual workaround by updating the tf state file and then running the tf apply again. |
Our workaround for now has been to fork the PR in our pipelines and then build it on our agents for a local dev override in Terraform. This allowed us to work with the updates in this PR prior to the release. Now this won't be ideal to run in a sensitive production environment, but it works for us since we only face this issues in a setup which is in MVP phase anyway. |
|
Thanks for putting this together. Have forked the PR and built a local version of the provider, which has unblocked us significantly. Appreciate the work done. Will continue testing and follow up with any feedback. |
|
would be nice to have this released as soon as possible |
|
Is anyone terraform enterprise customers perhaps? He could request this issue to your corresponding technical account manager or something like this. |
|
this would be a lovely christmas present... 🎁 😅 |
|
The Entra ID API change has been reverted for Terraform, which should have solved this in the short term. It will be fully rolled out to all regions by end of today. This PR or a similar solution will still be implemented as a permanent solution. |
|
@jaredfholgate Deployments are now working for groups, app registrations, app assignments etc, but the inconsistency issue is still present for conditional access policies - |
Hi. This is being looked into, it is possible this uses a different API endpoint. Attempting a reproduction today as need correlation IDs, etc. Thanks |
I've been unable to reproduce this issue after multiple attempts. Please can you share an example policy that exhibits the issue? If you can also share any log details such as a correlation ID and timestamp that would be helpful. Thanks |
|
@jaredfholgate I'm experiencing a potential session affinity issue with the Note: I am using this Terraform provider through Crossplane's provider-upjet-azuread. Correlation ID 1: |
|
Is the API rollback still in place? I can consistently reproduce this issue with simple app/SP creation currently, and would love to see this fix in place. |
|
I'm seeing this issue when attempting to create an app registration with a service principal ( |
|
I haven't had the issue since @jaredfholgate posted that they fixed it. |
|
I have had these same eventual consistency issues, but in the Graph API directly. It can take several minutes and I don't see any documentation stating how long it could take. Replication latency has been very high for me in the past month. From what I can tell from Azure Entra docs it's easier to replicate this problem with application-only requests. Because these don't have session consistency:
|
|
I am suffering the inconsistency issue for |
|
Are there any plans to continue working on this fix? |
|
Hi, I've ran into same issue today 3 times for same change promoted in 3 environments with azurerm_user_assigned_identity Seems someone reverted the fix? I haven't provisioned new azurerm_user_assigned_identity for a while, so can't locate when this has started |
The resource you mention is part of the azurerm provider and interacts with the ARM endpoint, not the Graph endpoint. If you are having an issue with this resource, you should report it over here along with some details like the error you are seeing: https://github.com/hashicorp/terraform-provider-azurerm/issues |
|
This problem has been plaguing production automations for almost a year. What is the current plan to resolve this? Is there something wrong with the proposal in this PR? Is this being worked on somewhere else? Some information would be gladly appreciated. In the meantime I have seen the original issues return over the last few months as the "temporary rollbacks" have seemingly been removed. |
|
I haven't experienced any issues since @jaredfholgate posted the fix last December, despite deploying a large number of App Registrations, app roles, role assignments, groups, and related resources. I think this issue is being blamed for a number of unrelated problems. For example:
This could very well be related to a different issue using the beta endpoint, that also causes inconsistencies: #1899 Or take @vdidenko-dvps's issue, which isn't even using the Microsoft Graph endpoint. |
That is quite an assumption. I have exactly the inconsistency issues that this PR solves and see them every week at minimum, as our pipelines manage hundreds of group memberships, using version 3.8.0. For now I forked the repo and merged this PR to see if the issue disappears. |
fixes #1802
Community Note
Description
Changes to existing Resource / Data Source
Testing
Change Log
Below please provide what should go into the changelog (if anything) conforming to the Changelog Format documented here.
azuread_resource- support for thething1property [GH-00000]This is a (please select all that apply):
Related Issue(s)
Fixes #0000
Rollback Plan
If a change needs to be reverted, we will publish an updated version of the provider.
Changes to Security Controls
Are there any changes to security controls (access controls, encryption, logging) in this pull request? If so, explain.
Note
If this PR changes meaningfully during the course of review please update the title and description as required.