我正在尝试将azure SDK从v1更新到v3,并将其连接到Azure存储模拟器进行测试;使用控制台应用程序和.NET Framework。
它似乎不像以前使用的任何触发器一样,错误中的“ SomeFunction”是带有超时的简单QueueTrigger。
异常:Microsoft.Azure.WebJobs.Host.Indexers.FunctionIndexingException:'错误索引方法'* .SomeFunction'
内部异常:InvalidOperationException:未配置存储帐户“存储”。
[Timeout("00:30:00")]
public static async Task SomeFunction([QueueTrigger("queue")] CloudQueueMessage message, CancellationToken cancellationToken)
{
// do stuff
}
Run Code Online (Sandbox Code Playgroud)
app.config:
<connectionStrings>
<add name="AzureWebJobsDashboard" connectionString="AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;DefaultEndpointsProtocol=http;BlobEndpoint=http://127.0.0.1:10000/devstoreaccount1;QueueEndpoint=http://127.0.0.1:10001/devstoreaccount1;TableEndpoint=http://127.0.0.1:10002/devstoreaccount1;" />
<add name="AzureWebJobsStorage" connectionString="AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;DefaultEndpointsProtocol=http;BlobEndpoint=http://127.0.0.1:10000/devstoreaccount1;QueueEndpoint=http://127.0.0.1:10001/devstoreaccount1;TableEndpoint=http://127.0.0.1:10002/devstoreaccount1;" />
</connectionStrings>
<appSettings>
<add key="StorageConnectionString" value="UseDevelopmentStorage=true" />
<add key="AzureQueueName" value="queue" />
</appSettings>
Run Code Online (Sandbox Code Playgroud)