我需要一个 Azure Functions Blob 触发器来触发应用程序设置在运行时提供的存储桶。我读到可以这样做:
[FunctionName("Process")]
public static async Task Process([BlobTrigger("%BucketName%/{name}", Connection = "AzureWebJobsStorage")] Stream avroBlobStream, string name, TraceWriter log)
{
}
如果我BucketName
只有Values
在 appsettings.json 的字段中,这在本地有效。
{
"IsEncrypted": false,
"Values": {
"BucketName": "capture-bucket",
}
}
如果它不在 Values 字段中,这是错误:
[6/24/2019 5:52:15 PM] Function 'SomeClass.Process' failed indexing and will be disabled.
[6/24/2019 5:52:15 PM] No job functions found. Try making your job classes and methods public. If you're using binding extensions (e.g. ServiceBus, Timers, etc.) make sure you've called the registration method for the extension(s) in your startup code (e.g. config.UseServiceBus(), config.UseTimers(), etc.).
我在 Azure App 函数中设置了 just BucketName
,但它给了我同样的错误。您能否建议在实际的 Azure 环境中应该调用什么设置或我做错了什么?应该是Values:BucketName
吗?但我从未在 Microsoft 网站上看到过带有Values:
前缀的示例。