my project has a dependency on SQLAlchemy. it is listed in requirements.txt. after deployed my service failed to run due to missing module of SQLAlchemy.
how to manually install requirements.txt in Azure Devops?
⚠Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
@HK-Zhang Thank you for the question.
You can try using the Python script task with something like:
pip3 install -r requirements.txt
If this is not what you had in mind please comment below.
@msebolt, where should I put this script: pip3 install -r requirements.txt ?
I put it as a post-deployment script. I'll get permission denied issue when running the pipeline.
Re-assigning to the author.
This problem has been repeating, your Build pipeline does NOT automatically installs dependencies during deployment (i.e. a missing pip install -r requirements.txt step). I wonder how is this not catered in the Azure Pipeline's deployment process wheras the az webapp up command does ?
By the way, the article itself is awecome! Great contents and adequate explanation. Way to go team !
Thanks everyone; I'm looking into what's needed here.
I am facing the same issue, getting permission denied if we explicitly add the pip3.6 install in the post-deployment script. Also, in my case there is extra index url as well.
Hi @kraigb , please let us know if any update is there on this, this is a show stopper for us to deploy our production workload to azure app service with flask API. Are there any workarounds to get it(Flask API to Azure App Service(Linux)) deployed with all the dependencies meanwhile waiting for the actual fix?
@kraigb, the original issue I opened is now closed with resolution from @Dann1112. It will be great if we can update this information as well in our documentation.
@HK-Zhang and @jxjia, please check the resolution provided on the linked GitHub issue, it fixed mine.
Yes, I'll be working on a doc update. I've finally gotten the same solutions through internal conversations.
Here's the solution from the other issue:
There is a parameter that gets added when you create a Python App Service from command line that is not created when you set up an App Service for Python manually.
{
"name": "SCM_DO_BUILD_DURING_DEPLOYMENT",
"value": "True",
"slotSetting": false
}
You'll need to go to App Service -> Configuration -> Application Settings -> New Application Setting and add it there.
Source: Enable/disable build actions (Configurable settings)
https://github.com/projectkudu/kudu/wiki/Configurable-settings#enabledisable-build-actions
@HK-Zhang Please close this issue at your convenience, as the solution is in a previous comment.
Most helpful comment
Yes, I'll be working on a doc update. I've finally gotten the same solutions through internal conversations.
Here's the solution from the other issue:
There is a parameter that gets added when you create a Python App Service from command line that is not created when you set up an App Service for Python manually.
{
"name": "SCM_DO_BUILD_DURING_DEPLOYMENT",
"value": "True",
"slotSetting": false
}
You'll need to go to App Service -> Configuration -> Application Settings -> New Application Setting and add it there.
Source: Enable/disable build actions (Configurable settings)
https://github.com/projectkudu/kudu/wiki/Configurable-settings#enabledisable-build-actions