У меня есть это azure function
, которое должно read a message from service bus queue.
Я уже передал строку подключения в код, по-прежнему выдает ошибку при запуске func -
Set the connection string named 'Endpoint=sb://demoser
vicebus2019.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKe
y;[Hidden Credential]' in the connectionStrings section of the .config file in t
he following format <add name="Endpoint=sb://demoservicebus2019.servicebus.windo
ws.net/;SharedAccessKeyName=RootManageSharedAccessKey;[Hidden Credential]" conne
ctionString="DefaultEndpointsProtocol=http|https;AccountName=NAME;AccountKey=KEY
код-
Function1.cs
public static class Function1
{
[FunctionName("Function1")]
public static void Run([QueueTrigger("customer", Connection = "Endpoint=sb://demoservicebus2019.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=text")]string myQueueItem, TraceWriter log)
{
log.Info($"C# Queue trigger function processed: {myQueueItem}");
}
}
local.setting.json
{
"IsEncrypted": false,
"Values": {
"AzureWebJobsStorage": "storageaccount-connectionstring",
"AzureWebJobsDashboard": "storageaccount-connectionstring"
}
}