0
votes

I have a WebJob:

public class StandardizeFileFunction : FunctionBase
{
    public static async Task StandardizeFile([BlobTrigger("foobar/Raw/{blobName}")] Stream input, string blobName)
    { ... }
}

The AzureWebJobsDashboard and AzureWebJobsStorage connection strings point to Azure, but I am running locally in debug mode.

In the past, the blob trigger was set up to work against "foo/Raw/{blobName}" and "foo2/Raw/{blobName}", but I have since done a clean build and deleted the bin and obj directories. Even so, I still see the WebJob accessing the old containers in addition to the new container. In the below, you'll see that containers foo and foo2 are being accessed despite the function being set up for foobar:

StandardizeFileFunction.StandardizeFile
Job host started
Executing 'StandardizeFileFunction.StandardizeFile' (Reason='New blob detected: foo/Raw/Study/062014.txt', Id=98c90b27-b1b4-464a-898c-8d9137c564a1)
Exception while executing function: StandardizeFileFunction.StandardizeFile
Executing 'StandardizeFileFunction.StandardizeFile' (Reason='New blob detected: foo2/Raw/Study/Temperature/HF732 1310-Room-3.txt', Id=90060f17-9a6f-47f2-a09d-b39784f5152f)
Microsoft.Azure.WebJobs.Host.FunctionInvocationException: Exception while executing function: StandardizeFileFunction.StandardizeFile ---> System.InvalidOperationException: Exception binding parameter 'blobName' ---> System.InvalidOperationException: Binding data does not contain expected value 'blobName'.
   at Microsoft.Azure.WebJobs.Host.Bindings.Data.ClassDataBinding`1.BindAsync(BindingContext context)
   at Microsoft.Azure.WebJobs.Host.Triggers.TriggeredFunctionBinding`1.<BindCoreAsync>d__8.MoveNext()
   --- End of inner exception stack trace ---

Why does it keep accessing the old containers and how do I stop it?

UPDATE I repro-ed this with a new WebJob project. Here's what I did:

  1. Use Azure Storage Explorer to add hundreds of files to container "foo"
  2. Run the WebJob (it doesn't need to do anything)
  3. After a couple dozen blobs are processed, stop the WebJob
  4. Change the container name in the blob trigger (like "fooed" or "abcde")
  5. Run the WebJob
  6. At this point you may see errors, if not, keep switching back and forth between "foo" and "fooed" until you do.
1

1 Answers

0
votes

Executing 'StandardizeFileFunction.StandardizeFile' (Reason='New blob detected: foo/Raw/Study/062014.txt', Id=98c90b27-b1b4-464a-898c-8d9137c564a1)

public static async Task StandardizeFile([BlobTrigger("foobar/Raw/{blobName}")] Stream input, string blobName)

According to your description and error message, I found in your error message your function is triggered by blob container “foo/foo2”.

But your code is triggered by blob container “foobar”.

I think maybe something wrong with your solution projects.

I suggest you could start a new webjob and try again. Make sure you have started the right project.