【问题标题】:Azure Functions - Value cannot be null. (Parameter 'connectionString')Azure Functions - 值不能为空。 (参数“连接字符串”)
【发布时间】:2020-11-15 13:21:30
【问题描述】:

我试图设置简单的 Azure 函数来读取 XML 流并将其同步回数据库。我的计划是使用时间触发器每天执行一次函数。

但是,事情看起来不太好。即使我不使用数据库,我也会收到以下错误:

[Error] Executed 'Functions.<func-name>' (Failed, Id=<func-id>, Duration=1ms)Value cannot be null. (Parameter 'connectionString')

我目前正在尝试执行以下功能:

module.exports = async function(context, req) {
    context.res = {
        body: "Success!"
    };
};

同样的结果。我无法运行它。

我已将连接字符串添加到配置 -> 连接字符串(根据消息,我认为我错过了)。

我的 functions.json 文件如下所示:

{
  "bindings": [
    {
      "name": "myTimer",
      "type": "timerTrigger",
      "direction": "in",
      "schedule": "0 0 * * * *"
    },
    {
      "type": "http",
      "direction": "out",
      "name": "res"
    }
  ]
}

我也尝试过运行 C# 函数 - 结果相同。

那么,我错过了什么?

【问题讨论】:

    标签: javascript azure azure-functions


    【解决方案1】:

    从微软记录到最好的。

    缺少 AzureWebJobsStorage 应用设置。

    解决方案:

    1. 创建存储帐户(或使用现有帐户)
    2. 转到 Function App 的配置
    3. 将带有连接字符串的 AzureWebJobsStorage 添加到您的存储帐户(可在存储帐户概述 -> 访问密钥中找到)

    【讨论】:

      猜你喜欢
      • 2021-01-29
      • 1970-01-01
      • 2018-09-24
      • 2020-06-30
      • 2019-11-06
      • 2022-11-04
      • 2022-01-08
      • 1970-01-01
      • 2020-01-29
      相关资源
      最近更新 更多