I am using Blob trigger in my project to process the content of files.
I am using Azure Blob Trigger to initiate the process of a file execution.
[FunctionName("FunctionImportCatalogue")]
public static void Run([BlobTrigger("importcontainer/{name}", Connection = "StorageConnection")]Stream myBlob, string name, TraceWriter log)
{}
Depending on where the code is published the blobcontainer should change accordingly. I mean I want the "importcontainer" to be configured in config files. Can I do that?
As far as I know, you could configure it in the local.settings.json
.
Add the code below to the Values
in the file, my sample container named 'workitems'.
"importcontainer": "workitems"
Then change the code below in the .cs file.
public static void Run([BlobTrigger("%importcontainer%/{name}", Connection = "StorageConnection")]Stream myBlob, string name, TraceWriter log)
Then publish the Function to Azure, you should set importcontainer
in the Application settings in the portal like screenshot below, because the setting will be used.
Run the function and add a blob to the container, it works fine on my side.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With