我有以下功能代码:
public static class FunctionCheckEmail
{
[FunctionName("FunctionCheckEmail")]
public static IActionResult Run(
[HttpTrigger(AuthorizationLevel.Function, "post", Route = null)] HttpRequest req,
[Queue("email-message-admin-confirmation", Connection = "StorageConnectionString")]CloudQueue outputQueue,
ExecutionContext context,
ILogger log)
{
log.LogInformation("C# HTTP trigger function processed a request.");
return new AcceptedResult();
}
}
Internal Server Error
.
如果我删除队列绑定,那么它可以工作:
public static class FunctionCheckEmail
{
[FunctionName("FunctionCheckEmail")]
public static IActionResult Run(
[HttpTrigger(AuthorizationLevel.Function, "post", Route = null)] HttpRequest req,
ExecutionContext context,
ILogger log)
{
log.LogInformation("C# HTTP trigger function processed a request.");
return new AcceptedResult();
}
}
其他带有队列绑定的函数可以正常工作:
public static class FunctionWarningNotification
{
[FunctionName("FunctionWarningNotification")]
public static void Run(
[QueueTrigger("emails-warning-notification", Connection = "StorageConnectionString")]string myQueueItem,
[SendGrid] out SendGridMessage message,
ExecutionContext context,
ILogger log)
{
//....
}
}
主机.json:
{
"version": "2.0",
"extensions": {}
}
local.settings.json文件:
{
"IsEncrypted": false,
"Values": {
"AzureWebJobsStorage": "UseDevelopmentStorage=true",
"AzureWebJobsDashboard": "UseDevelopmentStorage=true",
"AzureWebJobsSendGridApiKey": "XXXX",
"FUNCTIONS_WORKER_RUNTIME": "dotnet",
"StorageConnectionString": "DefaultEndpointsProtocol=https;AccountName=domainregistration;AccountKey=XXXX"
}
}