I try to create a plain simple powershell script to ZIP-deploy a Linux ASP.NET Core 8 application.
I have created the following test script that tries to deploy a .ZIP file '../publish/publish-linux.zip'.
My problem is that when I run this script (nothing exists before) then the deployment hangs on this statement:
DEBUG: urllib3.connectionpool: Starting new HTTPS connection (1): mytestservice987654.scm.azurewebsites.net:443
And I eventually end up with this error
Error: An error occurred during deployment. Status Code: 504, Details: 504.0 GatewayTimeout, Please visit https://mytestservice987654.scm.azurewebsites.net/api/deployments/latest to get more information about your deployment
ERROR: cli.azure.cli.core.azclierror: An error occurred during deployment. Status Code: 504, Details: 504.0 GatewayTimeout, Please visit https://mytestservice987654.scm.azurewebsites.net/api/deployments/latest to get more information about your deployment
ERROR: az_command_data_logger: An error occurred during deployment. Status Code: 504, Details: 504.0 GatewayTimeout, Please visit https://mytestservice987654.scm.azurewebsites.net/api/deployments/latest to get more information about your deployment
DEBUG: cli.knack.cli: Event: Cli.PostExecute [<function AzCliLogging.deinit_cmd_metadata_logging at 0x0000018964E7C400>]
INFO: az_command_data_logger: exit code: 1
INFO: cli.__main__: Command ran in 246.901 seconds (init: 0.510, invoke: 246.390)
ie, SCM is not responding.
Currently, it works if I call the az webapp deploy command twice, resulting in this output:
az webapp deploy #1
WARNING: Initiating deployment
WARNING: Deploying from local path: ../publish/publish-linux.zip
ERROR: An error occurred during deployment. Status Code: 504, Details: 504.0 GatewayTimeout, Please visit https://mytestservice987654.scm.azurewebsites.net/api/deployments/latest to get more information about your deployment
az webapp deploy #2
WARNING: Initiating deployment
WARNING: Deploying from local path: ../publish/publish-linux.zip
WARNING: Deployment has completed successfully
WARNING: You can visit your app at: http://mytestservice987654.azurewebsites.net
but that feels like an ugly hack.
I also tried to make a HTTP request to the SCM after creation to "trigger" it , but that did not work.
I was looking at the WEBSITE_START_SCM_ON_SITE_CREATION, but that one can't be set using the Azure CLI commands.
I would like to know what is the correct way to do deployment, to avoid doing ugly hacks and other things to get it to work.
Is my script not supposed to work?
The .ZIP file I try to deploy is about 15MB in size.
Describe the bug
I try to create a plain simple powershell script to ZIP-deploy a Linux ASP.NET Core 8 application.
I have created the following test script that tries to deploy a .ZIP file '../publish/publish-linux.zip'.
My problem is that when I run this script (nothing exists before) then the deployment hangs on this statement:
DEBUG: urllib3.connectionpool: Starting new HTTPS connection (1): mytestservice987654.scm.azurewebsites.net:443
And I eventually end up with this error
ie, SCM is not responding.
Currently, it works if I call the az webapp deploy command twice, resulting in this output:
az webapp deploy #1 WARNING: Initiating deployment WARNING: Deploying from local path: ../publish/publish-linux.zip ERROR: An error occurred during deployment. Status Code: 504, Details: 504.0 GatewayTimeout, Please visit https://mytestservice987654.scm.azurewebsites.net/api/deployments/latest to get more information about your deployment az webapp deploy #2 WARNING: Initiating deployment WARNING: Deploying from local path: ../publish/publish-linux.zip WARNING: Deployment has completed successfully WARNING: You can visit your app at: http://mytestservice987654.azurewebsites.net
but that feels like an ugly hack.
I also tried to make a HTTP request to the SCM after creation to "trigger" it , but that did not work.
I was looking at the WEBSITE_START_SCM_ON_SITE_CREATION, but that one can't be set using the Azure CLI commands.
I would like to know what is the correct way to do deployment, to avoid doing ugly hacks and other things to get it to work.
Is my script not supposed to work?
The .ZIP file I try to deploy is about 15MB in size.
Related command
az webapp create
Errors
Error: An error occurred during deployment. Status Code: 504, Details: 504.0 GatewayTimeout, Please visit https://mytestservice987654.scm.azurewebsites.net/api/deployments/latest to get more information about your deployment
ERROR: cli.azure.cli.core.azclierror: An error occurred during deployment. Status Code: 504, Details: 504.0 GatewayTimeout, Please visit https://mytestservice987654.scm.azurewebsites.net/api/deployments/latest to get more information about your deployment
Issue script & Debug output
Expected behavior
I would expect the deployment to always work.
I would be able to be successfull as a developer, deploying to Azure... I should not need to spend a day trying to troubleshoot this problem....
Environment Summary
azure-cli 2.62.0
core 2.62.0 telemetry 1.1.0
Extensions: containerapp 0.3.53 interactive 0.5.3
Dependencies: msal 1.28.1 azure-mgmt-resource 23.1.1
Additional context
I will try to use New-AzWebApp instead, but I would expect the above to work.. ...