Skip to content

Commit 7137afe

Browse files
authored
Merge pull request #171903 from dagiro/1872781a
1872781a - Automation - De-emphasize Run As account initiative
2 parents e667c40 + aab862f commit 7137afe

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

articles/automation/runbook-input-parameters.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@ title: Configure runbook input parameters in Azure Automation
33
description: This article tells how to configure runbook input parameters, which allow data to be passed to a runbook when it's started.
44
services: automation
55
ms.subservice: process-automation
6-
ms.date: 02/14/2019
6+
ms.date: 09/13/2021
77
ms.topic: conceptual
88
ms.custom: devx-track-azurepowershell
99
---
10-
# Configure runbook input parameters
10+
11+
# Configure runbook input parameters in Automation
1112

1213
Runbook input parameters increase the flexibility of a runbook by allowing data to be passed to it when it's started. These parameters allow runbook actions to be targeted for specific scenarios and environments. This article describes the configuration and use of input parameters in your runbooks.
1314

@@ -285,7 +286,7 @@ Type the following code in a text file, and save it as **test.json** somewhere o
285286

286287
### Create the runbook
287288

288-
Create a new PowerShell runbook named **Test-Json** in Azure Automation. See [My first PowerShell runbook](./learn/powershell-runbook-managed-identity.md).
289+
Create a new PowerShell runbook named **Test-Json** in Azure Automation.
289290

290291
To accept the JSON data, the runbook must take an object as an input parameter. The runbook can then use the properties defined in the JSON file.
291292

@@ -295,10 +296,10 @@ Param(
295296
[object]$json
296297
)
297298
298-
# Connect to Azure account
299-
$Conn = Get-AutomationConnection -Name AzureRunAsConnection
300-
Connect-AzAccount -ServicePrincipal -Tenant $Conn.TenantID `
301-
-ApplicationID $Conn.ApplicationID -CertificateThumbprint $Conn.CertificateThumbprint
299+
# Connect to Azure with user-assigned managed identity
300+
Connect-AzAccount -Identity
301+
$identity = Get-AzUserAssignedIdentity -ResourceGroupName <ResourceGroupName> -Name <UserAssignedManagedIdentity>
302+
Connect-AzAccount -Identity -AccountId $identity.ClientId
302303
303304
# Convert object to actual JSON
304305
$json = $json | ConvertFrom-Json

0 commit comments

Comments
 (0)