Skip to content

az webapp deployment source config-zip checks wrong status #7812

Description

@estei

Describe the bug
When you run az webapp deployment source config-zip it checks to see if the returned status from the API is 5 to test for failure.
This happens in the _check_zip_deployment_status function in this file

Kudu deployments according to their documentation have two statuses that they return.

4 = Success
3 = Fail

The way the code is laid out this leads to the deployment status getting checked ten times before timing out with an actual error going by undetected.

To Reproduce
Get a deployment to fail in an Azure Web App when using the CLI.
This is not really practical, but I can't really describe it better.

Expected behavior
It should detect the status 3 instead of status 5 which will not happen.
It could also reverse the check to status != 4

Environment summary
Not really relevant here, but using docker image version 2.0.50

Additional context
The output we get in our pipeline when this happens.
Notice the status being 3 and still ending up in the timeout flow.

Starting Deployment
WARNING: 
WARNING: Deployment is taking longer than expected. Please verify status at 'https://sitename-stage.scm.azurewebsites.net/api/deployments/latest'
            beforing launching the app
{
  "active": false,
  "author": "N/A",
  "author_email": "N/A",
  "complete": true,
  "deployer": "Push-Deployer",
  "end_time": "2018-11-08T14:03:42.7384106Z",
  "id": "temp-1b69c7fc",
  "is_readonly": false,
  "is_temp": true,
  "last_success_end_time": null,
  "log_url": "https://sitename-stage.scm.azurewebsites.net/api/deployments/latest/log",
  "message": "Deploying from pushed zip file",
  "progress": "",
  "provisioningState": null,
  "received_time": "2018-11-08T14:03:36.397168Z",
  "site_name": "sitename",
  "start_time": "2018-11-08T14:03:36.397168Z",
  "status": 3,
  "status_text": "",
  "url": "https://sitename-stage.scm.azurewebsites.net/api/deployments/latest"
}

Extra note
The whole flow in the function seems off.
As I read it, even if a status 3 is detected you will end up in the timeout flow.
The break will break out of the while loop and then since status is not 4 we will be told that Deployment is taking longer than expected....

Metadata

Metadata

Assignees

Labels

App Servicesaz appservicequestionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions