【发布时间】:2020-12-29 19:49:16
【问题描述】:
尽管在这里或其他地方有很多帖子,但我仍然没有找到如何从 azure 函数读取 blob 存储。
我有如下
上述每个容器都有一个json文件“customer.json”
现在我需要调用我的函数并传递一个参数,例如“london”来检索伦敦客户
Customer customer= await azureFunctionService.GetCustomer(“London”);
函数应该是什么样子,理想情况下我想使用输入绑定从函数中读取 json 文件,但任何其他方式也可以。
[FunctionName("GetCustomer")]
public static void Run(
[HttpTrigger(AuthorizationLevel.Function, "get", "post", Route = null)] HttpRequest req,
string inputBlobPath,
[Blob("howDoIBuildPathIncludingtheparameter",
FileAccess.Read, Connection = "WhereDoIGetThis")] string json,
ILogger log)
{
// Not sure if anything is required here apart from logging when using input binding
//
}
有什么建议吗?
非常感谢
【问题讨论】:
-
您使用的是 Azure Function 2 或更高版本
-
@maxspan 您好是版本 3。默认创建我使用 Visual Studio 2019 16.5 创建函数。非常感谢任何帮助。
标签: azure-functions