简体   繁体   English

Azure Blob 触发 function 存储帐户连接

[英]Azure Blob triggered function storage account connection

Hi I'm creating a new blob triggered azure function and I wanted to understand the role of the "Connection=" param in the header of the function: Hi I'm creating a new blob triggered azure function and I wanted to understand the role of the "Connection=" param in the header of the function:

public void Run([BlobTrigger("workitems/{name}", Connection = "")]Stream myBlob, string name, ILogger log)

What I did is to completely remove that param and after I deployed it to my azure subscription, it worked with no issues.我所做的是完全删除该参数,并将其部署到我的 azure 订阅后,它没有问题。 So I'm wondering how the function is determining which storage account to use if I'm not specifying any particular account with the connection param.所以我想知道如果我没有使用连接参数指定任何特定帐户,function 如何确定要使用的存储帐户。

This is how I deployed my function:这就是我部署 function 的方式:

public void Run([BlobTrigger("workitems/{name}")]Stream myBlob, string name, ILogger log)

Following link will help.以下链接将有所帮助。

https://docs.microsoft.com/en-us/azure/azure-functions/functions-bindings-storage-blob-trigger?tabs=csharp https://docs.microsoft.com/en-us/azure/azure-functions/functions-bindings-storage-blob-trigger?tabs=csharp

Also to be specific.还要具体。

The storage account to use is determined in the following order:要使用的存储帐户按以下顺序确定:

  • The BlobTrigger attribute's Connection property. BlobTrigger 特性的 Connection 属性。
  • The StorageAccount attribute applied to the same parameter as the BlobTrigger attribute. StorageAccount 属性应用于与 BlobTrigger 属性相同的参数。
  • The StorageAccount attribute applied to the function.应用于 function 的 StorageAccount 属性。
  • The StorageAccount attribute applied to the class.应用于 class 的 StorageAccount 属性。
  • The default storage account for the function app ("AzureWebJobsStorage" app setting). function 应用程序的默认存储帐户(“AzureWebJobsStorage”应用程序设置)。

In your case last settings will apply.在您的情况下,将应用最后的设置。 Check app settings at Azure.检查 Azure 处的应用程序设置。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM