gpt4 book ai didi

azure - 如何解析 "connection string is not formatted correctly"?

转载 作者:行者123 更新时间:2023-12-01 11:19:16 24 4
gpt4 key购买 nike

我正在尝试创建一些 Azure Functions。我首先完成教程 here 。问题是,当我尝试在本地调试时,我不断收到错误。

这是我的local.settings.json:

{
"IsEncrypted": false,
"Values": {
"AzureWebJobsStorage": "DefaultEndpointsProtocol=https;AccountName=XYZ;AccountKey=<removed>;BlobEndpoint=https://XXX.blob.core.windows.net/;QueueEndpoint=https://XXX.queue.core.windows.net/;TableEndpoint=https://XXX.table.core.windows.net/;FileEndpoint=https://XXX.file.core.windows.net/;",
"AzureWebJobsDashboard": "",
"QueueStorage": "https://XXX.queue.core.windows.net/myqueue-items"
}
}

这是代码(实际上只是 Azure Functions 包含的模板化代码)

using System;
using Microsoft.Azure.WebJobs;
using Microsoft.Azure.WebJobs.Host;

namespace FunctionApp3
{
public static class SampleFunction
{
[FunctionName("SampleFunction")]
public static void Run([QueueTrigger("myqueue-items", Connection = "QueueStorage")]string myQueueItem, TraceWriter log)
{
log.Info($"C# Queue trigger function processed: {myQueueItem}");
}
}
}

这是本地控制台窗口的输出:

[8/29/2017 5:53:01 PM] Microsoft.Azure.WebJobs.Host: Error indexing method 'SampleFunction.Run'. Microsoft.Azure.WebJobs.Host: Failed to validate Microsoft Azure WebJobs SDK QueueStorage connection string. The Microsoft Azure Storage account connection string is not formatted correctly. Please visit https://go.microsoft.com/fwlink/?linkid=841340 for details about configuring Microsoft Azure Storage connection strings.
[8/29/2017 5:53:01 PM] Error indexing method 'SampleFunction.Run'
[8/29/2017 5:53:01 PM] Microsoft.Azure.WebJobs.Host: Error indexing method 'SampleFunction.Run'. Microsoft.Azure.WebJobs.Host: Failed to validate Microsoft Azure WebJobs SDK QueueStorage connection string. The Microsoft Azure Storage account connection string is not formatted correctly. Please visit https://go.microsoft.com/fwlink/?linkid=841340 for details about configuring Microsoft Azure Storage connection strings.

我尝试重写连接字符串几次,但似乎无法消除错误。我查阅了资料here但仍然无法让它发挥作用。

我错过了什么?

最佳答案

看起来它需要设置中的完整存储连接字符串,而不仅仅是队列的 URL。

类似于:

{
"IsEncrypted": false,
"Values": {
"AzureWebJobsStorage": "DefaultEndpointsProtocol=https;AccountName=XYZ;AccountKey=<removed>;BlobEndpoint=https://XXX.blob.core.windows.net/;QueueEndpoint=https://XXX.queue.core.windows.net/;TableEndpoint=https://XXX.table.core.windows.net/;FileEndpoint=https://XXX.file.core.windows.net/;",
"AzureWebJobsDashboard": "",
"QueueStorage": "DefaultEndpointsProtocol=https;AccountName=XYZ;AccountKey=<removed>;BlobEndpoint=https://XXX.blob.core.windows.net/;QueueEndpoint=https://XXX.queue.core.windows.net/;TableEndpoint=https://XXX.table.core.windows.net/;FileEndpoint=https://XXX.file.core.windows.net/;"
}
}

关于azure - 如何解析 "connection string is not formatted correctly"?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45945714/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com