You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Edit the `$resourceGroup` variable with a valid value representing your resource group.
196
195
197
196
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:
198
-
1. From line 9, remove `Connect-AzAccount -Identity`,
199
-
1. Replace it with `Connect-AzAccount -Identity -AccountId <ClientId>`, and
197
+
1. From line 9, remove `$AzureContext = (Connect-AzAccount -Identity).context`,
198
+
1. Replace it with `$AzureContext = (Connect-AzAccount -Identity -AccountId <ClientId>).context`, and
200
199
1. Enter the Client ID you obtained earlier.
201
200
202
201
1. Select **Save** and then **Test pane**.
@@ -234,7 +233,7 @@ Your runbook currently starts the VM that you've hardcoded in the runbook. It wi
234
233
235
234
1. Replace the previous `Start-AzVM` command with the following:
@@ -290,8 +288,8 @@ You can use the `ForEach -Parallel` construct to process commands for each item
290
288
```
291
289
292
290
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:
293
-
1. From line 13, remove `Connect-AzAccount -Identity`,
294
-
1. Replace it with `Connect-AzAccount -Identity -AccountId <ClientId>`, and
291
+
1. From line 13, remove `$AzureContext = (Connect-AzAccount -Identity).context`,
292
+
1. Replace it with `$AzureContext = (Connect-AzAccount -Identity -AccountId <ClientId>).context`, and
295
293
1. Enter the Client ID you obtained earlier.
296
294
297
295
1. Select **Save**, then **Publish**, and then **Yes** when prompted.
@@ -322,4 +320,4 @@ If you're not going to continue to use this runbook, delete it with the followin
322
320
In this tutorial, you created a PowerShell workflow runbook. For a look at Python 3 runbooks, see:
323
321
324
322
> [!div class="nextstepaction"]
325
-
> [Tutorial: Create a Python 3 runbook (preview)](automation-tutorial-runbook-textual-python-3.md)
323
+
> [Tutorial: Create a Python 3 runbook (preview)](automation-tutorial-runbook-textual-python-3.md)
0 commit comments