Azure Data Factory Dynamic Content with base64 Conversion

2.4k Views Asked by At

I am making a HTTP Triggered Azure Function Call from Azure Data Factory. I am not able to make the HTTP body of the function activity correct for HTTP POST. This is the HTTP body

{ "filename": "@{item().BatchId}.json", "filecontent": @{base64(item().BatchId)} }

I am passing two things: filename and filecontent, which needs to be base64 encoded before sending it to the function. base64 function is NOT working with the dynamic value of BatchId but the filename is working fine in the above example.

1

There are 1 best solutions below

0
Andy T On

It was not working because the BatchId was not a string. Following line started working -

{ "filename": "@{item().BatchId}.json", containername:"insightsfiles", "filecontent": "@{base64(string(item().BatchId)) }"}