Closed weightmans-seanbrogan closed 1 year ago
Do you mind sharing a small reproduction repository which we can run locally to reproduce this issue?
You can reproduce this locally if I understand you correctly?
I can reproduce on a fresh Azure Functions created with Visual Studio Code, Potential fix (https://github.com/microsoft/playwright-dotnet/pull/2720) is a revert, just need to make sure it does not regress .NET 7 which is claimed to have fixed.
System info
Description
I'm trying to get playwright browsers installed locally within an azure function underneath the .playwright/packages/.local_browsers directory so that an azure function can be self contained within a cloud hosted azure function. The below provided code is a separate example i have created from the main project that replicates the issue i am having. I have tried multiple approaches to do this using environment variables but none have seemed to work except for one.
The only time I have managed to get it to work is when:
Source code
Config file
.csproj file
Steps
Expected The expected behavior is that the function will execute every 1 minute to open up the requested web page in a chromium instance.
Actual The actual result is a "System.IO.FileNotFoundException: 'Could not load file or assembly 'System.Text.Json, Version=7.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51" error when calling Playwright.CreateAsync.
Are there any official examples of how to use playwright within an azure function as I can't seem to find much information on this.
Help with this would be greatly appreciated :)