- This is using Playright which is pretty new and maintained by Microsoft.
- This uses a Linux NodeJs Azure Function so you will have to use Visual Studio or Visual Studio code to deploy.
- This was made to faciliate pnp/pnpframework#105 till there is a proper solution from the PnP Framework.
- If you are using VS Code ensure your
.vscode/settings.json
has"azureFunctions.scmDoBuildDuringDeployment": true
- Ensure Azure Function has
"PLAYWRIGHT_BROWSERS_PATH" :0
in its function app settings. Remove this if you are testing locally. - Navigate to /home/site/wwwroot and run npm install and npm install playwright-chromium. I had it failed on me when playwright-chromium didn't get installed as part of the package.json.
- This require a SharePoint Admin account providing username and password to Playwright to get access to the required page as SharePoint isn't an anonymous access system. So it is advisable to create a separate account or update to use Azure KeyVault
- https://anthonychu.ca/post/azure-functions-headless-chromium-puppeteer-playwright/
- https://dotnetthoughts.net/running-playwright-on-azure-functions/
- Link with KeyVault
- Create Linux NodeJs Azure Function App that is a running on an app service plan.
- func azure functionapp publish --build remote
- Using kudu run npm install and npm install playwright-chromium