Calling Azure Automation using IFTTT

IFTTT is a great way to trigger actions when other things happen. For example, and the reason that I use IFTTT the most is to do things when a blog post gets published. While IFTTT is pretty flexible, there are times when other, more complex actions need to be triggered. One way to do this is to have IFTTT call something which allows for more complex actions.

The perfect example is an Azure Automation runbook. While IFTTT doesn’t allow you to call an Azure Automation runbook directly, it does allow you to create a webhook which will trigger the runbook when the webhook is called. In order to this you have to configure the IFTTT action just right, but once you do the runbook will be triggered, and you’ll be able to pass values from the IFTTT action to the runbook.

When you create a runbook webhook it will give you a URL. That URL goes in the IFTTT web request screen in the URL Field.

For the Method field, change the drop-down menu from GET to POST.

For the Content Type field, change the drop-down menu to “application/json”.

Leave the Additional Headers field blank.

For the body field, set this field to a JSON string that contains the values that you wish to pass into the runbook. An example could look something like this.

{
"PostText": "{{EntryTitle}}",
"PostUrl": "{{EntryUrl}}",
"ImageUrl": "{{EntryImageUrl}}"
}

The values in the JSON document that are within double curly braces are variables, which are the ingredients passed from the “trigger action”IF” action of the action. Once done click the “Create action” button and then save the IFTTT action. The next time the action that triggers the IFTTT action is triggered, the IFTTT action will run and trigger the Azure Automation runbook.

The Azure Automation runbook can do anything that it needs, such as runbooks, PowerShell, or Python, so they can handle basically any task that needs to be done, and they can use the variables that are passed to the runbook.

Denny

Share

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Trust DCAC with your data

Your data systems may be treading water today, but are they prepared for the next phase of your business growth?