【发布时间】:2020-05-21 12:25:53
【问题描述】:
我第一次尝试使用无服务器功能。 更具体地说,我是在编写一个要部署在天蓝色云上的 nodejs12 函数。
我为此使用serverless。当尝试使用 sls offline 在本地运行默认生成的函数(hello & goodbye)时,我总是遇到以下错误:
Value cannot be null. (Parameter 'provider')
虽然我确定这不是空值,正如您在我的 serverless.yml 中看到的那样:
service: test
provider:
name: azure
region: North Europe
runtime: nodejs12
plugins:
- serverless-azure-functions
package:
exclude:
- local.settings.json
- .vscode/**
functions:
hello:
handler: src/handlers/hello.sayHello
events:
- http: true
x-azure-settings:
methods:
- GET
authLevel: anonymous
goodbye:
handler: src/handlers/goodbye.sayGoodbye
events:
- http: true
x-azure-settings:
methods:
- GET
authLevel: anonymous
不确定这里的问题是什么?我正在使用最新版本的serverless (1.71.3) 和serverless-azure-functions (2.0.2) 和azure-functions-core-tools (2.7.2508)。
完整的输出日志你能找到here.
编辑 1: 即使使用 core-tools 版本 3,它也不起作用。我得到同样的错误。
编辑 2: 我找到了 this issue,但清理缓存对我不起作用。我也在 MacOS Catalina 上。
【问题讨论】:
标签: azure-functions serverless serverless-offline