Skip to content

Commit ff33bb2

Browse files
authored
Merge pull request #239754 from chugugrace/mybranch053123
update runbook scripts
2 parents a7272f8 + 0e57d53 commit ff33bb2

File tree

2 files changed

+11
-18
lines changed

2 files changed

+11
-18
lines changed

articles/data-factory/how-to-schedule-azure-ssis-integration-runtime.md

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ ms.service: data-factory
55
ms.subservice: integration-services
66
ms.devlang: powershell
77
ms.topic: conceptual
8-
ms.date: 04/12/2023
8+
ms.date: 05/31/2023
99
author: chugugrace
1010
ms.author: chugu
1111
ms.custom: subject-rbac-steps, devx-track-azurepowershell
@@ -258,6 +258,11 @@ The following section provides steps for creating a PowerShell runbook. The scri
258258

259259
3. Copy & paste the following PowerShell script to your runbook script window. Save and then publish your runbook by using **Save** and **Publish** buttons on the toolbar.
260260

261+
>[!NOTE]
262+
> This example uses System-assigned managed identity. If you are using Run As account (service principal) or User-assigned managed identity, refer to [Azure Automation Sample scripts](../automation/migrate-run-as-accounts-managed-identity.md?tabs=ua-managed-identity#sample-scripts) for login part.
263+
>
264+
> Enable appropriate RBAC permissions for the managed identity of this Automation account. Refer to [Roles and permissions for Azure Data Factory](concepts-roles-permissions.md).
265+
261266
```powershell
262267
Param
263268
(
@@ -274,28 +279,16 @@ The following section provides steps for creating a PowerShell runbook. The scri
274279
[String] $Operation
275280
)
276281
277-
$connectionName = "AzureRunAsConnection"
282+
$ErrorActionPreference = "Stop"
283+
278284
try
279285
{
280-
# Get the connection "AzureRunAsConnection "
281-
$servicePrincipalConnection=Get-AutomationConnection -Name $connectionName
282-
283286
"Logging in to Azure..."
284-
Connect-AzAccount `
285-
-ServicePrincipal `
286-
-TenantId $servicePrincipalConnection.TenantId `
287-
-ApplicationId $servicePrincipalConnection.ApplicationId `
288-
-CertificateThumbprint $servicePrincipalConnection.CertificateThumbprint
287+
Connect-AzAccount -Identity
289288
}
290289
catch {
291-
if (!$servicePrincipalConnection)
292-
{
293-
$ErrorMessage = "Connection $connectionName not found."
294-
throw $ErrorMessage
295-
} else{
296-
Write-Error -Message $_.Exception
297-
throw $_.Exception
298-
}
290+
Write-Error -Message $_.Exception
291+
throw $_.Exception
299292
}
300293
301294
if($Operation -eq "START" -or $operation -eq "start")
-10.5 KB
Loading

0 commit comments

Comments
 (0)