Skip to content

[App Service] Fix #29290, #27506, #29721: --src-url error messages and sync deploy#33050

Open
seligj95 wants to merge 4 commits intoAzure:devfrom
seligj95:fix/29290-src-url-bad-request-error
Open

[App Service] Fix #29290, #27506, #29721: --src-url error messages and sync deploy#33050
seligj95 wants to merge 4 commits intoAzure:devfrom
seligj95:fix/29290-src-url-bad-request-error

Conversation

@seligj95
Copy link
Copy Markdown
Contributor

@seligj95 seligj95 commented Mar 26, 2026

Description

This PR consolidates fixes for three related --src-url issues in az webapp deploy:

Fix #29290: Improve error messages for --src-url failures

  • Surface the actual HTTP status code and response body when --src-url deploy fails
  • Replace generic "Bad Request" errors with actionable messages

Fix #27506, #29721: Add sync deployment support for --src-url

  • Add synchronous deployment tracking for --src-url deploys
  • Poll deployment status until completion instead of returning immediately
  • Properly handle deployment timeouts and failures

Testing

  • Added unit tests for sync deploy behavior
  • Verified error message improvements with mock tests

Issues

Fixes #29290
Fixes #27506
Fixes #29721

Consolidated from PR #33052

Copilot AI review requested due to automatic review settings March 26, 2026 00:43
@azure-client-tools-bot-prd
Copy link
Copy Markdown

azure-client-tools-bot-prd Bot commented Mar 26, 2026

️✔️AzureCLI-FullTest
️✔️acr
️✔️latest
️✔️3.12
️✔️3.13
️✔️acs
️✔️latest
️✔️3.12
️✔️3.13
️✔️advisor
️✔️latest
️✔️3.12
️✔️3.13
️✔️ams
️✔️latest
️✔️3.12
️✔️3.13
️✔️apim
️✔️latest
️✔️3.12
️✔️3.13
️✔️appconfig
️✔️latest
️✔️3.12
️✔️3.13
️✔️appservice
️✔️latest
️✔️3.12
️✔️3.13
️✔️aro
️✔️latest
️✔️3.12
️✔️3.13
️✔️backup
️✔️latest
️✔️3.12
️✔️3.13
️✔️batch
️✔️latest
️✔️3.12
️✔️3.13
️✔️batchai
️✔️latest
️✔️3.12
️✔️3.13
️✔️billing
️✔️latest
️✔️3.12
️✔️3.13
️✔️botservice
️✔️latest
️✔️3.12
️✔️3.13
️✔️cdn
️✔️latest
️✔️3.12
️✔️3.13
️✔️cloud
️✔️latest
️✔️3.12
️✔️3.13
️✔️cognitiveservices
️✔️latest
️✔️3.12
️✔️3.13
️✔️compute_recommender
️✔️latest
️✔️3.12
️✔️3.13
️✔️computefleet
️✔️latest
️✔️3.12
️✔️3.13
️✔️config
️✔️latest
️✔️3.12
️✔️3.13
️✔️configure
️✔️latest
️✔️3.12
️✔️3.13
️✔️consumption
️✔️latest
️✔️3.12
️✔️3.13
️✔️container
️✔️latest
️✔️3.12
️✔️3.13
️✔️containerapp
️✔️latest
️✔️3.12
️✔️3.13
️✔️core
️✔️latest
️✔️3.12
️✔️3.13
️✔️cosmosdb
️✔️latest
️✔️3.12
️✔️3.13
️✔️databoxedge
️✔️latest
️✔️3.12
️✔️3.13
️✔️dls
️✔️latest
️✔️3.12
️✔️3.13
️✔️dms
️✔️latest
️✔️3.12
️✔️3.13
️✔️eventgrid
️✔️latest
️✔️3.12
️✔️3.13
️✔️eventhubs
️✔️latest
️✔️3.12
️✔️3.13
️✔️feedback
️✔️latest
️✔️3.12
️✔️3.13
️✔️find
️✔️latest
️✔️3.12
️✔️3.13
️✔️hdinsight
️✔️latest
️✔️3.12
️✔️3.13
️✔️identity
️✔️latest
️✔️3.12
️✔️3.13
️✔️iot
️✔️latest
️✔️3.12
️✔️3.13
️✔️keyvault
️✔️latest
️✔️3.12
️✔️3.13
️✔️lab
️✔️latest
️✔️3.12
️✔️3.13
️✔️managedservices
️✔️latest
️✔️3.12
️✔️3.13
️✔️maps
️✔️latest
️✔️3.12
️✔️3.13
️✔️marketplaceordering
️✔️latest
️✔️3.12
️✔️3.13
️✔️monitor
️✔️latest
️✔️3.12
️✔️3.13
️✔️mysql
️✔️latest
️✔️3.12
️✔️3.13
️✔️netappfiles
️✔️latest
️✔️3.12
️✔️3.13
️✔️network
️✔️latest
️✔️3.12
️✔️3.13
️✔️policyinsights
️✔️latest
️✔️3.12
️✔️3.13
️✔️postgresql
️✔️latest
️✔️3.12
️✔️3.13
️✔️privatedns
️✔️latest
️✔️3.12
️✔️3.13
️✔️profile
️✔️latest
️✔️3.12
️✔️3.13
️✔️rdbms
️✔️latest
️✔️3.12
️✔️3.13
️✔️redis
️✔️latest
️✔️3.12
️✔️3.13
️✔️relay
️✔️latest
️✔️3.12
️✔️3.13
️✔️resource
️✔️latest
️✔️3.12
️✔️3.13
️✔️role
️✔️latest
️✔️3.12
️✔️3.13
️✔️search
️✔️latest
️✔️3.12
️✔️3.13
️✔️security
️✔️latest
️✔️3.12
️✔️3.13
️✔️servicebus
️✔️latest
️✔️3.12
️✔️3.13
️✔️serviceconnector
️✔️latest
️✔️3.12
️✔️3.13
️✔️servicefabric
️✔️latest
️✔️3.12
️✔️3.13
️✔️signalr
️✔️latest
️✔️3.12
️✔️3.13
️✔️sql
️✔️latest
️✔️3.12
️✔️3.13
️✔️sqlvm
️✔️latest
️✔️3.12
️✔️3.13
️✔️storage
️✔️latest
️✔️3.12
️✔️3.13
️✔️synapse
️✔️latest
️✔️3.12
️✔️3.13
️✔️telemetry
️✔️latest
️✔️3.12
️✔️3.13
️✔️util
️✔️latest
️✔️3.12
️✔️3.13
️✔️vm
️✔️latest
️✔️3.12
️✔️3.13

@azure-client-tools-bot-prd
Copy link
Copy Markdown

Hi @seligj95,
Since the current milestone time is less than 7 days, this pr will be reviewed in the next milestone.

@azure-client-tools-bot-prd
Copy link
Copy Markdown

azure-client-tools-bot-prd Bot commented Mar 26, 2026

️✔️AzureCLI-BreakingChangeTest
️✔️Non Breaking Changes

@yonzhan
Copy link
Copy Markdown
Collaborator

yonzhan commented Mar 26, 2026

Thank you for your contribution! We will review the pull request and get back to you soon.

@github-actions
Copy link
Copy Markdown

The git hooks are available for azure-cli and azure-cli-extensions repos. They could help you run required checks before creating the PR.

Please sync the latest code with latest dev branch (for azure-cli) or main branch (for azure-cli-extensions).
After that please run the following commands to enable git hooks:

pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Improves the UX for App Service OneDeploy URL-based deployments by surfacing a more actionable error message when the ARM OneDeploy call fails with HTTP 400 and an empty response body (instead of only showing “Bad Request”).

Changes:

  • Added a _send_deploy_request wrapper around send_raw_request to intercept HTTP 400 and raise a guidance-rich CLIError.
  • Routed the --src-url ARM OneDeploy request path through _send_deploy_request so the improved message is emitted consistently (including the kudu-warmup/instance flow).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/azure-cli/azure/cli/command_modules/appservice/custom.py Outdated
Comment thread src/azure-cli/azure/cli/command_modules/appservice/custom.py
Comment thread src/azure-cli/azure/cli/command_modules/appservice/custom.py Outdated
Comment thread src/azure-cli/azure/cli/command_modules/appservice/custom.py
@seligj95 seligj95 force-pushed the fix/29290-src-url-bad-request-error branch from 956a54a to c9af28e Compare March 26, 2026 00:52
@seligj95 seligj95 force-pushed the fix/29290-src-url-bad-request-error branch from c9af28e to 278da15 Compare March 26, 2026 00:59
@seligj95 seligj95 changed the title [App Service] Fix #29290: Improve error message for az webapp deploy --src-url Bad Request [App Service] Fix #29290: az webapp deploy: Improve error message for --src-url deployment failures Mar 26, 2026
@yonzhan yonzhan assigned yanzhudd and unassigned zhoxing-ms Mar 26, 2026
@seligj95 seligj95 changed the title [App Service] Fix #29290: az webapp deploy: Improve error message for --src-url deployment failures [App Service] Fix #29290: az webapp deploy: Improve error message for --src-url deployment failures Mar 26, 2026
@seligj95 seligj95 changed the title [App Service] Fix #29290: az webapp deploy: Improve error message for --src-url deployment failures [App Service] Fix #29290, #27506, #29721: --src-url error messages and sync deploy Mar 26, 2026
seligj95 and others added 4 commits April 29, 2026 00:06
…eploy --src-url failures

When `az webapp deploy --src-url` receives non-2xx HTTP responses,
`send_raw_request` raises `HTTPError` before the deploy-specific error
handling code is reached. This results in bare error messages like
"Bad Request" with no actionable guidance.

This change adds a `_send_deploy_request` wrapper that catches HTTP errors
on the --src-url ARM deploy path and provides clear, actionable messages:

- 400 Bad Request: troubleshooting guidance for URL accessibility, SAS
  tokens, and artifact type mismatches
- 404 Not Found: guidance to verify resource group, app name, and slot
- 409 Conflict: message about in-progress deployments

The wrapper uses the server-provided reason phrase and includes any
response body details when available. Unhandled status codes re-raise
the original HTTPError unchanged.

Fixes Azure#29290

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Wrapped `--src-url` in backticks in PR title to pass format checker.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…rt for --src-url

When using az webapp deploy --src-url, the command now polls for
deployment completion by default (matching --src-path behavior).
Uses the deployment ID from the ARM response to track status via
the deploymentStatus API.

- Default behavior for --src-url is now synchronous (polls until complete)
- --async true preserves existing behavior (return immediately)
- Uses deployment ID extraction for tracking (avoids race conditions)

Fixes Azure#27506
Fixes Azure#29721

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@seligj95 seligj95 force-pushed the fix/29290-src-url-bad-request-error branch from c2fa6d7 to 778366f Compare April 29, 2026 04:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

5 participants