azure-functionsazure-blob-trigger

Binding expression to read folder from config section?


What is wrong with my binding expression when trying to use a Blob triggered function?

  [BlobTrigger("%CustomerABC:InboundFolder%/{name}", Connection = "AzureWebJobsStorage")]

container name in local.settings.json, within a section called CustomerABC

"CustomerABC": {
    "value1": "Endpoint=sb://testxxxxxxxxxxxxxxxxxx
    "value2": "testsubscriptionName"
    "InboundFolder": "Bob/inbound",
  }
  

I get an error stating that CustomerABC:InboundFolder does not resolve to a path


Solution

  • By trial and error we figured out the binding expression does not support sections.

    And I think the full value is used to bind to a key. So the {name} part has to go.

    This binding should work, no additional {name} and no config sections:

    [BlobTrigger("%CustomerABC_InboundFolder%", Connection = "AzureWebJobsStorage")]