Azure Functions + Logic Apps + Twitter + Telegram

I was a bit bored and decided to create this setup 🙂

My function code is hosted on github. You can use that to setup an Azure Function which can accept calls from a Telegram bot. You would need to create App Settings to represent you Telegram bot key and Logic Apps key (which you would obtain after creating the app).

After that you would create a Logic App in Azure with the following definition. You would need to adjust the xxx to proper values for your subscription.

Right now this bot works the following way:

You send anything to it (to the bot in telegram) it responds with an inline keyboard and then you press either “MrLlamaSC” or Placeholder. That sends a response to the Function App.

When you push the “MrLlamaSC” button it would send a response, that would get processed by the Azure Functions that would send a request to a Logic App that would send a request back to Azure Function which would send the tweet back to the Bot.

If you go through the code you would easily understand how the function works. I’ve decided against using the SDK just to illustrate that its possible to do with plain HTTP requests and a bit of Logic Apps magic. I will do a post on Logic Apps a bit down the road.

 

Bot Picture

Written on April 15, 2017