0

I am creating a blobTrigger on an existing Function App for a new folder (status/inbound/Received) on an existing blob as follows:

 public static class MyTrigger
    {

        [FunctionName("MyTrigger")]
        public static async Task Run([BlobTrigger("status" + "/" + "inbound" + "/" + "Received" + "/{name}", Connection = "AzureWebJobsStorage")] Stream myBlob, string name, ILogger log)
        {
            log.LogInformation($"Blob trigger MyTriggerfunction Name:{name} Size: {myBlob.Length} Bytes");
            try
            {
                log.LogInformation($"MyTrigger processing a request for blob name: {name}");
                
            }
            catch (Exception ex)
            {
                log.LogError("MyTrigger" + ex.ToString());
            }
        }

    }

When I drop a file into the folder Received nothing happens. When I look at the live logs nothing happens.

When I change the path to a folder that has been created already it works. It does not work whenever I add a new directory

David Andrews
  • 71
  • 2
  • 8

2 Answers2

0

After reproducing from our end here is how it worked, You can directly give the path "status/inbound/Received/{name}".

Here is the code that worked for us

public static void Run([BlobTrigger("status/inbound/Received/{name}", Connection = "AzureWebJobsStorage")]Stream myBlob, string name, ILogger log)
        {
            log.LogInformation($"C# Blob trigger function Processed blob\n Name:{name} \n Size: {myBlob.Length} Bytes");
            try
            {
                log.LogInformation($"MyTrigger processing a request for blob name: {name}");

            }
            catch (Exception ex)
            {
                log.LogError("MyTrigger" + ex.ToString());
            }
        }

In logs

enter image description here

SwethaKandikonda
  • 7,513
  • 2
  • 4
  • 18
0

I resolved this issue myself. I figured out there is was a bug in the earlier version of Nuget package Microsoft.Azure.Webjobs.Extensions.Storage. I upgraded the version and it solved my issue.

Jeremy Caney
  • 7,102
  • 69
  • 48
  • 77
David Andrews
  • 71
  • 2
  • 8