pythonazureubuntuazure-web-app-serviceazure-cli

Unable to deploy a python application from az cli


We have a problem deploying a python application to App service using the Az CLI. Do you have an idea of the problem source ?

Here is the command we use. We execute it on an ubuntu VM. az webapp up -n $WEB_APP_NAME -l "westeurope" -g $RESOURCE_GROUP_NAME --sku B1

Here is the error we have. We don't get it :

Zip deployment failed. {'id': '200a84e1e024461ca2ef18edd8c3f607', 'status': 3, 'status_text': '', 'author_email': 'N/A', 'author': 'N/A', 'deployer': 'Push-Deployer', 'message': 'Created via a push deployment', 'progress': '', 'received_time': '2021-06-22T15:49:57.8395052Z', 'start_time': '2021-06-22T15:49:59.5399261Z', 'end_time': '2021-06-22T15:50:13.4118115Z', 'last_success_end_time': None, 'complete': True, 'active': False, 'is_temp': False, 'is_readonly': True, 'url': 'https://test-surveillance-api-2.scm.azurewebsites.net/api/deployments/latest', 'log_url': 'https://test-surveillance-api-2.scm.azurewebsites.net/api/deployments/latest/log', 'site_name': 'test-surveillance-api-2'}. Please run the command az webapp log deployment show -n test-surveillance-api-2 -g azr-rg-bpceit-bpcesa-d2i2`

Here is a link to the full deployment log. In those logs, I saw the following errors. They are not clear haha.

knack.util.CLIError: Zip deployment failed. {'id': '273909f740bd44de93111b0576d235f9', 'status': 3, 'status_text': '', 'author_email': 'N/A', 'author': 'N/A', 'deployer': 'Push-Deployer', 'message': 'Created via a push deployment', 'progress': '', 'received_time': '2021-06-22T16:11:12.3912894Z', 'start_time': '2021-06-22T16:11:13.5603203Z', 'end_time': '2021-06-22T16:11:23.3248561Z', 'last_success_end_time': None, 'complete': True, 'active': False, 'is_temp': False, 'is_readonly': True, 'url': 'https://test-surveillance-api-2.scm.azurewebsites.net/api/deployments/latest', 'log_url': 'https://test-surveillance-api-2.scm.azurewebsites.net/api/deployments/latest/log', 'site_name': 'test-surveillance-api-2'}. Please run the command az webapp log deployment show -n test-surveillance-api-2 -g azr-rg-bpceit-bpcesa-d2i2
cli.azure.cli.core.azclierror : Zip deployment failed. {'id': '273909f740bd44de93111b0576d235f9', 'status': 3, 'status_text': '', 'author_email': 'N/A', 'author': 'N/A', 'deployer': 'Push-Deployer', 'message': 'Created via a push deployment', 'progress': '', 'received_time': '2021-06-22T16:11:12.3912894Z', 'start_time': '2021-06-22T16:11:13.5603203Z', 'end_time': '2021-06-22T16:11:23.3248561Z', 'last_success_end_time': None, 'complete': True, 'active': False, 'is_temp': False, 'is_readonly': True, 'url': 'https://test-surveillance-api-2.scm.azurewebsites.net/api/deployments/latest', 'log_url': 'https://test-surveillance-api-2.scm.azurewebsites.net/api/deployments/latest/log', 'site_name': 'test-surveillance-api-2'}. Please run the command az webapp log deployment show -n test-surveillance-api-2 -g azr-rg-bpceit-bpcesa-d2i2
Zip deployment failed. {'id': '273909f740bd44de93111b0576d235f9', 'status': 3, 'status_text': '', 'author_email': 'N/A', 'author': 'N/A', 'deployer': 'Push-Deployer', 'message': 'Created via a push deployment', 'progress': '', 'received_time': '2021-06-22T16:11:12.3912894Z', 'start_time': '2021-06-22T16:11:13.5603203Z', 'end_time': '2021-06-22T16:11:23.3248561Z', 'last_success_end_time': None, 'complete': True, 'active': False, 'is_temp': False, 'is_readonly': True, 'url': 'https://test-surveillance-api-2.scm.azurewebsites.net/api/deployments/latest', 'log_url': 'https://test-surveillance-api-2.scm.azurewebsites.net/api/deployments/latest/log', 'site_name': 'test-surveillance-api-2'}. Please run the command az webapp log deployment show -n test-surveillance-api-2 -g azr-rg-bpceit-bpcesa-d2i2

More details about the environment: OS : Ubuntu 18.04.5 LTS Python version : 3.8.7


Solution

  • I solved my problem !!

    After doing some researches, I noticed the problem was with the requirements.txt and the repository containing my files.

    So, I copied the files in another repository. And I generated the requirements.txt with the python of my python virtual env (./env/bin/python3), not with the one installed in the OS.

    I don't understand why this was the problem. If someone knows, please tell me.

    Have a good day.