Skip to content

Commit 6107f23

Browse files
Merge pull request #211596 from SnehaSudhirG/16Sep-WebpageDocUpdate
added about the webpage
2 parents ca53c3e + 9671067 commit 6107f23

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

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

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ You've tested and published your runbook, but so far it doesn't do anything usef
184184

185185
1. Select **Overview** and then **Edit** to open the textual editor.
186186

187-
1. Replace all of the existing code with the following:
187+
1. Replace the existing code with the following:
188188

189189
```powershell
190190
workflow MyFirstRunbook-Workflow
@@ -195,18 +195,18 @@ You've tested and published your runbook, but so far it doesn't do anything usef
195195
Disable-AzContextAutosave -Scope Process
196196
197197
# Connect to Azure with system-assigned managed identity
198-
$AzureContext = (Connect-AzAccount -Identity).context
198+
Connect-AzAccount -Identity
199199
200200
# set and store context
201-
$AzureContext = Set-AzContext -SubscriptionName $AzureContext.Subscription -DefaultProfile $AzureContext
201+
$AzureContext = Set-AzContext –SubscriptionId "<SubscriptionID>"
202202
}
203203
```
204204

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")
@@ -299,8 +299,8 @@ You can use the `ForEach -Parallel` construct to process commands for each item
299299
```
300300
301301
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:
302-
1. From line 13, remove `$AzureContext = (Connect-AzAccount -Identity).context`,
303-
1. Replace it with `$AzureContext = (Connect-AzAccount -Identity -AccountId <ClientId>).context`, and
302+
1. From line 9, remove `(Connect-AzAccount -Identity)`,
303+
1. Replace it with `(Connect-AzAccount -Identity -AccountId <ClientId>)`, and
304304
1. Enter the Client ID you obtained earlier.
305305
306306
1. Select **Save**, then **Publish**, and then **Yes** when prompted.

0 commit comments

Comments
 (0)