3
votes

I have created an Azure Function using the BlobTriggerCSharp example and configured the storage account and path:enter image description here

I double checkt that there is a mbrtest container within the configured storage account:

enter image description here

I didn't changed anything else. Here is the run.csx:

public static void Run(Stream myBlob, string name, TraceWriter log)
{
    log.Info($"C# Blob trigger function Processed blob\n Name:{name} \n Size: {myBlob.Length} Bytes");
}

When I press the run button, I get the following error:

2017-05-12T13:47:35.567 Exception while executing function: Functions.BlobTriggerCSharp1. Microsoft.Azure.WebJobs.Host: One or more errors occurred. Exception binding parameter 'myBlob'. Microsoft.Azure.WebJobs.Host: Blob identifiers must be in the format 'container/blob'.

Any hints?

2

2 Answers

4
votes

Try testing your function the following way:

  1. Add a file to your blob container. E.g. create a file called test.txt with content TestBody (note length 8).

  2. Now check the logs of you function. You should see something like

    2017-05-12T14:03:12.147 C# Blob trigger function Processed blob
    Name:test.txt
    Size: 8 Bytes
    
  3. Now, to use the Run button in the portal, go to Test tab and enter mbrtest/test.txt there. You should see the same message in the logs again (same file re-processed).

As far as I can tell, Run button won't create new blobs for you.

1
votes

I followed the solution of Mikhail with the three steps plus the configuration of the Function App.

You have to go to the Settings pannel in the left grid and click over "Configuration". Then I had a variable called AzureWebJobsStorage which was incorrect, so edit it and fill it with the parameters of the storage account. You can find them on the storage account in the Access Keys option.

The value that you need to add is something like this: (note that it is an example not a valid key) DefaultEndpointsProtocol=https;AccountName=YourAccountNameHere;AccountKey=RandomVerylong......stringVwithuninteligiblevalues)!%;EndpointSuffix=core.windows.net

This value shoulde go in the value of this setting variable

enter image description here