Azure Logic Apps
Azure Logic Apps is a Microsoft cloud service that helps to schedule, automate, and orchestrate tasks, business processes, and workflows when we need to integrate apps, data, systems, and services across enterprises or organizations.
Twitter bots are possibly a thing of the past now, yet can be still useful. A twitter bot can automatically perform tweet/retweet/follow etc actions, either blindly or based on certain conditions. There are many ways to design one, using the host of libraries provided by twitter or the Twitter API itself on developer.twitter.com.
Twitter bot on Azure Logic Apps
Let’s say we want a twitter bot that retweets every time I tweet something or if it meets the search criteria by containing keywords as follows:
#rubberduckdev #nuget #msbuild #azure azure azure devops #rubberduckdev
Development (drag & drop, few clicks or simple steps)
Development of logic apps is as simple as few clicks on the Azure portal. A programming background is useful to understand what is going on and troubleshoot if necessary. But it is not mandatory, well that is how Logic Apps have been marketed.
The steps to take are as follows:
Setup a blank logic app. Follow Microsoft documentation if unsure how it is done.
Enter values for
When a new tweet is posteddialog box. Notice how
Search textis set as a query. This is because it is a search query in the underlying logic app. So, to satisfy our requirements from subtopic above, it should be
from:@rubberduckdev OR #nuget OR #msbuild OR #azure OR azure OR azure devops OR #rubberduckdev
That’s it. Now save and our Twitter bot is ready. This bot will retweet any tweet by Twitter handle @rubberduckdev or any tweet that contains any of the keywords listed above. Although by design, this will only trigger once per hour (see limitations subtopic) and hence you may not see retweets straightaway. See the logic app run history for a detailed log.
The Twitter logic app connector documentation page provides details on the limitations it comes with. One of the main limiting factors is
"Frequency of trigger polls: 1 hour", meaning the logic app will trigger only once an hour.
The azure logic app is useful for a whole lot more than a simple twitter bot. But this is a simple example to get to understand how it works. It comes with a host of connectors, easy to use visual workflow and also many default templates to work with which are described in much detail in Microsoft documentation. Our twitter bot aims to do a simple task of retweeting and so the limitation we discussed above is not a major issue. Other connectors can come with their advantages as well as limitations, and we can also create a user voice if we want specific connectors. With all this in mind, I hope this introduction to logic apps was useful and if you have any comments, thoughts or queries please do comment below or tweet me.
Cover image from cmarix.