Open implodingduck opened 2 years ago
Hi @pragnagopa , Could you please look into this issue.
@v-bbalaiagar @pragnagopa Do you have any update on this issue? We also run into that problem when trying to upgrade to premium plan.
Hi @v-bbalaiagar @pragnagopa I am having the same issue. I initially deployed my function with playwright using the consumption plan and it works fine, but when I change the plan to Premium it stops working and says there are some missing dependencies. Will try using docker!
Here is the docker file that works for my needs with azure premium plan and playwright chromium.
# To enable ssh & remote debugging on app service change the base image to the one below
FROM mcr.microsoft.com/azure-functions/node:4-node16-appservice
ENV AzureWebJobsScriptRoot=/home/site/wwwroot \
AzureFunctionsJobHost__Logging__Console__IsEnabled=true \
PLAYWRIGHT_BROWSERS_PATH=0
# Base list from https://github.com/ahmelsayed/chrome-headless-func-test/blob/master/Dockerfile
RUN apt-get update && \
apt-get install -y gconf-service libasound2 libatk1.0-0 libatk-bridge2.0-0 libc6 \
libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgcc1 libgconf-2-4 \
libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 \
libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 \
libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 ca-certificates fonts-liberation \
libnss3 lsb-release xdg-utils wget libgbm-dev
COPY . /home/site/wwwroot
RUN cd /home/site/wwwroot && \
npm install && \
npx playwright install chromium && \
npm run build
Hi @lukasz-zoglowek, wow! Thanks for the file, I will try using it and let you know how it goes :)
Hey @lukasz-zoglowek I just wanted to thank you for the Dockerfile. I just had to do some small changes and it worked perfectly. I also created a docker-compose.yaml to read all my environment variables. You helped a lot, thank you :)
I also used this tutorial: Create a function on Linux using a custom container and it helped a lot. Here is the docker-compose.yaml in case anyone in the future needs it.
version: '3.9'
services:
<NAME_OF_YOUR_SERVICE>:
container_name: <NAME_OF_YOUR_CONTAINER>
image: <NAME_OF_YOUR_IMAGE>
ports:
- 7071:80
env_file:
- .env
restart: always
Describe the bug When trying to use the NodeJS Playwright library in a Linux Premium Function the code fails with:
Please note this works in a Serverless/Consumption Function just fine.
To Reproduce Steps to reproduce the behavior:
module.exports = async function (context, req) { context.log('JavaScript HTTP trigger function processed a request.');
}