我试图在上传blob文件时触发Azure功能。该功能是从azure DevOps版本部署的。
Azure部署步骤(显示最相关的信息):
存储帐户: - 有一个文件夹[blob文件夹]我上传文件到。
Azure功能代码:
public async static Task Run([BlobTrigger("[blob folder]/{name}", Connection = "AzureWebJobsStorage")]Stream myBlob, string name, ILogger log)
{
// any breakpoint here is never hit.
}
function.json:
{
"generatedBy": "Microsoft.NET.Sdk.Functions-1.0.24",
"configurationSource": "attributes",
"bindings": [
{
"type": "blobTrigger",
"connection": "AzureWebJobsStorage",
"path": "[blob folder]/{name}",
"name": "myBlob"
}
],
"disabled": false,
"scriptFile": "../bin/[dllname].dll",
"entryPoint": "[namespace].[function].[command]"
}
存储和功能是同一资源组的一部分。功能应用程序设置包含值AzureWebJobsDashboard和AzureWebJobsStorage。我读过这些应该可以在this帖子的功能设置中找到。我还关闭了该功能的功能设置“Always On”,并确保该功能正在运行。
在本地运行和调试该功能(使用Azure存储模拟器和存储资源管理器)可以正常工作。将文件上传到blob文件夹后触发该功能。
在Azure中,似乎没有任何反应。我不是非常熟悉Azure环境,所以任何帮助都表示赞赏。
问题是由应用程序设置中的FUNCTIONS_EXTENSION_VERSION设置引起的。我需要将此设置更新为正确的版本。
我设法使用Jason Robert's blog post运行调试并调试我的函数的触发事件。