File Encryption And Decryption Using ADF
DESCRIPTION:
Files will be placed on the SFTP server. They should be staged in blob storage and from the blob, they will be loaded into the Azure SQL database. After loading into SQL DB, they should be archived and loaded as encrypted files in the Archive folder.
DATA FLOW:
SOLUTION:
STEP1:
STEP2:
As a next step, multiple files with the same structure in blob storage will be loaded into the Azure SQL DB table. The data in SQL DB is as follows:
STEP3:
STEP5:
HEADERS: -
NAME | VALUE |
x-functions-key | n78BD9RuKkRnYMGJdrNy3YwFh/GLfTXmWBg0PT6bl27ralh2Apoclg== |
CODE USED FOR ENCRYPTION:
CODE USED FOR DECRYPTION:
STEP6:
Once web activity encrypts data, use a copy activity to write web activity output into blob storage and its process is as follows:
6.1. Upload a text file (e.g., template.txt) with some random text like “my data” (sample data in an empty text file. Any data can be written into it).
6.2. In the “copy activity” source take Azure Blob Storage as a dataset and select the above uploaded “template.txt” file into it.
6.3. Create an additional column, give some name and assign “web activity” output to it as a value.
Provide Wildcard folder path and wildcard filename as “item().name”.
Additional Columns:
NAME | VALUE |
MYDATA | @activity('Azure function for file encryption').output.Response |
6.4. In sink select Azure Blob Storage as a destination where encrypted data has to be written, and in mapping import schema and assign the additional column “MYDATA” to “Column1 which was generated randomly.
Comments
Post a Comment