I have the following Function (BlobTrigger) running as an isolated process (net8). Its failing to trigger when I upload a file to the storage account. I’m not sure why its not triggering. Any help would be appreciated.
[Function(nameof(ProcessData))]
[StorageAccount("StorageAccountConnectionString")]
public async Task Run([BlobTrigger("%MyDirectory%/{filename}")]
Stream jsonBlob, string filename)
{
logger.LogInformation($"Triggered for file {filename}");
}
local.settings.json
{
"IsEncrypted": false,
"Values": {
"StorageAccountConnectionString": "DefaultEndpointsProtocol=https;AccountName=*****",
"MyDirectory": "container/folder1",
}
}
Libraries
<TargetFramework>net8.0</TargetFramework>
<AzureFunctionsVersion>v4</AzureFunctionsVersion>
<OutputType>Exe</OutputType>
...
...
<PackageReference Include="Microsoft.Azure.Functions.Extensions" Version="1.1.0" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Storage" Version="6.2.0" />
<PackageReference Include="Microsoft.Azure.Functions.Worker" Version="1.20.0" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Sdk" Version="1.16.2" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Timer" Version="4.3.0" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Http" Version="3.1.0" />
I found that setting up the Function to use the Connection parameter of the BlobTrigger attribute rather than decorating the method with the StorageAccount attribute worked for me.