locked
Email attachment to Blob Storage RRS feed

  • Question

  • I followed all the steps in this tutorial to copy an email attachment to blob storage. It is working fine. One thing I noticed is that when I send the same file (with the same name) via email, I don't see another file created in the blob storage. I need to know if it is overwriting the file that is there. 

    Here is the link to the process in place:

    https://docs.microsoft.com/en-us/azure/logic-apps/tutorial-process-email-attachments-workflow#get-support

    Tuesday, July 17, 2018 7:40 PM

Answers

  • By design, Azure Blob Storage will overwrite the contents of a blob if you're trying to upload new content with same blob name.

    You can use the 'Get Blob Metadata using path' action to check for the existence of the blob. You can then can use a condition (based on the status code of the get blob metadata action result) to run actions depending on whether the blob already exists.

    https://stackoverflow.com/questions/47716780/dont-overwrite-azure-blob-storage

    https://stackoverflow.com/questions/45865939/logic-apps-blob-overwriting-file-of-same-name


    • Edited by Ankur Billore Tuesday, July 17, 2018 8:51 PM
    • Marked as answer by JoshJJames Wednesday, July 18, 2018 3:24 AM
    Tuesday, July 17, 2018 8:50 PM

All replies

  • Hi Josh - Have you looked to see if the timestamp was different for the "Last Modified" of the file? You could also test by providing different content to these files with same names? If you find that it is overwriting, which i think would be most likely the case, how about adding an another "if" condition in your workflow to rename the file if it already exists?
    Tuesday, July 17, 2018 8:45 PM
  • By design, Azure Blob Storage will overwrite the contents of a blob if you're trying to upload new content with same blob name.

    You can use the 'Get Blob Metadata using path' action to check for the existence of the blob. You can then can use a condition (based on the status code of the get blob metadata action result) to run actions depending on whether the blob already exists.

    https://stackoverflow.com/questions/47716780/dont-overwrite-azure-blob-storage

    https://stackoverflow.com/questions/45865939/logic-apps-blob-overwriting-file-of-same-name


    • Edited by Ankur Billore Tuesday, July 17, 2018 8:51 PM
    • Marked as answer by JoshJJames Wednesday, July 18, 2018 3:24 AM
    Tuesday, July 17, 2018 8:50 PM