1

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. 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.

This is how I deployed my function:

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

1 Answer 1

2

Following link will help.

https://learn.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.
  • The StorageAccount attribute applied to the same parameter as the BlobTrigger attribute.
  • The StorageAccount attribute applied to the function.
  • The StorageAccount attribute applied to the class.
  • The default storage account for the function app ("AzureWebJobsStorage" app setting).

In your case last settings will apply. Check app settings at Azure.

Sign up to request clarification or add additional context in comments.

1 Comment

Thank you very much, I've been reading microsoft docs and wasn't able to understand that order that you mention

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.