How we save time when moving Azure Data Factory Integration Runtimes
If you are using Azure Data Factory (ADF) and need to access data outside of Azure you need to install an Integration Runtime (IR) on a Virtual Machine (VM) that does have access to the data. At ASOS we have some sources that are still on premises or within VNETs in which case you need an IR. We are always evolving our implementations and recently had to split one of our solutions into two, which meant we had to reconfigure the IRs in multiple environments to connect to different ADFs in other Azure subscriptions.
The current recommendation of re-configuring an instance is that you cannot enter another key and you will need to reinstall it. However, there is a much easier way to do this using a single line of PowerShell.
Azure Data Factory
In your ADF go to the Connections section then select the Integration Runtimes (IR) tab. Here you can add and edit IRs as well as get more info about them. Click the edit button (Fig 1) for your chosen IR.
You will be presented with the following screen (Fig 2). Copy Key 1 or Key 2 to your clipboard or somewhere else as we will use it soon.
If you select the Nodes tab (Fig 3) you will notice that there aren’t any running nodes for the selected IR
On the VM hosting your IR
Remote Desktop into the VM hosting your IR and open PowerShell. Execute the below command. Remember to add the key you copied earlier to the gatewayKey parameter.
& “C:\Program Files\Microsoft Integration Runtime\3.0\PowerShellScript\RegisterIntegrationRuntime.ps1” -gatewayKey <YourKeyCopiedInPrevStep>
It will take about a minute to execute and it may look like its hanging as there is no feedback or progress updates until its completed. After successful execution you should see a message like the one below (Fig 4)
You can also open the Microsoft Integration Runtime (Fig 5) from the Start Menu and confirm that the Data Factory displayed is indeed the one that you want to connect to.
Back in Azure Data Factory
When you look at Nodes now you should see (Fig 6) the new node added and in a running status. You may need to refresh the page to see this.
About the author
Eugene is a Senior Data Engineer at ASOS with a passion for Test Driven Development, Agile Methodologies, Continuous Integration and Delivery using Microsoft Azure. In my spare time I tinker with Home Automation.