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.

Click on Dashboard

From the main menu of Runbook Manager navigate to Variables and click on Create new.

Click on Dashboard

Alternatively you can obtain the same by clicking on Variables if you have an open Runbook and then click on Create new.

Click on Dashboard

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 Dashboard

  1. Click on the variable that you would to get and click on Get-AutomationVariable. This will copy a snippet to your clipboard.
  2. Write a variable name and an equal sign, eg. “$var = “.
  3. 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 Dashboard

Click on the pencil next to the variable you wish to edit.

Click on Dashboard

Update the value and click on Update.

Delete a variable

It is possible to delete a variable that you no longer need.

Click on Dashboard

Click on the pencil icon next to the variable you wish to delete.

Click on Dashboard

Click the Delete button.