Playwright install command on azure app service webssh causing the server crash

Mehrdad Mehrjoo 20 Reputation points
2023-09-22T16:44:39.3866667+00:00

I am trying to use Playwright on azure app service.
I have added

- name: Install Playwright Browsers
        run: playwright install --with-deps

into Github action but when I call api to launch playwright browser it can not fine it.

Also I tried to install it using webssh.

(antenv) root@9ce5356eef10:/tmp/8dbbb7404646538# playwright install chromium

Downloading Chromium 117.0.5938.62 (playwright build v1080) from https://playwright.azureedge.net/builds/chromium/1080/chromium-linux.zip

153.1 Mb [====================] 100% 0.0s

Chromium 117.0.5938.62 (playwright build v1080) downloaded to /home/site/wwwroot/.cache/ms-playwright/chromium-1080

Downloading FFMPEG playwright build v1009 from https://playwright.azureedge.net/builds/ffmpeg/1009/ffmpeg-linux.zip

2.6 Mb [====================] 100% 0.0s

FFMPEG playwright build v1009 downloaded to /home/site/wwwroot/.cache/ms-playwright/ffmpeg-1009

It cause the server crash and I get error 500 after that

Can anyone help me with this issue?

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,932 questions
{count} votes

Accepted answer
  1. Sedat SALMAN 14,180 Reputation points MVP
    2023-09-25T03:03:44.1766667+00:00

    Installing browsers during the GitHub Actions workflow may not make them available in the Azure App Service runtime. Azure App Service has a specific environment, and installing browsers there isn't the same as on a typical VM or a local machine. Direct installation via webssh is also problematic because you're altering the environment in a way that Azure App Service might not be equipped to handle, leading to crashes.

    Instead of installing Playwright directly on Azure App Service, consider using Docker with Azure App Service. By using a Docker container, you have more control over the environment, ensuring that all dependencies for Playwright are present.

    2 people found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.