Forum Discussion
How to send an email with a csv attachment
- 8 months ago
Hi dyordanov,
If I were you, I would do the following.
If you created the files using Notebook, they are initially stored in the storage account. Then, in the pipeline (after Notebook), create a lookup activity that lists the files. Transfer this to a variable, which in turn transfers it to a web activity that controls the Logic APP.I hope that was reasonably clear 🙂
Here an simple Guide.
1. Lookup Activity
- Source: your Blob Storage container.
- Configuration:- First row only = false (so that all files are listed).
- Query or path filter: e.g., only files with a specific prefix or extension (.xlsx).
- Result: JSON array with all files found.2. Set Variable Activity
- Transfers the list from the Lookup Activity to a pipeline variable (e.g., fileList).
- Optional: You can transform the list (e.g., extract names only).3. Web Activity
-Target: your Logic App HTTP Trigger.
- Method: POST.I haven't tested this in this configuration yet, but I use something similar at our place.
Best regards
Feel free to leave kudos or accept it as a solution. This will also help other community members.
- 8 months ago
I understand :),
another option is to switch to Event Grid in the Logic APP. I've done that before, too.
You simply replace the trigger that triggers the action with When a resource event occurs (Azure Event Grid). I think that's what it should be called.The advantage is that you only get one event instead of multiple events.
Here is the procedure.
Go to the Storage Account and click Events.
1. Create and configure the event grid accordingly. Important: the event type is Microsoft.Storage.BlobCreated.
2. Change Logic APP.
- Remove the old trigger “When a blob is added or modified”.
- Add a new trigger:
- When a resource event occurs (Azure Event Grid) -
Configure:Subscription: your Azure subscription.
Resource Type: Storage Account.
Event Type: Microsoft.Storage.BlobCreated.I hope that helps.
Best regards
As others have mentioned, the email pipeline activity doesn't appear to be able to send attachments.
The way we've bypassed this limitation is via a notebook that writes to the SMTP server of our mail system. Our legacy system uses pretty much the same method, so it was a matter of porting it over.