azure-functions-python-worker
azure-functions-python-worker copied to clipboard
ERROR: cannot install cffi-1.16.0 dependency: binary dependencies without wheels are not supported when building locally.
Version
4.0.5801
Description
Building Azure Functions packages fails when using packages that rely on cffi (e.g. azure-identity).
I am trying to deploy code to function apps through Bicep (URL deployment) and a storage account that contains the zip package. I create the .zip by running func pack in the function app but keep getting this error:
ERROR: cannot install cffi-1.16.0 dependency: binary dependencies without wheels are not supported when building locally. Use the "--build remote" option to build dependencies on the Azure Functions build server, or "--build-native-deps" option to automatically build and configure the dependencies using a Docker container. More information at https://aka.ms/func-python-publish
I tried building with the following steps: Windows Python 3.11 Windows Python 3.9 Macbook Python 10 Docker (through --build-native-deps) Python 3.11 Docker (through --build-native-deps) Python 3.9
I already figured out that this specifically happens when trying to use azure-identity so the steps to reproduce are really easy.
If there are better ways to automate deployment (Python to consumption plan func apps) I would like to hear them because this has been causing quite the frustration.
Steps to reproduce
- Create function app (I have Python V1 model)
- Run func pack to make sure it works
- Add azure-identity to requirements.txt
- Run func pack to get the error
I face the same issue. Do we have a fix in the works?
@tganwani I fixed this by installing my requirements through DevOps pipelines steps in my CI/CD pipeline which fortunately works and takes care of the whole packaging process now.
Something that has to be considered what I noticed is that running your pip install locally has to have the same python version as the function app runtime you're pushing to. Might be worth checking in your case.
I'm cleaning up issues - closing this one due to inactivity and suggested fix provided. If you're still facing this issue, please feel free to reopen