pl-jay
pl-jay

Reputation: 1100

Web app deployment failure with zip deployment?

i have just begun with Azure.

Here i have simple flask api and i tried to deploy the app with azure cli in vscode then it ends up with following error. I'm completely new to Azure so can anyone please sort out this for me. Thanks in advance.

enter image description here

Upvotes: 0

Views: 2954

Answers (1)

Ivan Glasenberg
Ivan Glasenberg

Reputation: 29985

I cannot reproduce your issue, but here is what I did and it can publish successfully using python 3.7. Note: I'm using azure cli version 2.0.75. Please check your cli version using az --version, and upgrade it as per this link if you're using old version.

1.Create a web app for Linux, the screenshot as below:

enter image description here

2.After step 1 is completed, then in visual studio code, open the folder where your project locates, and follow this doc:

In visual studio code -> terminal, use the following commands first(you need to nav to the folder where the project locates):

py -3 -m venv env
env\scripts\activate
pip install -r requirements.txt
Set-Item Env:FLASK_APP ".\application.py"
flask run

Then, input the commands to publish the flask api:

az webapp up --sku F1 -n <app-name> -l <location-name>

it can be published successfully. The screenshot as below:

enter image description here

Upvotes: 1

Related Questions