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

[Feature Request] Retry-able errors #181

Open
pemontto opened this issue May 25, 2021 · 2 comments
Open

[Feature Request] Retry-able errors #181

pemontto opened this issue May 25, 2021 · 2 comments
Labels
bug Something isn't working

Comments

@pemontto
Copy link
Contributor

Summary of the new feature/enhancement

We sometimes get pipeline errors when deploying rules with Import-AzSentinelAlertRule because a transient error has occurred. Most commonly some gateway timeout on Microsoft's side:

VERBOSE: {"error":{"code":"GatewayTimeout","message":"The gateway did not receive a response from 'Microsoft.SecurityInsights' within the specified time period."}}
Line |
  40 |  $result = Import-AzSentinelAlertRule -SubscriptionId $SubscriptionId|            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | Unable to invoke webrequest for rule Failed host logons but
     | success logon to AzureAD with error message: Response status
     | code does not indicate success: 504 (Gateway Timeout).

Proposed technical implementation details (optional)

Include retry logic for status codes that represent a server issue. I.e. attempt to retry 500 errors up to 3 times, but immediately continue/fail for 400 errors e.g. 400 (Bad Request)

{"error":{"code":"BadRequest","message":"Failed to run the alert rule query. One of the tables does not exist."}}
@pkhabazi pkhabazi added the bug Something isn't working label Aug 2, 2021
@pkhabazi
Copy link
Contributor

pkhabazi commented Aug 2, 2021

hi @pemontto thanks for the feedback, sounds as a good proposal. Do you have some code example or working solution that I can integrate in AzSentinel?

@pemontto
Copy link
Contributor Author

pemontto commented Oct 1, 2021

@pkhabazi I need to do some testing with the API to observe the various responses, there are likely some 4xx and 5xx errors we can safely retry. Will get back to you!

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

No branches or pull requests

2 participants