Azure / logicapps

Azure Logic Apps labs, samples, and tools
MIT License
363 stars 301 forks source link

Problems sending a message to Service Bus using the Built In connector #143

Closed mikaelsand closed 4 years ago

mikaelsand commented 4 years ago

I am using the sample outlined in the video. I want to take the information that comes back from the Function and send it to a ServiceBus Queue. As usual I simply take the output of the function and put is as a body in the service bus connector action and also add application/json as content type. However: I get this strange error:

ServiceProviderActionFailed. Unable to cast object of type 'Newtonsoft.Json.Linq.JObject' to type 'Newtonsoft.Json.Linq.JValue'.

I am fully aware that the problem might be me and not the connector code.

image

rohithah commented 4 years ago

this is because the content of property expect a base64encoded string of the byte array for the content and the body from the previous action is an object. for example you can return "new JObject { x=}" and then pass @body('function').x as the inputs to "content"

mikaelsand commented 4 years ago

Great! Thanks, I love when the fault is mine 😊 easier to fix.

Skaffa Outlook för Androidhttps://aka.ms/ghei36


From: Rohitha Hewawasam notifications@github.com Sent: Saturday, July 25, 2020 3:50:51 AM To: Azure/logicapps logicapps@noreply.github.com Cc: Mikael Sand mikael_sand@hotmail.com; Author author@noreply.github.com Subject: Re: [Azure/logicapps] Problems sending a message to Service Bus using the Built In connector (#143)

this is because the content of property expect a base64encoded string of the byte array for the content and the body from the previous action is an object. for example you can return "new JObject { x=}" and then pass @Bodyhttps://github.com/Body('function').x as the inputs to "content"

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/Azure/logicapps/issues/143#issuecomment-663792696, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AE7EMJ2N4L2CQ4NEU3BD56LR5I27XANCNFSM4ONKO27Q.