Skip to content

Commit 4586b7b

Browse files
authored
Merge pull request #273504 from lrtoyou1223/shirbranch22
Add a ps command for expired shir search
2 parents cc4e49b + cb35659 commit 4586b7b

File tree

1 file changed

+43
-4
lines changed

1 file changed

+43
-4
lines changed

articles/data-factory/self-hosted-integration-runtime-auto-update.md

Lines changed: 43 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ You can check the version either in your self-hosted integration runtime client
2323
:::image type="content" source="./media/self-hosted-integration-runtime-auto-update/self-hosted-integration-runtime-version-portal.png" alt-text="Screenshot that shows the version in Azure data factory portal.":::
2424

2525
## Self-hosted Integration Runtime Auto-update
26-
Generally, when you install a self-hosted integration runtime in your local machine or an Azure VM, you have two options to manage the version of self-hosted integration runtime: auto-update or maintain manually. Typically, ADF releases two new versions of self-hosted integration runtime every month, which includes new features released, bugs fixed, and enhancements. So we recommend users to update to the latest version.
26+
Generally, when you install a self-hosted integration runtime in your local machine or an Azure Virtual Machine, you have two options to manage the version of self-hosted integration runtime: auto-update or maintain manually. Typically, ADF releases two new versions of self-hosted integration runtime every month, which includes new features released, bugs fixed, and enhancements. So we recommend users to update to the latest version.
2727

2828
The most convenient way is to enable auto-update when you create or edit self-hosted integration runtime. The self-hosted integration runtime is automatically update to newer version. You can also schedule the update at the most suitable time slot as you wish.
2929

@@ -36,17 +36,56 @@ You can check the last update datetime in your self-hosted integration runtime c
3636
You can use this [PowerShell command](/powershell/module/az.datafactory/get-azdatafactoryv2integrationruntime#example-5--get-self-hosted-integration-runtime-with-detail-status) to get the auto-update version.
3737

3838
> [!NOTE]
39-
> If you have multiple self-hosted integration runtime nodes, there is no downtime during auto-update. The auto-update happens in one node first while others are working on tasks. When the first node finishes the update, it will take over the remain tasks when other nodes are updating. If you only have one self-hosted integration runtime, then it has some downtime during the auto-update.
39+
> If you have multiple self-hosted integration runtime nodes, there is no downtime during auto-update. The auto-update happens in one node first while others are working on tasks. When the first node finishes the update, it will take over the remained tasks when other nodes are updating. If you only have one self-hosted integration runtime, then it has some downtime during the auto-update.
4040
4141
## Auto-update version vs latest version
4242
To ensure the stability of self-hosted integration runtime, although we release two versions, we'll only push one version every month. So sometimes you find that the auto-updated version is the previous version of the actual latest version. If you want to get the latest version, you can go to [download center](https://www.microsoft.com/download/details.aspx?id=39717) and do so manually. Additionally, **auto-update** to a new version is managed internally. You can't change it.
4343

44-
The self-hosted integration runtime **Auto update** page in the ADF portal shows the newer version if current version is old. When your self-hosted integration runtime is online, this version is auto-update version and will automatically update your self-hosted integration runtime in the scheduled time. But if your self-hosted integration runtime is offline, the page only shows the latest version.
44+
The self-hosted integration runtime **Auto update** page in the ADF portal shows the newer version if current version is old. When your self-hosted integration runtime is online, this version is auto-update version and automatically update your self-hosted integration runtime in the scheduled time. But if your self-hosted integration runtime is offline, the page only shows the latest version.
4545

4646
If you have multiple nodes, and for some reasons that some of them aren't auto-updated successfully. Then these nodes roll back to the version, which was the same across all nodes before the auto-update.
4747

4848
## Self-hosted Integration Runtime Expire Notification
49-
If you want to manually control which version of self-hosted integration runtime, you can disable the setting of auto-update and install it manually. Each version of self-hosted integration runtime expires in one year. The expiring message is shown in ADF portal and self-hosted integration runtime client **90 days** before expiration.
49+
If you want to manually control which version of self-hosted integration runtime, you can disable the setting of auto-update and install it manually. Each version of self-hosted integration runtime expires in one year. The expiring message is shown in ADF portal and self-hosted integration runtime client **90 days** before expired.
50+
51+
When you receive the expired notification, you can use below PowerShell command to find all expired and expiring self-hosted integration runtime in your environment. Then you can upgrade them accordingly.
52+
53+
```powershell
54+
$upperVersion = "<expiring version>" # the format is [major].[minor]. For example: 5.25
55+
$subscription = "<subscription id>"
56+
57+
az login
58+
az account set --subscription "$subscription"
59+
60+
$factories = az datafactory list | ConvertFrom-Json
61+
62+
$results = @();
63+
for ($i = 0; $i -lt $factories.Count; $i++) {
64+
$factory = $factories[$i]
65+
Write-Progress -Activity "Checking data factory '$($factory.name)'" -PercentComplete $($i * 100.0 / $factories.Count)
66+
$shirs = az datafactory integration-runtime list --factory-name $factory.name --resource-group $factory.resourceGroup | ConvertFrom-Json | Where-Object {$_.properties.type -eq "SelfHosted"}
67+
for ($j = 0; $j -lt $shirs.Count; $j++) {
68+
$shir = $shirs[$j]
69+
Write-Progress -Activity "Checking data factory '$($factory.name)', checking integration runtime '$($shir.name)'" -PercentComplete $($i * 100.0 / $factories.Count + (100.0 * $j / ($factories.Count * $shirs.Count)))
70+
$status = az datafactory integration-runtime get-status --factory-name $factory.name --resource-group $factory.resourceGroup --integration-runtime-name $shir.name | ConvertFrom-Json
71+
$shirVersion = $status.properties.version
72+
$result = @{
73+
subscription = $subscription
74+
resourceGroup = $factory.resourceGroup
75+
factory = $factory.name
76+
integrationRuntime = $shir.name
77+
integrationRuntimeVersion = $shirVersion
78+
expiring_or_expired = (-not [string]::IsNullOrWhiteSpace($shirVersion) -and ((([Version]$shirVersion) -lt ([Version]"$($upperVersion).0.0")) -or $shirVersion.StartsWith("$($upperVersion).")))
79+
}
80+
$result | Format-Table -AutoSize
81+
$results += [PSCustomObject]$result
82+
}
83+
}
84+
85+
Write-Host "Expiring or expired Self-Hosted Integration Runtime includes: "
86+
$results | Where-Object {$_.expiring_or_expired -eq $true} | Select-Object -Property subscription,resourceGroup,factory,integrationRuntime,integrationRuntimeVersion | Format-Table -AutoSize
87+
```
88+
5089

5190
## Related content
5291

0 commit comments

Comments
 (0)