Azure / azure-cli

Azure Command-Line Interface
MIT License
3.91k stars 2.88k forks source link

az cli doesnt return status with web apps, processes never finish #29034

Open Joseluismantilla opened 1 month ago

Joseluismantilla commented 1 month ago

Describe the bug

When you use az-cli for web apps deployments or swap slots, az cli never finishes these processes, the version that worked is 2.59.

Related command

az webapp deployment slot swap --name ${web_app_name} --resource-group ${resource_group_name} --slot ${slot_name} or az webapp deploy -n "${web_app_name}" -g "${resource_group_name}" --type zip --src-path "output.zip" --slot "${slot_name}"

Errors

The command shows a timeout since it never returns the status of the operation against the Azure resource, even with 30 minutes as a timeout it never shows anything, with version 2.59 it carries out the deployment in 3 minutes or less, but with 2.60 or 2.61 takes forever and the communication is lost against the Web app resource --I wasted time to figured out.

Issue script & Debug output

AMERROR: Timeout reached while tracking deployment status, however, the deployment operation is still on-going.

Expected behavior

Successful deployments or status code from the WebApp Azure API.

Environment Summary

{ "azure-cli": "2.61.0", "azure-cli-core": "2.61.0", "azure-cli-telemetry": "1.1.0", "extensions": {} }

Additional context

No response

yonzhan commented 1 month ago

Thank you for opening this issue, we will look into it.

microsoft-github-policy-service[bot] commented 1 month ago

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @AzureAppServiceCLI, @antcp.

Lijiaoa commented 1 month ago

+1 I also met this question

tullydwyer commented 1 month ago

All of our Function App (az functionapp deployment source config-zip) and Web App (az webapp deployment source config-zip) deployments are broken in Azure DevOps with Azure CLI > 2.59. Errors after 18 minutes.

Rolling Azure CLI back to 2.59 has fixed deployments for us.

image

Joseluismantilla commented 1 month ago

Exactly, that's the issue and the workaround I explained above.

bjornar-skavdal commented 1 month ago

+1 Any idea when "latest" will fix this issue?

Joseluismantilla commented 1 month ago

Any update?

jamesbarrow commented 1 month ago

The new version of the Azure CLI 2.61, has changed a default flag in these calls (i.e. az webapp deploy).

The "--track-status" flag was previously false, this has now been set to true Ref: https://github.com/Azure/azure-cli/pull/28921

As part of a breaking change documented here, https://github.com/MicrosoftDocs/azure-docs-cli/blob/main/docs-ref-conceptual/release-notes-azure-cli.md

A fix for this, is to set --track-status false, i.e. az webapp deploy ........ --track-status false

I couldn't find any documentation of how to handle the track-status and drop out of it. It looks like it should just drop out when it's finished so there might still be a bug in the actual tracking however the issue has come up from the default. Ref: https://azure.github.io/AppService/2024/01/10/Deployment-Status-API-CLI.html

Joseluismantilla commented 3 weeks ago

Guys, the issue still persists, the idea is not that the deployment works, but also the swap process from az cli, I just saw that a deployment failed by CLI but it worked in Azure, there is no timeout option for swap either, I'm not requesting the timeout property because this bug is not for that, I'm saying that the swap option with the az 2.61 version sometimes work, sometimes loses the track.