
close
close
Chance to win $250 in Petri 2023 Audience Survey
In this post, I am going to show you a way to make it easy for people to execute Azure Automation runbooks from their phone. This solution, based on Office 365 Flow, does not require signing into the Azure admin app or the Azure Portal. It is also very easy. For example, a user can start or stop a line-of-business (LOB) app with the click of a single button.
In my demo lab, I have deployed an Azure Automation account called auto-petriauto. There are two custom runbooks in the account for starting and stopping a set of virtual machines that make up an LOB app:
The Runbooks in Azure Automation [Image Credit: Aidan Finn]
The first step of the solution is to make the runbooks’ triggers available to external systems. This is accomplished by creating a webhook for each runbook.
Tip: Make sure the runbooks are published before proceeding.
Save the Webhook URL Before Finishing the Wizard [Image Credit: Aidan Finn]
We are going to create two buttons or connectors in Flow, one for each runbook.
Sign into the Office 365 Portal, launch the Flow service, and go to My Flows. Click the button to Create A Flow From Blank. A number of trigger templates are available to use. A trigger is something that starts a flow (or workflow). Our trigger will be a button that appears in the Flow mobile app, so search for Button.
A Mobile App Button Will be Our Flow Trigger [Image Credit: Aidan Finn]
Name the Fow/Button That Starts the Azure Automation Runbook [Image Credit: Aidan Finn]
Add the HTTP Action to the Flow [Image Credit: Aidan Finn]
Configure the New HTTP Connector to Start an Azure Automation Runbook [Image Credit: Aidan Finn]
Two Flows: One to Start and One to Stop the Azure Virtual Machines [Image Credit: Aidan Finn]
You do not need to sign into the Office 365 Portal to use Flow; Microsoft has published Flow apps for iOS and Android. Install the app and sign in using the same credentials as your Office 365 user. Go to Buttons (the bottom navigation bar) and the flows that you created should appear. My buttons in the Flow app for starting and stopping Azure virtual machines using Azure Automation runbooks can be seen in the Android screenshot below.
Start and Stop Azure Virtual Machines Using Microsoft Flow App on a Phone [Image Credit: Aidan Finn]
A similar set of activities will take place when I press the Start LOB App.
Webhooks provide us with a mechanism to extend outside of the system. In the above example, I have made it possible to start an Azure Automation runbook from a system outside of Azure. One could take this concept and use it in anything:
In my lab, I used two tenants:
This means that a Microsoft partner could use webhooks to manage systems for its many managed customers.
Another interesting concept is that of delegation. Maybe the end user of the LOB app has no administrative rights in Azure. In Office 365 Flow, it is possible to share a flow with someone in the same Office 365 tenant. I, the administrator, can make a flow and share it with the end user. Then the end user could start and stop their LOB app on demand.
More in Cloud Computing
What Are the Best Hyperconverged Infrastructure (HCI) Solutions on the Market?
Jan 9, 2023 | Sukesh Mudrakola
Microsoft to Roll Out EU Data Boundary Plan for Cloud Services on January 1
Dec 15, 2022 | Rabia Noureen
Most popular on petri