Azure Automation Variables
Azure Automation Variables are a powerfull and secure way to store variables in your Automation Account. The variables can then be access from multiple Runbooks and centrally managed using Automation App and/or the Azure Portal
Create a new variable
You have two options for creating a new Variable using Runbook Manager.
From the main menu of Runbook Manager navigate to Variables and click on Create new.
Alternatively you can obtain the same by clicking on Variables if you have an open Runbook and then click on Create new.
In either case a modal will appear in which you can fill in the information around your variable.
Accessing a Variable
Accessing a Variable in a Runbook is very useful. The easiest way to do so is by using the menu to the left.
- Click on the variable that you would to get and click on Get-AutomationVariable. This will copy a snippet to your clipboard.
- Write a variable name and an equal sign, eg. “$var = “.
- Paste in the snippet from your clipboard.
Updating a Variable
You can update a variable when the Runbook executes by using the Set-AutomationVariable snippet from the menu.
You can also edit the value of the variable from the UI.
Click on the pencil next to the variable you wish to edit.
Update the value and click on Update.
Delete a variable
It is possible to delete a variable that you no longer need.
Click on the pencil icon next to the variable you wish to delete.
Click the Delete button.