Skip to content

No retries on REST API time-outs #295

Closed

Description

@supercomfysoft

Describe the bug
Recently the ADF REST API seems to time-out frequently, causing the deployment to fail. While API time-outs are a Microsoft issue, I do think a retry on the API calls should be essential. For me this is happening multiple times a day now.

Since ADF is only a rather small part of the deployment, having to re-run the whole thing for multiple projects at a time can be quite daunting.

I do would understand if you'd see this as an enhancement rather than a bug though. Please let me know how you see this issue!

To Reproduce
N/A, intermittent issue with Microsoft

Expected behaviour
When an API time-out occurs, the script should re-attempt the API call a few times, up to a configurable amount. This prevents deployments to fail.

Screenshots
image

Version of PowerShell module of:

  • 0.101.000

Provide all files to reproduce the issue

2023-03-29T08:40:02.1628240Z Start deploying object: [pipeline].[pipeline_name] (2 dependency/ies)
2023-03-29T08:41:42.3155920Z New-AzResource : �[31;1mOperation failed because a request timed out.�[0m
2023-03-29T08:41:42.3158039Z �[31;1mAt /home/AzDevOps/.local/share/powershell/Modules/azure.datafactory.tools/0.101.0/private/Deploy-AdfObjectOnly.ps1:135 char:13�[0m
2023-03-29T08:41:42.3159873Z �[31;1m+             New-AzResource `�[0m
2023-03-29T08:41:42.3196750Z �[31;1m+             ~~~~~~~~~~~~~~~~�[0m
2023-03-29T08:41:42.3204598Z �[31;1m+ CategoryInfo          : CloseError: (:) [New-AzResource], Exception�[0m
2023-03-29T08:41:42.3205922Z �[31;1m+ FullyQualifiedErrorId : Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation.NewAzureResourceCmdlet�[0m
2023-03-29T08:41:42.4383179Z ##[error]Script failed with exit code: 1

Activity

  1. added
    enhancementNew feature or request
    and removed
    triageIssue is under investigation
    on Mar 29, 2023
  2. self-assigned this
    on Oct 16, 2026
  3. added this to the v1.20 milestone on Oct 16, 2026
  4. changed the issue type fromtoon Oct 16, 2026
  5. NowinskiK commented on Oct 16, 2026

    @NowinskiK
    Member

    Thanks @supercomfysoft, and sorry for the long wait. This is still valid in the current version: every object is deployed with a single API call and no retry. Since #472 (v1.17.1) a failed deployment stops the publish, so one temporary timeout fails the whole run.

    Observation

    In your log the request started at 08:40:02.16 and failed at 08:41:42.31, almost exactly 100 seconds later. That is the default HttpClient timeout, so the time limit ran out on the client side, and ADF may well have finished the change anyway. Retrying is safe: these calls create or update an object (HTTP PUT), so running one twice gives the same result.

    Planned approach

    • Retry temporary errors only: request timeouts, HTTP 429 (throttling), HTTP 5xx and "concurrent operations". The wait gets longer before each retry (2, 4, 8 seconds).
    • Permanent errors are not retried: validation errors (BadRequest), NotFound, authorization and so on fail on the first attempt, as today.
    • If every attempt fails, the error still stops the publish, so the Publish-AdfV2FromJson not yet failing even using errorActionPreference: stop #472 behaviour is unchanged for real failures.
    • Configurable, as you suggested, with a new publish option: $opt.MaxRetries (default 3; 0 turns retries off).
    • Scope: object deployment (pipelines, datasets, data flows, linked services, triggers, integration runtimes, credentials, and the AzResource deploy method). Starting and stopping triggers already has its own retry and stays as it is.
    • Tests first, with mocks that simulate a timeout followed by success, retries running out, a permanent error, and MaxRetries = 0.
  6. added a commit that references this issue on Oct 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions