user312687
user312687

Reputation: 13

Check file size on outlook email attachments in azure logic app

I have built a logic app to monitor an outlook 365 email inbox. Part of the app is to save any attachments sent with emails that meet my criteria to blob storage and then my own database. The images/footers in emails are also being sent as attachments, so I'd like to filter the attachments on size. I have so far tried using a dynamic expression to check the length of the attachment but this hasn't worked, I also looked into using Get File Metadata actions but all of these require a filepath or an ID for the file in whatever hosting service provides the actions. My file is simply sitting in logic app memory at this stage. Any ideas?

Upvotes: 0

Views: 661

Answers (1)

user312687
user312687

Reputation: 13

I have fixed this in a roundabout way - I save all attachments to blob storage. Then I use azure blob storage - get metadata from file to check the size - i have a condition off the back of this: if the size is less than my minimum size i delete it from blob storage, otherwise I add it to my database.

TIP: when deleting from blob storage always use the filepath. Got multiple false flag errors as I was trying to delete based off the file name.

Steps: Below is a screenshot of my steps to do this - if there is a better way please let me know.

Logic app steps

Upvotes: 1

Related Questions