剧作家 azure 功能不安装 chromium Python based

Playwright azure function doesn't install chromium Python based

我尝试执行一个基于 Python 的 azure 函数并遇到这个问题

PLAYWRITH_BROWSERS_PATH=0 已经设置好了,我也试过把剧作家安装在 requeriments.txt 但它也不起作用。我想在 .vscode 路径上的 tasks.json 中添加一个任务,但我不知道该怎么做。

PLAYWRITH_BROWSERS_PATH=0

请确保您的上述配置正确。设置中有一些拼写错误。就像 PLAYWRIGHT_BROWSERS_PATH = 0

在你的local.settings.json中应该是

{

"IsEncrypted": false,

    "Values": {
    
        "AzureWebJobsStorage": "",
        
        "FUNCTIONS_WORKER_RUNTIME": "python",
        
        "PLAYWRIGHT_BROWSERS_PATH": "0"
    
    }

}

并且在您的 requirement.txt 文件中它应该是

azure-functions
playwright==1.18.0

在这里我们可以看到编剧运行在本地和部署后的天蓝色 当地的:

蔚蓝: