This integration uses webhooks to queue runbooks in Azure. To create a new webhook for a runbook, open the runbook and press the "Add webhook" button.
Follow the instructions to create a new webhook, and make a note of the url that is generated in this process. This will be needed for the Halo configuration later on.
Enabling the Integration
To enable the Azure Automation integration, navigate to Configuration > Integrations, and enable the module using the plus icon in the top right hand corner of the Azure Automation menu icon. Once the module has been enabled, click the menu icon to begin configuring it.
Halo Webhook - Basic Configuration
Press the new button to begin configuring a new Automation webhook in Halo. Specify the name of the runbook the webhook is for, and then copy the url generated earlier in Azure into the webhook url field.
This is the basic configuration for the webhook complete, and it can now be used to start queueing runbooks in Azure.
Once the webhook has been saved, you will have access to the deliveries tab for the webhook. This contains a list of results for the webhook, indicating whether or not each delivery has been successful. By clicking into the delivery, you can see the full details of the request that was sent to Azure, and also the response that Halo received back.
Sending the Webhook
There are two ways of sending the webhook to Azure. The first option is by using a system action. To configure a system action to send a webhook to queue a runbook, navigate to Configuration > Tickets > Actions. Add a new action, and on the details tab under the Action Settings heading, choose a system use of "Start Runbook". This will then give you an extra field showing your list of configured webhooks, so that you can choose which runbook should be started when the action is performed.
When the action is performed, if the webhook is successful, a note will be added to the ticket providing you have not already set an action note. This note contains the Job Id so that you can look this up in Azure Automation should it be necessary.
In the unlikely event that the webhook fails to deliver, a note will be added informing you of the failure and the status of the response that was received back from Azure.
If you have already populated the note for the action, a popup will inform you of any failures. For more information regarding the failures of the webhook, go back to the Azure Automation configuration page, and view the latest delivery results on the deliveries tab.
The second option is to send the webhook and queue the runbook when the step of an approval process has been approved, which will usually be the final step of your approval process. To configure this, navigate to Configuration > Tickets > Approval Processes, open an approval process and choose the step that you would like to start the runbook on if it is approved. Under the advanced heading, choose the runbook that should be started whenever that step is approved.
Similarly to the system action method, an action will be added to the ticket indicating whether or not the runboook was successful.
Halo Webhook - Advanced Configuration
Now that a webhook has been configured and you are successfully able to trigger the webhook using an action or an approval process, you may wish to further customise the request body so that it contains useful data that can be used in the runbook.
At the moment, without any further configuration, the body of the request that is sent to Azure to start the runbook contains minimal information. Under the request details section, you can choose which fields should be included in the body of the webhook.
A variety of fields can be added from the following tables, including a mix of both system and custom fields:
Whenever the webhook is triggered, Halo builds the body of the request to include your selected fields and their values from the ticket where it is being triggered. For example, if you have a system action to start a runbook and you perform this action on ticket 1001, Halo retrieves the value of each field from ticket 1001 and adds it to the body of the request.
When adding a field to the table above, you will be asked to choose a key. The value you specify for the key is how the name of the field will appear in the body of the request.
Here is an example of how the configuration shown in the above screenshots will look in the body of the request:
You can also include fields from Custom Tables that are linked to any of the other four tables. In this scenario, an array will be added to the body of the request that includes all values stored in the custom table for that field. Here is an example:
To assist with visualising your configuration, you can generate a preview of the request. Type in a ticket id, and the headers and body of the request that would be sent to the runbook will be shown.
This enables you to confirm the structure of the request headers and body, so that you can design your runbook to consume this correctly.
You can also test the webhook using the Send Webhook option at the top of the screen. This provides an input screen for you to input a ticket id, and the webhook will be sent using the details of that ticket.