We have a pgp encrypted file from the source team with Public key. Now we need to decrypt that file in our Azure. Is there any way to decrypt the pgp files in Azure?

Mummana, Venkatesh Babu 6 Reputation points
2022-09-14T12:36:28.837+00:00

We have a pgp encrypted file from the source team with Public key. Now we need to decrypt that file in our Azure. Is there any way to decrypt the pgp files in Azure?

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
9,542 questions
0 comments No comments
{count} vote

1 answer

Sort by: Most helpful
  1. KranthiPakala-MSFT 46,422 Reputation points Microsoft Employee
    2022-09-16T00:20:50.867+00:00

    Hello @Mummana, Venkatesh Babu ,

    Thanks for the question and using MS Q&A platform.

    Currently there is no direct functionality in Azure for PGP encryption/Decryption of files. But you can follow any of the below approaches.

    1. Using Azure Data Factory: You can write command shells as described in this article and execute them in Databrics notebook activity in ADF. For more detailed information please refer to this article by a community volunteer: PGP File Decrypt Using Azure Data Factory

    Below is the sample command for decryption:

    gpg --no-tty --batch --import /dbfs/mnt/datalake/configuration/config_decrypt/privatekey.asc  
    mkdir -p /dbfs/mnt/datalake/<Output directory>  
    gpg --no-tty --batch --yes --ignore-mdc-error --pinentry-mode=loopback --passphrase-fd 1 --passphrase-file /dbfs/mnt/datalake/configuration/config_decrypt/Passphrase.txt --output /dbfs/mnt/datalake/<Output directory>/${output_decrypted_filename} --decrypt /dbfs/mnt/datalake/<Input Directory>/${input_encrypted_filename}  
    
    1. Using Logic Apps/ADF: You can write your own code for encryption/decryption, and execute it in Azure function within ADF using Azure function activity or call that code in Azure functions within Logic apps, or as described in the conversation: What is best way to do PGP file encryption/decryption in logic apps

    Hope this will help. Please let us know if any further queries.

    ------------------------------

    • Please don't forget to click on 130616-image.png or upvote 130671-image.png button whenever the information provided helps you. Original posters help the community find answers faster by identifying the correct answer. Here is how
    2 people found this answer helpful.