-
Notifications
You must be signed in to change notification settings - Fork 201
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Python application fails when deployed from GitHub Actions #2582
Comments
We are using Azure Functions with Python/Linux and a few weeks ago our CI/CD with GitHub started generating errors whereas it was working seamlessly before. The deployments were success but there were errors regardless. The deployment logfiles did not identify the root cause. This seems to be the root cause of those errors thanks for identifying Ben. I will implement this workaround in our YML and hope this gets fixed towards the future. |
Hello @benheriford please let me know if the issue still exists. |
Hey @JAdluri it is still on going, for one application, it does seem to have resolved the issue, but strangely, another (identical) application seems to not be fixed by this |
In further testing we as well found that adding the following to the YML was able to resolve it for the second app as well, despite enable_oryx_build being set to 1 in the environment variables.
|
With the above resolution was it able to fix the issue for any other identical application. |
@JAdluri Yes, I have reproduced the issue a couple more times, it simply seems that the generated workflow from Azure is causing this issue due to missing a couple of things |
When deploying a basic function app from GitHub actions to azure on any plan, adding any import other than the default import logging and import azure.functions as func (for example from azure.cosmos import CosmosClient) the application will not show the function in portal, as well calling the function returns either 500 or 404 and the host errors with "module not found". I was able to identify the underlying cause for this. The yaml that is created when you link the application to GitHub from the Azure portal seems to have a slight issue.
the above is the yaml that is generated in portal, however, the venv does not seem to persist between steps and you have to modify the install dependencies step as shown below in order for the requirements.txt file to actually install.
name: Create and start virtual environment
run: |
python -m venv venv
source venv/bin/activate
run: |
source venv/bin/activate
pip install -r requirements.txt
The text was updated successfully, but these errors were encountered: