我想創建一些Azure函數。我開始通過教程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的功能實際上只是模板代碼)
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.
我試着重寫連接字符串幾次,但似乎無法得到r錯誤的ID。我查閱了信息here,但仍無法使其工作。
我缺少什麼?
您是否嘗試過在每個網址結束後刪除斜線?目前你有「core.windows.net/;」但你應該有「core.windows.net」。它有幫助嗎? – DotNetMatt