0
votes

I have a service bus triggered function, and would like to email the message to a specific recipient. I have already setup Sendgrid and tested a function that can send emails. I want to trigger this email function whenever a message arrives in the queue.

I have also setup all the required parameters for the queue.

2
Why not to make it in the same function? as Input service bus queue and for output send grid emails? - shachar
Thank you, it was what I ended up doing and it works fine. - EagerNoob

2 Answers

1
votes

You can use either a HTTP trigger, or a storage queue trigger to initiate other functions.

If you use a webhook, and use the masterKey from D:\home\data\Functions\secrets by setting the authorisation to admin, you can ensure that only the masterKey can be used. (there is more at https://azure.microsoft.com/en-us/documentation/articles/functions-bindings-http-webhook/ )

Typically you would use a webhook if you need a response and a storage queue if you want a fire-and-forget (since you can't easily get a response into the calling functions execution)

This also gives you the ancillary benefit of being able to run functions in multiple languages without needing to worry about exchanging data.

0
votes

I would suggest to decouple the entire functionallity you want to share including, including orchestrationtriggered and activitytriggered functions in a separated class; added with dependency injection; and then call it from your multiple functions.

Otherwise as other have suggested, the recommendation is or comunnicating with Queue Storage or using Logic Apps (https://docs.microsoft.com/en-us/azure/azure-functions/functions-best-practices#cross-function-communication)