-
Notifications
You must be signed in to change notification settings - Fork 3
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
Get-MgAuditLogDirectoryAudit : The stream was already consumed. It cannot be read again. #7
Comments
Hi, |
Yes we have a large environment so the run does take around 8-9 hours (i have another export workflow but I was trying yours for the logging capability) |
I see. I haven't seen this error, but google tells me that you are right and it is because token has to be renewed. You are on your own I am afraid. I don't know how to fix this right now. |
No problem, thanks for taking a look |
I was thinking about it and there is one obvious workaround. Modify the code to split audit log searches by 24 hours and before each search make new authentication. And just join the results afterwards. |
Getting the same error in my environment since september 10th. |
Just to be sure, what pipeline are we talking about? Azure or Intune? I assume Azure. In the pipeline output there should be something like:
before Get-MgAuditLogDirectoryAudit is being called. What does it say in your case? Have you tried to split the searches by 24 hours as I suggested in the previous comment? |
Hi, from what I remember using certificate based auth for the service principal used to run the script fixed this issue in my testing (I never tested using a workload identity), hope that helps! |
Hi! I'm trying to run your pipeline but get the following error, the pipeline ran for over 8 hours could it be as per this issue that the access token needs refreshed? : https://github.com/microsoftgraph/msgraph-sdk-powershell/issues/1911
The text was updated successfully, but these errors were encountered: