I am creating an Azure blob trigger function for the first time and I find it really strange that the connection string can only be stored inside the Values section of my local.settings.json
public async Task Run([BlobTrigger("container/filename.json", Connection = "TriggerConnectionString")]
Stream myBlob, ILogger log)
{
"IsEncrypted": false,
"Values": {
"AzureWebJobsStorage": "UseDevelopmentStorage=true",
"TriggerConnectionString": "myConnectionString"
},
In another part of my code I am connecting to the same storage account to read a file and perform some action, and to do that I am using IOptions to read a section of my config which you can see below, but because of this trigger I want to add, I will need to have the connection string in two places in my settings.
"MyStorageSettings": {
"ConnectionString": "myConnectionString",
"ContainerName": "myStorageContainerName",
"FileName": "filename.json"
}
Is there a way for the connection string in the blob trigger to read from a section in local.settings.json other than the Values section (i.e. the ConnectionString under MyStorageSettings)?