When I deploy my Azure Static Web App to Azure with an Azure Function which makes use of PuppeteerSharp, I see the following error in Application Insights:
Exception while executing function: ProductsGet Access to the path 'C:\Program Files (x86)\SiteExtensions\Functions\3.3.1\32bit\.local-chromium' is denied.
If I look locally, there is a 'bin\Debug\netcoreapp3.1' folder with a '.local-chromium' folder within it.
I tried to change the path where the '.local-chromium' folder is, with
var tempPath = Path.Combine(rootPath, "bin/.local-chromium");
var browserFetcher = new BrowserFetcher(new BrowserFetcherOptions
{
Path = tempPath
});
await browserFetcher.DownloadAsync();
await using var browser = await Puppeteer.LaunchAsync(
new LaunchOptions
{
Headless = true,
ExecutablePath = browserFetcher.RevisionInfo(BrowserFetcher.DefaultChromiumRevision).ExecutablePath
}
);
But that doesn't work. With normal Azure Functions, I can have a look with Kudu to see the folder structure. Is that also possible with Azure Static Web Apps?