I want to read blob contents using azure logic app get blob contents connector and send that contents as attachment via email using azure logic app send email connector.
Attachments could be one or more.
Send email requires attachment data in following json format :
[
{
"ContentBytes": "@{body('Get_blob_content')}",
"Name": "Test"
}
]
Best Answer
You could add
When a blob is added or modified (properties only) (Preview)
astrigger
to focus on theContainer
which you want to listen to.Then add
Get blob content
asaction
to get the blob content.Finally add
Send email
as action to sent email to users. Here I chooseGmail
and as you have addGet blob content
action, so inAttachments Content
column you could insertFile Content
which is equal to@{base64(body('Get_blob_content'))}
.If you want to add one or more attachment, you only need to click
Add new item
inSend email
action.Here is designer screenshot and code view screenshot.
For attaching a dynamic number of files to an email, there is a toggle in the UI to use an input array instead
which changes the UI to something like this
The input here expects an array of items in this format