0

I have an Azure function and i would like to have an input blob in my azure function and then when i read it in c# code the input parameter is null.

Here is the function.json:

{
  "bindings": [
    {
      "authLevel": "function",
      "name": "req",
      "type": "httpTrigger",
      "direction": "in"
    },
    {
      "name": "$return",
      "type": "http",
      "direction": "out"
    },
    {
      "type": "blob",
      "name": "inputBlob",
      "path": "mystorageacountname/containername/file.csv",
      "connection": "mofunctions_STORAGE",
      "direction": "in"
    }
  ],
  "disabled": false
}

C# code is printing null:

public static async Task<HttpResponseMessage> Run(HttpRequestMessage req, string inputBlob, TraceWriter log)
{
// trying to print the name of inputBlob variable
return req.CreateResponse(HttpStatusCode.OK, "blob", inputBlob);



}

Any help is appreciate it?

1 Answer 1

1

Everything looks good in your example except the path to Blob. There's no need to specify mystorageacountname in the path. I copy-pasted your function and changed the path to containername/file and it works just fine.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.