Martin Brandl
Martin Brandl

Reputation: 58931

Azure Function: Blob identifiers must be in the format 'container/blob'

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?

Upvotes: 3

Views: 5538

Answers (3)

jmoran
jmoran

Reputation: 164

I had exactly the same message error. In my case, it was because the Networking settings of the Storage. The public network access was limited by the filter of virtual networks and IP addresses.

I'd never imagine that could be the reason, because the message error wasn't related at all. It could be better if Azure improves the message errors and the logs will show something like "IP x.x.x.x it's not allowed".

In my case the solution was to add the Virtual Network of the Azure Function.

Upvotes: 0

MrPotatoServer
MrPotatoServer

Reputation: 185

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

Upvotes: 1

Mikhail Shilkov
Mikhail Shilkov

Reputation: 35124

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.

Upvotes: 4

Related Questions