question

yangchowmun-6565 avatar image
0 Votes"
yangchowmun-6565 asked ShaikMaheer-MSFT answered

azure data factory copy image

I am trying to copy images from azure blob storage to azure MSSQL.
For the dataset setup in azure blob storage, I think the most suitable one will be binary.
But I am getting an error 'Sink must be binary when source is binary dataset' when trying to push it to the MSSQL.

May I know
1. is it possible to copy image data using ADF else any other alternative for this
2. what is the suitable data type for image when we are defining the dataset for ADF

Thanks,

azure-data-factory
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.

Samy-7940 avatar image
0 Votes"
Samy-7940 answered yangchowmun-6565 commented

Hi @yangchowmun-6565 , When using Binary dataset in copy activity, you can only copy from Binary dataset to Binary dataset ,and Sink must be binary

when source is binary dataset. Thanks

· 5
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.

@Samy-7940 , thanks.
For image files, what should I use as a data type when defining the dataset?
What Is the practice to copy image data type? Thanks

0 Votes 0 ·

Hi @Samy-7940 , thanks for the link.
I have looked through the link and it is more on intro on how to setup a copy pipeline to pull text file from blob storage to MSSQL which I do not encounter any issue for this.

I am uncertain on if ADF could perform copy activity for images file such as png and save it as in the MSSQL file in varchar(max). It will be great if you could share with me any link that is related to this.

0 Votes 0 ·
Show more comments
ShaikMaheer-MSFT avatar image
0 Votes"
ShaikMaheer-MSFT answered

Hi @yangchowmun-6565 ,

Thank you for posting query in Microsoft Q&A Platform.

We can use binary format when we want to copy file as it is from one location to another location. But as you rightly pointed in case of binary format your sink also should be binary.

You can give try using deiminated text format with below setting to read your image as some text data and load that to your sink database column.

198181-image.png

Between, you also explore using azure functions or databricks notebooks to read image data and load to sink.

Please try above and let us know how it goes. If you found any other work around feel free to share same.


Please consider hitting Accept Answer button. Accepted answers help community as well.


image.png (99.9 KiB)
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.