0
votes

Can't seem to get my c# Azure Function to return data to my logic app correctly. Within the local Function testing I get the data correctly. When I call it from the Logic App I can see the content length returns as 0 when returned as a string. If I pass it as a json with number=foo, I can get the "number" key entry, but the value from foo is still blank.

Local run within the Function gives the results

Data returned to the logic app shows Content length is 0

output binding is default

return new HttpResponseMessage(HttpStatusCode.OK) 
{
    Content = new StringContent(foo, Encoding.UTF8, "application/json")
};
1

1 Answers

1
votes

As I have tested, it works fine in my site.

Within the local Function testing I get the data correctly.

You mean you use azure portal to run the function and you could get the data.

I am not sure if you make some logical judgments on foo. If the foo value it null it would get the second picture you provided.

Here are my working steps and you could refer to:

1.Test with azure function on portal

public static HttpResponseMessage Run(HttpRequestMessage req, TraceWriter log)
{
    log.Info("C# HTTP trigger function processed a request.");

    string foo="123456789";

    return new HttpResponseMessage(HttpStatusCode.OK) 
    {
        Content = new StringContent(foo, Encoding.UTF8, "application/json")
    };
}

2.Logic app design: use queue trigger enter image description here

3.Add message in queue. enter image description here