AADGroup
Description of the issue
Currently i'm noticing timing beheavior when creating groups in my tenants. When adding a new group or user they are created and get all the settings they need to have, but they will still error because the backend can't find them.
##[error][Request_ResourceNotFound] : Resource '6a46cf97-e63a-4216-8572-04331c277457' does not exist or one of its queried reference-property objects are not present.
I've noticed this before with other azure devops pipelines that create groups, that try/catch needed to be implemented because it took 10 seconds before they are created. instead of the instantly being able to query them.
The same might count for users, but haven't tested that yet.
Microsoft 365 DSC Version
1.26.311.1
Which workloads are affected
Azure Active Directory (Entra ID)
The DSC configuration
Verbose logs showing the problem
##[error][Request_ResourceNotFound] : Resource '********' does not exist or one of its queried
reference-property objects are not present.
Environment Information + PowerShell Version
The PR #7082 will fix some timing issues during resource deployments (applications, groups, service principals and users).
@FabienTschanz I'm seeing this as well. This is an issue that could affect other resources that create users, groups or other stuff. What's the timeline for said PR ? A way to get around the issue is to reapply the config until it doesn't fail but that's hardly a feasible workaround.
@salbeck-sit I wish I could give you a specific timeline. I'll ask Nik again for confirmation because I don't feel entitled enough to make that decision myself.
This issue also affects resource AADPasswordRuleSettings
There are several resources which call Start-Sleep exactly because of this reason
I can see that. The consensus seems to be 'try the action, if it fails, sleep 15 seconds and try again'. According to https://devblogs.microsoft.com/identity/designing-for-eventual-consistency-for-microsoft-entra, "Consistency across requests is not guaranteed by design". 15 seconds seems a bit rich, if this behaviour is centralized (by the 'shim') it'd be possible to use multiple retries up to a limit with exponential sleep-times between each to get fastest reliable response.
The shim handles automatic retries for HTTP errors 429 (too many requests), 503 (service unavailable) and 504 (gateway timeout). Other errors can be handled with the Invoke-M365DSCCommand, which is already implemented. Some resources will use that to handle missing resources when they were not yet created.
Btw the shim layer is now merged. I'll close this one here, after the next release you should see an improvement. If there are still resources missing, please open an issue per resource that needs improvements for better tracking. Appreciate the help.