question

madilgul avatar image
0 Votes"
madilgul asked HimanshuSinha-MSFT commented

Azure Data Factory "base64(string)" expression

Hi,

I have a scenario where I am reading .pdf file from azure blob storage, converting it to base64 and then pass it on to an api which accepts a base64 encoded message.
I am doing some internal testing to see if my base64 message is correctly formed and I am running into an issue. The base64 message that is created by data factory pipeline, when decoded and saved is resulting in an empty pdf document.

191510-untitled.png



The expression in "Base64 PDF Letter" shape is ==> @base64(activity('Get PDF').output.Response)


I also verified by uploading my base64 message to following url. The resulting pdf is blank.
https://base64.guru/converter/decode/pdf


The pdf i am reading is a valid file. I wrote a console app to base64 encode and decode using c# just to check the difference in base64 message created. It was very different.
I am not sure If i am doing something wrong here. Can you please help. Thanks.

Regards,
Adil

azure-data-factory
untitled.png (5.3 KiB)
· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hello @madilgul,
Thanks for the question and using MS Q&A platform.

I have a scenario where I am reading .pdf file from azure blob storage

Can You please clarify how are you doing this . As I undertsand as of now ADF does notr support the PDF format .
https://docs.microsoft.com/en-us/azure/data-factory/supported-file-formats-and-compression-codecs


Azure Data Factory supports the following file formats. Refer to each article for format-based settings.
Avro format
Binary format
Delimited text format
Excel format
JSON format
ORC format
Parquet format
XML format



We will wait to hear from you . .
Thanks
Himanshu


0 Votes 0 ·
madilgul avatar image madilgul HimanshuSinha-MSFT ·

Hi Himanshu,

Thank you for your reply. I am trying to read the pdf using web activity.
Target is to read a pdf document, Base64 encode the message and pass it to an API for further processing.
When the API tried to decode base64 message and save it as PDF it resulted in a blank PDF.

Following steps can help you reproduce the issue on your machine.

1 - Read any pdf document using web activity. ( try this online pdf ==> https://www.clickdimensions.com/links/TestPDFfile.pdf)
2 - base64 encode this pdf
3 - decodebase64 message and write to a blob storage. When you open pdf it is either blank or faulty.


You can also take base64 encoded pdf from step number 2 and try to decode pdf via this url (https://base64.guru/converter/decode/pdf).
You will get the same result here i.e blank pdf.

Thanks,
-Adil

0 Votes 0 ·

Hello @madilgul,
Thanks for the patience , unfortunately we are not getting the kind of response from the team here . if you have a support plan you may file a support ticket, else could you please send an email to azcommunity@microsoft.com with the below details, so that we can create a one-time-free support ticket for you to work closely on this matter.
Subscription ID:
Subject : Attn Himanshu
Please let me know once you have done the same.
Thanks
Himanshu

0 Votes 0 ·

0 Answers