1
votes

Im currently trying to deploy a flask app to a Azure Web App using continuous integration on Visual Studio Team Services.

I have completed the following

  • Set up an Web App in Azure
  • Created a build which packages the flask app into a zip
  • Created a release definition using the "Deploy Python Flask App to Azure App Service". This installs python and deploys an azure app service. I have left everything as default
  • Within the definition there is an Inline Script Which has the following properties

    if NOT exist requirements.txt (
     echo No Requirements.txt found.
     EXIT /b 0
     )
     if NOT exist "%PYTHON_EXT_PATH%" (
     echo PYTHON_EXT_PATH not avaliable or path not set. >&2
     EXIT /b 1
     )
     echo Installing dependencies
     call "%PYTHON_EXT_PATH%" -m pip install -U setuptools
     if %errorlevel% NEQ 0 (
     echo Failed to install setuptools >&2
     EXIT /b 1
     )
     call "%PYTHON_EXT_PATH%" -m pip install -r requirements.txt
     if %errorlevel% NEQ 0 (
     echo Failed to install dependencies via pip >&2
     EXIT /b 1
     )
    

When i run the release definition i get an error saying

PYTHON_EXT_PATH not avaliable or path not set.

I cant seem to find any documentation to suggest how to set this path up. I've tried including it in the web config and I've also tried setting it in the environment variables.

Can anyone explain what im missing?

Thanks

1
I can’t reproduce this issue. What’s the detail of the release definition? Add system.debug variable and set to true, then create a new release, then share the detail release log on the OneDrive. - starian chen-MSFT
What's the application settings of your web app in azure? What's the result if you try it in a new release definition with a new web app? - starian chen-MSFT

1 Answers

0
votes

We have fixed this issue. The deployment is rolling out right now. In case you want to make changes to the task yourself -- here are the details.

Output Variable name in Manage App service task PYTHON_EXT

In the App Service Deploy task:

Web.Config Parameters:

-WSGI_HANDLER "app.wsgi_app()" -PYTHON_PATH "$(PYTHON_EXT)\python.exe" -PYTHON_WFASTCGI_PATH "$(PYTHON_EXT)\wfastcgi.py" -appType python_Bottle

Inline Script:

@echo off
if NOT exist requirements.txt (
echo No Requirements.txt found.
EXIT /b 0
)
if NOT exist "$(PYTHON_EXT)/python.exe" (
echo Python extension not available >&2
EXIT /b 1
)
echo Installing dependencies
call "$(PYTHON_EXT)/python.exe" -m pip install -U setuptools
if %errorlevel% NEQ 0 (
echo Failed to install setuptools >&2
EXIT /b 1`enter code here`
)
call "$(PYTHON_EXT)/python.exe" -m pip install -r requirements.txt
if %errorlevel% NEQ 0 (
echo Failed to install dependencies>&2`enter code here`
EXIT /b 1
)