Skip to content

[CoR] Add durable polling, output capture, and cleanup for long deployments #1896

Description

@nturinski

Problem

Long-running deployment commands can exceed execution windows and emit enough output to obscure status. Although some deployment paths suppress output or poll Azure operations, behavior is not consistent across channels. A timed-out command can make final status and cleanup harder to guarantee.

Proposed work

  • Define channel-specific start-and-poll flows instead of relying on one long streaming command:
    • ARM/Bicep: start asynchronously and poll deployment state; capture failed operations.
    • App Service: use asynchronous deployment and poll deployment status.
    • ACR: suppress streaming logs and poll build state.
    • Flex Functions and Static Web Apps: document and implement their supported status mechanisms.
  • Define command-specific time budgets and terminal-state handling.
  • Persist sanitized command output under .copilot-azure/sessions/{id}/command-results/.
  • Extend deployment audit entries with start/end timestamps, duration, terminal status, and output-file path.
  • Keep chat output concise: progress state plus a short failure tail and a link/path to detailed output.
  • Run cleanup and deploy-result.json finalization separately from timeout-prone deployment commands.
  • Ensure temporary network access and credentials are reconciled idempotently after failure or timeout.
  • Avoid command wrappers that obscure the actual process exit code.

Likely implementation surfaces include:

  • resources/agents/azure-deploy/deploy/references/deploy-safety.md
  • resources/agents/azure-deploy/deploy/references/deploy-checklist-template.md
  • Channel-specific deployment references and deployment result/audit schemas

Acceptance criteria

  • Each supported deployment channel has a documented start, poll, timeout, and terminal-state flow.
  • Full sanitized diagnostics are written to a session-scoped file rather than streamed into chat.
  • Timeout or cancellation still produces a terminal deploy-result.json state.
  • Cleanup runs independently and removes/reconciles temporary access even after command failure.
  • Audit data identifies duration, outcome, and diagnostic output location for every long operation.
  • Tests or fixtures cover success, failure, timeout, polling interruption, and cleanup retry.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    CoRCopilot on Rails

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions