Skip to content

Commit e427ca7

Browse files
committed
feedback incorporated
1 parent 3d3c395 commit e427ca7

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

articles/automation/learn/automation-tutorial-runbook-textual.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -205,8 +205,8 @@ You've tested and published your runbook, but so far it doesn't do anything usef
205205
Edit the `$resourceGroup` variable with a valid value representing your resource group.
206206

207207
1. If you want the runbook to execute with the system-assigned managed identity, leave the code as-is. If you prefer to use a user-assigned managed identity, then:
208-
1. From line 9, remove `$AzureContext = (Connect-AzAccount -Identity).context`,
209-
1. Replace it with `$AzureContext = (Connect-AzAccount -Identity -AccountId <ClientId>).context`, and
208+
1. From line 9, remove `Connect-AzAccount -Identity`,
209+
1. Replace it with `Connect-AzAccount -Identity -AccountId <ClientId>`, and
210210
1. Enter the Client ID you obtained earlier.
211211

212212
1. Select **Save** and then **Test pane**.
@@ -272,10 +272,10 @@ You can use the `ForEach -Parallel` construct to process commands for each item
272272
Disable-AzContextAutosave -Scope Process
273273
274274
# Connect to Azure with system-assigned managed identity
275-
$AzureContext = (Connect-AzAccount -Identity).context
275+
Connect-AzAccount -Identity
276276
277277
# set and store context
278-
$AzureContext = Set-AzContext -SubscriptionName $AzureContext.Subscription -DefaultProfile $AzureContext
278+
$AzureContext = Set-AzContext –SubscriptionId "<SubscriptionID>"
279279
280280
# Start or stop VMs in parallel
281281
if($action -eq "Start")

0 commit comments

Comments
 (0)