I've got this working successfully and importing pandas.
I had to put quite a lot of extra parameters to pip install to get this to work. But it has been working reliably for a couple years now.
This is deploying to a Linux deployment (not sure if that matters or not).
Here is a snippet from my azure_pipelines.yml:
- task: UsePythonVersion@0
displayName: 'Use Python 3.9'
inputs:
versionSpec: 3.9
- bash: |
python -m venv .venv
source .venv/bin/activate
pip install --upgrade pip
pip install --target="./.python_packages/lib/site-packages" -r ./requirements.txt --use-pep517
workingDirectory: $(workingDirectory)
displayName: 'Install application dependencies'
requirements.txt:
wheel
azure-functions
openpyxl
pandas
The reason for the extra target parameter in pip install, is because it's default location for installing packages is not where Azure is expecting to find them. So hence without installing them at .python_packages/lib/site-packages the build will not be able to find and import them.