Azure函数-值不能为null.(参数"connectionString") [英] Azure Functions - Value cannot be null. (Parameter 'connectionString')
问题描述
我试图设置简单的Azure函数以读取XML流并将其同步回数据库.我的计划是每天使用时间触发器执行一次功能.
I was trying to setup simple Azure Function to read a XML stream and sync it back to the database. My plan was to use a Time Trigger to execute the function once per day.
但是,情况看起来并不好.即使不使用数据库,我也会遇到以下错误:
Howerver, things are not looking great. I'm getting the following error, even if I don't use a database:
[Error] Executed 'Functions.<func-name>' (Failed, Id=<func-id>, Duration=1ms)Value cannot be null. (Parameter 'connectionString')
我当前正在尝试执行以下功能:
I'm currently trying to execute the following function:
module.exports = async function(context, req) {
context.res = {
body: "Success!"
};
};
相同的结果.我无法运行.
Same result. I can't run it.
我已将连接字符串添加到配置->连接字符串(根据消息,我认为我已经错过了).
I've added a Connection String to the Configuration -> Connection Strings (I thought that I've missed that, based on the message).
我的functions.json文件如下:
My functions.json file looks like:
{
"bindings": [
{
"name": "myTimer",
"type": "timerTrigger",
"direction": "in",
"schedule": "0 0 * * * *"
},
{
"type": "http",
"direction": "out",
"name": "res"
}
]
}
我也尝试过运行C#函数-结果相同.
I've also tried running a C# function - same result.
那么,我错过了什么?
推荐答案
从Microsoft登录最好.
AzureWebJobsStorage应用设置丢失.
解决方案:
- 创建存储帐户(或使用现有帐户)
- 转到功能应用程序的配置
- 将带有连接字符串的AzureWebJobsStorage添加到您的存储帐户(可以在存储帐户概述->访问密钥"中找到)
这篇关于Azure函数-值不能为null.(参数"connectionString")的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!