Ensure playwright
is in requirements.txt.
Deploy to Azure Functions v4 consumption plan using remote build (this is the default).
The app won't work because chromium is not installed. Add 2 app settings:
PLAYWRIGHT_BROWSERS_PATH
: /home/site/wwwroot
/home/site/wwwroot
POST_BUILD_COMMAND
: PYTHONPATH=/tmp/zipdeploy/extracted/.python_packages/lib/site-packages /tmp/oryx/platforms/python/3.9.7/bin/python3.9 -m playwright install chromium
playwright install chromium
in the Python version that was used to build the app. It'll install it to /home/site/wwwroot
because of the previous app setting.Deploy again, this time the post build command will run and hopefully it works.