Microsoft365DSC icon indicating copy to clipboard operation
Microsoft365DSC copied to clipboard

AADGroup

Open AndromeHyperion opened this issue 8 months ago • 8 comments

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


AndromeHyperion avatar Mar 30 '26 09:03 AndromeHyperion

The PR #7082 will fix some timing issues during resource deployments (applications, groups, service principals and users).

FabienTschanz avatar May 01 '26 11:05 FabienTschanz

@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 avatar May 20 '26 06:05 salbeck-sit

@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.

FabienTschanz avatar May 20 '26 07:05 FabienTschanz

This issue also affects resource AADPasswordRuleSettings

salbeck-sit avatar May 20 '26 08:05 salbeck-sit

There are several resources which call Start-Sleep exactly because of this reason

ricmestre avatar May 20 '26 08:05 ricmestre

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.

salbeck-sit avatar May 20 '26 11:05 salbeck-sit

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.

FabienTschanz avatar May 21 '26 13:05 FabienTschanz

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.

FabienTschanz avatar May 21 '26 13:05 FabienTschanz