-
Notifications
You must be signed in to change notification settings - Fork 775
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
Timing issue between Graph Group and RBAC assignment. #15991
Comments
We are going to look into improving this in the Graph extension so it will wait until the Group is fully provisioned before proceeding to the next resource in the deployment. |
@dkershaw10 @jason-dou Does group creation rely on eventual consistency? I'm curious if this is an area we could enhance using the extensibility v2 asynchronous API. |
Yes it does. It's eventually consistent in all regions (read replicas) due to the Entra directory being a massively distributed system (that has inherent replication delays). We have a few tricks - for example there's an affinity between Graph session and a directory replica, so that created objects are immediately visible in the same session. Problem here is that the Azure RBAC assignment comes through a different session and is most likely hitting a read replica that doesn't have the latest changes. @shenglol - we're hoping to address this with some retry logic for key cross-service scenarios (see the last statement in the linked issue). However, if the extensibility v2 asynchronous API provides a better and more reliable mechanism, I'd be all for that too. Although not sure how that would work, as Entra APIs are not inherently async (and we don't get any signals that replication has completed AFAIK). Please chat more to @jason-dou (or @eketo-msft who is much more familiar with the directory architecture and operation) about the options here. |
Good to know! Thanks for sharing the details. If Entra APIs are not inherently async, adding some retry logic might be a suitable approach. Closing this issue as it's already being tracked in the msgraph-bicep-types repo. |
Bicep version
Build on an Azure Build Agent:
Describe the bug
In bicep, when deploying a Entra Group, and then immediately assigning RBAC permissions, the group cannot be found. The returned error explains this very issue, and suggests a fix. The CLI error when running a Deploy:
This makes sense, the group HAS just been created, however the suggested change to fix it, is already implemented.
From Googling it appears that other people who ran into this issue, fixed it, by setting the PrincipalType, but all of these have been for UAI and similar, it doesn't work for Groups. When running the code again, everything works as expected, assumingly since the group is now ready.
To Reproduce
Deploy a entra group using the graph bicep modules. Then assign an RBAC role immediately after.
The text was updated successfully, but these errors were encountered: