Ross Attrill Unfortunately, you cannot use whole body in the binding that way. Instead, refer to JSON payloads section in Azure Function binding, and you can use payloads properties like below for JavaScript.
const sp_sampletest = input.sql({
commandText: 'dbo.InsertTextAndReturn',
parameters: '@InputText={sampleJSONBody}',
commandType: 'StoredProcedure',
connectionStringSetting: 'SqlConnectionString',
});
app.http('httpTrigger1', {
methods: ['POST'],
authLevel: 'anonymous',
extraInputs: [sp_sampletest],
handler: async (request, context) => {
const response = context.extraInputs.get(sp_sampletest);
return { jsonBody: response };
}
});
Sample Request/Response:
Note: There are few limitations with respect to payload size, performance etc. and please review the doc for more info. JSON deserialization is automatically performed for JavaScript (in case C#, F#, you need to define a class for de-serialization).
I hope this helps and let me know if you have any questions.
If you found the answer to your question helpful, please take a moment to mark it as Yes
for others to benefit from your experience. Or simply add a comment tagging me and would be happy to answer your questions.