Azure 函数 - .NET 剧作家

问题描述 投票:0回答:0

我们在 Cron 触发器上有一个 Azure 函数,每天运行一次。 在此触发器中,我们希望使用 .NET Playwright 库来抓取网页。

我们在 Windows 上以 Dotnet 隔离模式运行此 Azure 函数 V4。 PLAYWRIGHT_BROWSERS_PATH 设置为 D:\DWASFiles\Sites**\VirtualDirectory0\Browsers

启动时,会运行 powershell 安装脚本来安装具有操作系统依赖项的 chrome。

我们的日志显示: Get-WmiObject:不支持此类接口 在 C:\home\site\wwwroot.playwright\package in\install_media_pack.ps1:1

  • $osInfo = Get-WmiObject -Win32_OperatingSystem 类
  • CategoryInfo:未指定:(:) [Get-WmiObject],UnauthorizedA
  • FullyQualifiedErrorId:System.UnauthorizedAccessException,Microsoft.Pow 错误:EPERM:不允许操作,mkdir 'D:\DWASFiles\Sites#1teamleader-synchronizer-test\VirtualDirectory0\Browsers'

我还尝试在发布管道中安装浏览器并将它们包含在要发布的文件夹中。这需要 PLAYWRIGHT_BROWSERS_PATH 的不同路径。

除了剧作家然后抛出:(可执行文件不存在于C:\ home \ site \ wwwroot.playwright \ package.local-browser

.net azure azure-functions playwright
© www.soinside.com 2019 - 2024. All rights reserved.