This Universal Task enables users to utilize Azure Virtual Machine (VM) name, resource group, subscription ID, and access token as inputs for the start, stop, terminate, list, and check status of Azure VMs.
This task uses python requests module to interact with the Azure cloud platform.
It expands user ability to start/stop/terminate/check/list Azure VMs that belong to a subscription and resource group.
In Universal Controller (UC), this task reaches and stays in the success state until the Azure instance is completely started, stopped, or terminated.
Scheduling this task in Universal Controller with the right dependencies set up would start and stop EC2 instances based on business needs using a UC workflow.
This task helps to dynamically manage VM operations. It could potentially reduce the Azure VM running cost in the cloud.
This integration requires a Universal Agent and a Python runtime to execute the Universal Task against a Azure Virtual Machine.
Requires Python 3.6 or higher . Tested with the Universal Agent bundled Python distribution.
Python modules required
UAC Global Variables with azure oauth2.0 access should be set in order to run the UT properly.
Create a global variable and set the value of that with the Azure access token and this will be used in job definition to make the REST-API calls authenticated from universal controller to Azure logic apps
Access token can be populated with a new access token by setting up a web services task that can run periodically; for example, every hour.
Software Requirements for Universal Agent
Universal Agent for Windows x64 Version 6.5 and later with python options installed
Universal Agent for Linux Version 6.5 and later with python options installed
Software Requirements for Universal Controller
Universal Controller Version 18.104.22.168 and later
Software Requirements for the Application to be Scheduled
This Universal Task can schedule and execute Azure VM Operations with API Version 2019-12-01.
This task uses Azure Oauth2.0 access token for Azure API authentication. Users may need to use Universal Controller web services task to refresh the access token periodically.
Generate Access Token Using Sample webservice Task
Generated Access Token can be Stored in a Global Variable by Using the UAC Function for the Above webservices Task in Actions Set Variable
Azure Virtual Machines Key Features
Starts an Azure Virtual Machine
Stop an Azure Virtual Machine
Terminate an Azure Virtual Machine
Check the status of an Azure Virtual Machine
List All VM
List the Azure VM’s belongs to a subscription & Resource group