microsoftgraph / microsoftgraph/msgraph-sdk-powershell

Get-MgAuditLogSignIn timeout 300 seconds

Open
#3,146 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Bug: PowerShell type:bug
Dominant language
C#
Stars
898
Forks
230
Avg merge
2d 5h
Merged PRs (30d)
31

Description

Describe the bug

The Get-MgAuditLogSignIn cmdlet basically fails with a timeout. Tenant/User has Entra P1 license, so audit logs are 30 days vs the unlicensed 7 days (result is that there are more overall logs). The end goal is to use the -Filter flag to limit the search results, but this also fails. The workaround stated for the similar issue reported in #2941 was to pull all of the logs and filter them locally, but this is (not / no longer) working. #2941 was thought to believe it is a service issue but my issue does not fail in the portal.

$accessLogs = Get-MgAuditLogSignIn -All
Get-Get-MgAuditLogSignIn_List: The request was canceled due to the configured HttpClient.Timeout of 300 seconds elapsing.

$accessLogs = Get-MgAuditLogSignIn
Get-MgAuditLogSignIn_List: The request was canceled due to the configured HttpClient.Timeout of 300 seconds elapsing.
Expected behavior

cmdlet returns requested logs.

How to reproduce
  1. Use Entral P1 License to extend signin log retention to 30 days.
  2. Run the cmdlet Get-MgAuditLogSignIn -All,
SDK Version

2.25.0

Latest version known to work for scenario above?

2.25.0

Known Workarounds

none

Debug output
Click to expand log ``` PS C:\Millcore> $accessLogs = Get-MgAuditLogSignIn -All -Debug DEBUG: [CmdletBeginProcessing]: - Get-MgAuditLogSignIn begin processing with parameterSet 'List'. DEBUG: [Authentication]: - AuthType: 'AppOnly', TokenCredentialType: 'ClientCertificate', ContextScope: 'Process', AppName: 'Scripting Service Principal'. DEBUG: [Authentication]: - Scopes: [AuditLog.Read.All]. DEBUG: [CmdletException]: Received exception with message 'TaskCanceledException - The request was canceled due to the configured HttpClient.Timeout of 300 seconds elapsing. : at System.Net.Http.HttpClient.HandleFailure(Exception e, Boolean telemetryStarted, HttpResponseMessage response, CancellationTokenSource cts, CancellationToken cancellationToken, CancellationTokenSource pendingRequestsCts) at System.Net.Http.HttpClient.g__Core|83_0(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationTokenSource cts, Boolean disposeCts, CancellationTokenSource pendingRequestsCts, CancellationToken originalCancellationToken) at Microsoft.Graph.PowerShell.Reports.AuditLogListSignIn_Call(HttpRequestMessage request, Func`3 on2Xx, Func`3 onDefault, IEventListener eventListener, ISendAsync sender) at Microsoft.Graph.PowerShell.Reports.AuditLogListSignIn_Call(HttpRequestMessage request, Func`3 on2Xx, Func`3 onDefault, IEventListener eventListener, ISendAsync sender) at Microsoft.Graph.PowerShell.Reports.AuditLogListSignIn(Nullable`1 Top, Nullable`1 Skip, String Search, String Filter, Nullable`1 Count, String[] Orderby, String[] Select, String[] Expand, IDictionary headers, Func`3 on2Xx, Func`3 onDefault, IEventListener eventListener, ISendAsync sender) at Microsoft.Graph.PowerShell.Cmdlets.GetMgAuditLogSignIn_List.ProcessRecordAsync()' Get-MgAuditLogSignIn_List: The request was canceled due to the configured HttpClient.Timeout of 300 seconds elapsing. DEBUG: [CmdletEndProcessing]: - Get-MgAuditLogSignIn end processing. ```
Configuration

Windows 2019, AMD64

Other information

Similar errors with Get-EntraAuditSignInLog, Get-AzureADAuditSignInLogs.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Get-MgAuditLogSignIn entry point and the AuditLogListSignIn calls shown in the debug stack. Reproduce both -All and -Filter requests with the reported Entra P1 retention window, then determine whether the cmdlet returns the requested logs without the 300-second timeout.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, powershell
Domain
api, cli
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.