If you need to to share values between Azure runbooks or parameterise them, Automation Variables may be just the thing you need.
Essentially these are exactly what you might expect – variables which you define and can use within Azure. The variables can be updated via Powershell scripts, manually via the Azure portal and of course by runbooks.
The first thing to do is to define the variable. To do this go to the Azure portal and go into the Automation section. Following this navigate to the assets section, click new and select ‘Add Setting’
Select ‘Add Variable’
Fill in the relevant details for the variable. Note the variable type can be changed programmatically later if this is required.
Set a default value for the variable if it’s required and if the variable contains sensitive information you can also select for it to be encrypted.
To access the variable from the Powershell script the syntax used is like this:
Get-AutomationVariable -Name ‘VariableName’
So for example, in order to access the value of a variable called “ETLProcessStatus” and assign this to a variable named $CurrentRunStatus you would do the following:
$CurrentRunStatus = Get-AutomationVariable -Name “ETLProcessStatus”
In case you forget the syntax for retrieving or updating the value of the variables there is a nice feature where it will write the basic syntax out for you.
Click insert at the bottom of the ribbon and then ‘Setting’
Following this you can select from the following options and template commands will be inserted into the script.
In a blog which will be coming shortly, I will detail how I use this variable and some other techniques in order to assist in running a scalable cloud ETL solution.
Please get in touch if you would like to know more
Introduction to Data Wrangler in Microsoft Fabric
What is Data Wrangler? A key selling point of Microsoft Fabric is the Data Science
Jul
Autogen Power BI Model in Tabular Editor
In the realm of business intelligence, Power BI has emerged as a powerful tool for
Jul
Microsoft Healthcare Accelerator for Fabric
Microsoft released the Healthcare Data Solutions in Microsoft Fabric in Q1 2024. It was introduced
Jul
Unlock the Power of Colour: Make Your Power BI Reports Pop
Colour is a powerful visual tool that can enhance the appeal and readability of your
Jul
Python vs. PySpark: Navigating Data Analytics in Databricks – Part 2
Part 2: Exploring Advanced Functionalities in Databricks Welcome back to our Databricks journey! In this
May
GPT-4 with Vision vs Custom Vision in Anomaly Detection
Businesses today are generating data at an unprecedented rate. Automated processing of data is essential
May
Exploring DALL·E Capabilities
What is DALL·E? DALL·E is text-to-image generation system developed by OpenAI using deep learning methodologies.
May
Using Copilot Studio to Develop a HR Policy Bot
The next addition to Microsoft’s generative AI and large language model tools is Microsoft Copilot
Apr