Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
232 views
in Technique[技术] by (71.8m points)

python - Azure DevOps self hosted windows agent to Azure Linux function app deployment

I am working on Linux based Azure functions with Python 3.7 and trying to use Azure DevOps. My python project has requirements like psycopg2-binary, cython to name a few of them.

We have been provisioned a self hosted windows agent pool in Azure Devops. I am building a pipeline and my concern is that the deployment won't be successful since the build would happen on the dev agent (on windows) and deployment is on Azure Functions (linux).

Do we need a linux agent in this case?

Please advise.

question from:https://stackoverflow.com/questions/66052648/azure-devops-self-hosted-windows-agent-to-azure-linux-function-app-deployment

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Do we need a linux agent in this case?

As far as I know, you don't need to use a Linux agent to build the Python project.

You can directly use the python package built by windows agent to deploy to the linux azure function.

When you using tasks(e.g. Azure Functions task or Azure App Service deploy) to deploy the package to Azure Function app, it will directly publish the packages and the Configuration to Azure Function app.

The prerequisite is that the deployed package meets the requirements of the task: the package is a zip or war file. So you need to use the Archive files task to pack the published files.

enter image description here

If the configuration of the python project can be run in the linux system, the same configuration can also be run in the linux Function App.

For more details about deploy a Python project to Azure, you could refer to this doc: deploy a Python web app to Azure App Service on Linux


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...