-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Description
Describe the bug
Hi all, I have been working on this from a ton of angles and have not come up with a solution. Any help is appreciated!
I have an Azure Webapp that we can deploy via a shell script or on CI via a Github action that mostly do the same thing, and both started failing to the point that we have no reliable way to deploy this–started about 1 week ago.
Local Deployment failure
This is a next.js app, set to standalone mode, using pnpm as a package manager, and deploying with a bash script locally using az webapp deploy. We have been using this for maybe 18 months, then it all the sudden started failing with:
Initiating deployment
Deploying from local path: [redacted]/release.zip
Warming up Kudu before deployment.
Warmed up Kudu instance successfully.
An error occurred during deployment. Status Code: 502, Please visit https://[redacted].scm.azurewebsites.net/api/deployments/latest to get more information about your deployment
Deployment failed!
CI Failure
On CI the process is the same except instead of using az webapp deploy at the end, we use (here env.RELEASE_FILE is that same zip created by the script above:
- name: 'Deploy to Azure Web App'
id: deploy-to-webapp
uses: azure/webapps-deploy@v3
with:
app-name: ${{ env.AZURE_WEBAPP_NAME }}
slot-name: 'production'
package: ${{ env.RELEASE_FILE }}
This is also failing with a slightly different error:
Deploying brian to azure
WARNING: Initiating deployment
WARNING: Deploying from local path: /home/runner/work/core/core/apps/frontend/release.zip
WARNING: Warming up Kudu before deployment.
WARNING: Warmed up Kudu instance successfully.
ERROR: An error occurred during deployment. Status Code: 504, Details: 504.0 GatewayTimeout, Please visit https://[redacted]/api/deployments/latest to get more information about your deployment
Deployment failed!
Unfortunately, right now, I can't see any failures in the deployment logs on Azure which is also odd. In the past, I would see either just one entry about unzipping the deployment then nothing. Or at some point the logs would just stop.
What have we tried
- I have deleted the failed deployments
- I have deleted and recreated the frontend resource
- I have tried to reduce the size of the zip. It's currently about 300MB, and I am not sure I can reasonably get it smaller without some re-architecture
- I have tried with an older version of the CLI. I tried with 2.76.0. Around the same time, our
az functionapp deploymentalso broke due to this bug: az functionapp deployment source config-zip broken in 2.77.0 #32044. That was fixed by forcing 2.76.0, but made no difference here.
Related command
az webapp deploy
Errors
An error occurred during deployment. Status Code: 502, Please visit https://[redacted].scm.azurewebsites.net/api/deployments/latest to get more information about your deployment
Issue script & Debug output
rm -rf .next
pnpm run env
NODE_ENV=development pnpm install --frozen-lockfile
pnpm run build
build zip for deployment
pushd .next/standalone || exit 1
zip "$ZIP_FILE_NAME" . -qr
echo "$ZIP_FILE_NAME"
popd || exit 1
az webapp deploy
--resource-group "${RESOURCE_GROUP}"
--name "${FRONTEND_RESOURCE}"
--src-path "$ZIP_FILE_NAME"
--timeout $((FE_TIMEOUT_MINS * 60000))
--type zip
--debug
Ok actually running with the --debug flag, the deploy works more often. Here is output from a failed deploy.
Expected behavior
The az command should successfully deploy the zip to my Azure webapp.
Environment Summary
azure-cli 2.77.0
core 2.77.0
telemetry 1.1.0
Extensions:
account 0.2.5
application-insights 1.2.3
authV2 1.0.0
communication 1.13.0
containerapp 1.2.0b3
Dependencies:
msal 1.34.0b1
azure-mgmt-resource 23.3.0
Python location '/opt/homebrew/Cellar/azure-cli/2.77.0/libexec/bin/python'
Config directory '/Users/brian/.azure'
Extensions directory '/Users/brian/.azure/cliextensions'
Python (Darwin) 3.13.7 (main, Aug 14 2025, 11:12:11) [Clang 17.0.0 (clang-1700.0.13.3)]
Legal docs and information: aka.ms/AzureCliLegal
Your CLI is up-to-date.
Additional context
No response