Every Solution You Can Imagine – and More
What cybersecurity solution do you need? From Zero Trust to ADR, IAM, risk/privacy, data protection, AppSec and threat, securing digital transformation, to resiliency and remediation, we can build the right program to help solve your challenges.
A Single Partner for Everything You Need
Optiv works with more than 450 world-class security technology partners. By putting you at the center of our unmatched ecosystem of people, products, partners and programs, we accelerate business progress like no other company can.
We Are Optiv
Greatness is every team working toward a common goal. Winning in spite of cyber threats and overcoming challenges in spite of them. It’s building for a future that only you can create or simply coming home in time for dinner.
However you define greatness, Optiv is in your corner. We manage cyber risk so you can secure your full potential.
Assigning Specific Public IP Addresses With Azure Automation Runbook
The last blog post in this series covered how I provisioned my Robotic Process Automation (RPA) test environment using Azure Automation runbooks. In this post, I will use an additional runbook to assign the newly provisioned virtual machine a specific public IP address.
I previously defined a public IP address that is whitelisted as an approved source address to access the test Salesforce environment needed for the RPA flow. This was configured for security reasons. It was also very beneficial having the same public IP address to RDP into for troubleshooting. This public IP address was used in a previous project and resides in a different resource group called Research. The following code is the PowerShell script I wrote for the automation runbook that applies this public IP to the NIC of the newly created virtual machine.
Below is an image of this automation runbook being used in the flow as part of a condition. If the resource group and the resources from the previous step were successful, then the next action in the flow will be to run a second PowerShell runbook that assigns the public IP. If the condition is not matched, a notification email will be sent to the original email requester noting a resource creation error.
The runbook used in the Assign IP action has one required parameter-vendor. This parameter is the same dynamic value used in the previous step. The Reply to email (v3) uses the dynamic values of Job ID and Status Details from the previous step as reference points for the requestor of the original email. If the condition is not met, the original email requestor will receive an email like the one shown below.
Part four in the series will cover the next action in the flow, Robotic Process Automation with WinAutomation.
Additional Reference Information:
Azure Automation: https://docs.microsoft.com/en-us/azure/automation/automation-intro
Automation Account: https://docs.microsoft.com/en-us/azure/automation/automation-create-standalone-account
Azure PowerShell Az module: https://docs.microsoft.com/en-us/powershell/azure/new-azureps-module-az?view=azps-4.7.0
Manage Modules in Azure Automation: https://docs.microsoft.com/en-us/azure/automation/shared-resources/modules
Application and service principal objects in Azure Active Directory: https://docs.microsoft.com/en-us/azure/active-directory/develop/app-objects-and-service-principals
Power Automate UI Flows: https://flow.microsoft.com/en-us/ui-flows/
Here's a review of related posts on this series:
November 04, 2020
Can user workflow verification be tested in an automated fashion using Microsoft Power Automate Flows, UI Flows and Automation Runbooks?
How to provision a test environment for robotic process automation with Azure automation runbooks: part two in a series.
Part four in the series: setting up RPA with WinAutomation.
Let us know what you need, and we will have an Optiv professional contact you shortly.