我将尝试创建一个Azure函数(.NET core),从存储账户中检索SaS,但我无法理解为什么无法访问该存储。
函数签名:
运行时出现以下错误:
``` Error indexing method 'GetBlobSaS' Microsoft.Azure.WebJobs.Host: Cannot bind parameter 'storage' to type StorageAccount. Make sure the parameter Type is supported by the binding. If you're using binding extensions (e.g. Azure Storage, ServiceBus, Timers, etc.) make sure you've called the registration method for the extension(s) in your startup code (e.g. builder.AddAzureStorage(), builder.AddServiceBus(), builder.AddTimers(), etc.). ```
如果我直接创建存储账户引用,则可以正常工作。
我哪里理解错误或做错了呢?
函数签名:
public static async Task<IActionResult> Run( [HttpTrigger(AuthorizationLevel.Anonymous, "get", Route = null)] HttpRequest req,
[StorageAccount("StorageConnectionString")] StorageAccount storage,
ILogger log)
运行时出现以下错误:
``` Error indexing method 'GetBlobSaS' Microsoft.Azure.WebJobs.Host: Cannot bind parameter 'storage' to type StorageAccount. Make sure the parameter Type is supported by the binding. If you're using binding extensions (e.g. Azure Storage, ServiceBus, Timers, etc.) make sure you've called the registration method for the extension(s) in your startup code (e.g. builder.AddAzureStorage(), builder.AddServiceBus(), builder.AddTimers(), etc.). ```
如果我直接创建存储账户引用,则可以正常工作。
var storage = StorageAccount.NewFromConnectionString(System.Environment.GetEnvironmentVariable("StorageConnectionString"));
我哪里理解错误或做错了呢?