Skip to content

Commit 5a4ae46

Browse files
committed
created new article for automating SHIR installation
1 parent 7ee5a04 commit 5a4ae46

File tree

5 files changed

+82
-0
lines changed

5 files changed

+82
-0
lines changed

articles/data-factory/TOC.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -575,6 +575,8 @@
575575
href: create-azure-ssis-integration-runtime.md
576576
- name: Shared self-hosted integration runtime
577577
href: create-shared-self-hosted-integration-runtime-powershell.md
578+
- name: Automating self-hosted integration runtime installation
579+
href: self-hosted-integration-runtime-automation-scripts.md
578580
- name: Run SSIS packages in Azure
579581
items:
580582
- name: Run SSIS packages in Azure from SSDT
20.8 KB
Loading
52.9 KB
Loading
21.3 KB
Loading
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
---
2+
title: Automating self-hosted integration runtime installation using local PowerShell scripts
3+
description: To automate installation of Self-hosted Integration Runtime on local machines.
4+
services: data-factory
5+
documentationcenter: ''
6+
ms.service: data-factory
7+
ms.workload: data-services
8+
ms.topic: conceptual
9+
author: nabhishek
10+
ms.author: abnarain
11+
manager: anandsub
12+
ms.custom: seo-lt-2019
13+
ms.date: 04/17/2020
14+
---
15+
16+
# Automating self-hosted integration runtime installation using local PowerShell scripts
17+
To automate installation of Self-hosted Integration Runtime on local machines (other than Azure VMs where we can leverage the Resource Manager template instead), you can use local PowerShell scripts. This article introduces two scripts you can use.
18+
19+
## Prerequisites
20+
21+
Launch PowerShell on your local machine. To run the scripts, you need to choose **Run as Administrator**.
22+
[For automating setup](#for-automating-setup), download the self-hosted IR from [here](https://www.microsoft.com/download/details.aspx?id=39717).Copy the path where the downloaded SHIR MSI (installation file) is. You also need an **authentication key** to register the SHIR. You'll need to specify the path and the key when running the script in following instructions.
23+
[For automating manual updates](#for-automating-manual-updates), you need to have a Self-hosted Integration Runtime pre-configured.
24+
25+
26+
## Scripts introduction
27+
28+
> [!NOTE]
29+
> These scripts are created using the [documented command line utility](https://docs.microsoft.com/azure/data-factory/create-self-hosted-integration-runtime#set-up-an-existing-self-hosted-ir-via-local-powershell) in the self-hosted integration runtime. If needed one can customize these scripts accordingly to cater to their automation needs.
30+
> The scripts need to be applied per node, so make sure to run it across all nodes in case of high availability setup (2 or more nodes).
31+
32+
1. For automating setup:
33+
Install and register a new self-hosted integration runtime node using **[InstallGatewayOnLocalMachine.ps1](https://github.com/nabhishek/SelfHosted-IntegrationRuntime_AutomationScripts/blob/master/InstallGatewayOnLocalMachine.ps1)** - The script can be used to install self-hosted integration runtime node and register it with an authentication key. The script accepts two arguments, **first** specifying the location of the [self-hosted integration runtime](https://www.microsoft.com/download/details.aspx?id=39717) on a local disk, **second** specifying the **authentication key** (for registering self-hosted IR node).
34+
35+
2. For automating manual updates:
36+
Update the self-hosted IR node with a specific version or to the latest version **[script-update-gateway.ps1](https://github.com/nabhishek/SelfHosted-IntegrationRuntime_AutomationScripts/blob/master/script-update-gateway.ps1)** - This is also supported in case you have turned off the auto-update, or want to have more control over updates. The script can be used to update the self-hosted integration runtime node to the latest version or to a specified higher version (downgrade doesn’t work). It accepts an argument for specifying version number (example: -version 3.13.6942.1). When no version is specified, it always updates the self-hosted IR to the latest version found in the [downloads](https://www.microsoft.com/download/details.aspx?id=39717).
37+
> [!NOTE]
38+
> Only last 3 versions can be specified. Ideally this is used to update an existing node to the latest version. **IT ASSUMES THAT YOU HAVE A REGISTERED SELF HOSTED IR**.
39+
40+
## Usage examples
41+
42+
### For automating setup
43+
1. Download the self-hosted IR from [here](https://www.microsoft.com/download/details.aspx?id=39717).
44+
1. Specify the path where the above downloaded SHIR MSI (installation file) is. For example, if the path is *C:\Users\username\Downloads\IntegrationRuntime_4.7.7368.1.msi*, then you can use below PowerShell command-line example for this task:
45+
46+
```powershell
47+
PS C:\windows\system32> C:\Users\username\Desktop\InstallGatewayOnLocalMachine.ps1 -path "C:\Users\username\Downloads\IntegrationRuntime_4.7.7368.1.msi" -authKey "[key]"
48+
```
49+
50+
> [!NOTE]
51+
> Replace [key] with the authentication key to register your IR.
52+
> Replace "username" with your user name.
53+
> Specify the location of the "InstallGatewayOnLocalMachine.ps1" file when running the script. In this example we stored it on Desktop.
54+
55+
1. If there is one pre-installed self-hosted IR on your machine, the script automatically uninstalls it and then configures a new one. You'll see following window popped out:
56+
![configure integration runtime](media/self-hosted-integration-runtime-automation-scripts/integration-runtime-configure.png)
57+
58+
1. When the installation and key registration completes, you'll see *Succeed to install gateway* and *Succeed to register gateway* results in your local PowerShell.
59+
[![script 1 run result](media/self-hosted-integration-runtime-automation-scripts/script-1-run-result.png)](media/self-hosted-integration-runtime-automation-scripts/script-1-run-result.png#lightbox)
60+
61+
### For automating manual updates
62+
This script is used to update/install + register latest self-hosted integration runtime. The script run performs the following steps:
63+
1. check current self-hosted IR version
64+
2. Get latest version or specified version from argument
65+
3. If there is newer version than current version:
66+
* download self-hosted IR msi
67+
* upgrade it
68+
69+
You can follow below command-line example to use this script:
70+
1. Download and install latest gateway:
71+
72+
```powershell
73+
PS C:\windows\system32> C:\Users\username\Desktop\script-update-gateway.ps1
74+
```
75+
2. Download and install gateway of specified version:
76+
```powershell
77+
PS C:\windows\system32> C:\Users\username\Desktop\script-update-gateway.ps1 -version 3.13.6942.1
78+
```
79+
If your current version is already the latest one, you'll see following result, suggesting no update is required.
80+
[![script 2 run result](media/self-hosted-integration-runtime-automation-scripts/script-2-run-result.png)](media/self-hosted-integration-runtime-automation-scripts/script-2-run-result.png#lightbox)

0 commit comments

Comments
 (0)