Skip to content

"az webapp webjob triggered run" fails if WebJob is already running #23596

@Stolpe

Description

@Stolpe

Related command

az webapp webjob triggered run

Describe the bug

Performing az webapp webjob triggered run ... to run a WebJob fails if the WebJob is already running, since the Azure API returns Http 409 Conflict. This is reasonable, but annoying for my use-case. As part of a deployment, I want to make sure that a specific WebJob is run as soon as possible. This WebJob is also on a timer, which causes this deployment pipeline to occasionally fail.

To Reproduce

  1. Start a triggered WebJob in any way (Portal/Azure CLI etc)
  2. While the WebJob is still running, trigger it using az webapp webjob triggered run ...

Expected behavior

Since a Http 409 Conflict response from the Azure API means that the job is already started, I would argue that the Azure CLI command has been successful. Now, I suppose that the running job could be an earlier instance of the job running, which might be unexpected, so it might be considered a breaking change to just blanket ignore if Http 409 is returned. Perhaps a switch parameter potentially named --ignore-already-running or something similar would be a better solution.

Environment summary

azure-cli 2.39.0

Additional context

This behavior today matches the behavior of both the new Az and the legacy azurerm PowerShell modules.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions