Skip to content
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 in Update-M365DSCAzureADApplication #3426

Closed
andikrueger opened this issue Jun 28, 2023 · 3 comments · Fixed by #3430
Closed

Timing issue in Update-M365DSCAzureADApplication #3426

andikrueger opened this issue Jun 28, 2023 · 3 comments · Fixed by #3430
Assignees
Labels
Bug Something isn't working Core Engine

Comments

@andikrueger
Copy link
Collaborator

I ran several test with the cmdLet and am seeing this issue:

Update-MgApplication : Key credential end date is invalid.
At C:\M365DSC\Microsoft365DSC\modules\M365DSCPermissions.psm1:1668 char:21
+ ...             $appCred = Update-MgApplication -ApplicationId $azureAdAp ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: ({ ApplicationId...phApplication }:<>f__AnonymousType0`2) [Update-MgApplication_Update  
   Expanded1], RestException`1
    + FullyQualifiedErrorId : KeyCredentialsInvalidEndDate,Microsoft.Graph.PowerShell.Cmdlets.UpdateMgApplication_UpdateExpanded1    

This looks like an timing issue within the code flow.

@andikrueger andikrueger added Bug Something isn't working Core Engine labels Jun 28, 2023
@NikCharlebois
Copy link
Collaborator

NikCharlebois commented Jun 28, 2023

Sorry, what is the command you ran? What parameters?

@andikrueger andikrueger changed the title Timing issue in New-M365DSCAzureADApplication Timing issue in Update-M365DSCAzureADApplication Jun 28, 2023
@andikrueger
Copy link
Collaborator Author

The Update-m365dscAzureAdApplication. I have updated the title accordingly

@andikrueger
Copy link
Collaborator Author

Just to add some more context:

The function does fail 50 to 60% of the time. I think, there is to less time in between the creation of the certificate and the actual upload of it. Either we should add retry or increase the time in between. The retry option should try to upload the certificate several times. This would be the more resilient option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Core Engine
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants