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
Copy file name to clipboardExpand all lines: articles/automation/automation-first-runbook-graphical.md
+13-7Lines changed: 13 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -72,7 +72,9 @@ Before you publish the runbook to make it available in production, you should te
72
72
73
73
The job status starts as `Queued`, indicating that the job is waiting for a runbook worker in the cloud to become available. The status changes to `Starting` when a worker claims the job. Finally, the status becomes `Running` when the runbook actually starts to run.
74
74
75
-
1. When the runbook job completes, the Test pane displays its output. In this case, you see `Hello World`.<br> 
75
+
1. When the runbook job completes, the Test pane displays its output. In this case, you see `Hello World`.
@@ -152,9 +154,9 @@ Now that you have a variable to hold the subscription ID, you can configure the
152
154
1. The `Set-AzContext` cmdlet has multiple parameter sets, and you need to select one before providing parameter values. Click **Parameter Set** and then select **SubscriptionId**.
153
155
1. The parameters for this parameter set are displayed on the Activity Parameter Configuration page. Click **SubscriptionID**.
154
156
1. On the Parameter Value page, select **Variable Asset** for the **Data source** field and select **AzureSubscriptionId** from the source list. When finished, click **OK** twice.
155
-
1. Hover over `Login to Azure` until a circle appears on the bottom of the shape. Click the circle and drag the arrow to `Specify Subscription Id`.
157
+
1. Hover over `Login to Azure` until a circle appears on the bottom of the shape. Click the circle and drag the arrow to `Specify Subscription Id`. Your runbook should look like the following at this point.
156
158
157
-
Your runbook should look like the following at this point: <br>
## Step 7 - Add activity to start a virtual machine
160
162
@@ -168,9 +170,9 @@ Now you must add a `Start-AzVM` activity to start a virtual machine. You can pic
168
170
1. Select **Name**. Choose **PowerShell expression** for the **Data source** field. For the VM that you use to start this runbook, type in the machine name surrounded with double quotes. Click **OK**.
169
171
1. Select **ResourceGroupName**. Use the value **PowerShell expression** for the **Data source** field, and type in the name of the resource group surrounded with double quotes. Click **OK**.
170
172
1. Click **Test pane** so that you can test the runbook.
171
-
1. Click **Start** to begin the test. Once it completes, make sure that the VM has started.
173
+
1. Click **Start** to begin the test. Once it completes, make sure that the VM has started. Your runbook should look like the following at this point.
172
174
173
-
Your runbook should look like the following at this point: <br>
@@ -224,7 +226,9 @@ You can now modify the runbook so that it only attempts to start the VM if it is
224
226
$StatusOut
225
227
```
226
228
227
-
1. Create a link from `Get Status` to `Start-AzVM`.<br> 
229
+
1. Create a link from `Get Status` to `Start-AzVM`.
230
+
231
+

228
232
1. Select the link and, in the Configuration pane, change **Apply condition** to **Yes**. Note that the link becomes a dashed line, indicating that the target activity only runs if the condition resolves to true.
229
233
1. For **Condition expression**, type `$ActivityOutput['Get Status'] -eq "Stopped"`. `Start-AzVM` now only runs if the VM is stopped.
230
234
1. In the Library control, expand **Cmdlets** and then **Microsoft.PowerShell.Utility**.
@@ -237,7 +241,9 @@ You can now modify the runbook so that it only attempts to start the VM if it is
237
241
1. Select the link to `Notify VM Started` and change **Apply condition** to true.
238
242
1. For the **Condition expression**, type `$ActivityOutput['Start-AzVM'].IsSuccessStatusCode -eq $true`. This `Write-Output` control now only runs if the VM starts successfully.
239
243
1. Select the link to `Notify VM Start Failed` and change **Apply condition** to true.
240
-
1. For the **Condition expression** field, type `$ActivityOutput['Start-AzVM'].IsSuccessStatusCode -ne $true`. This `Write-Output` control now only runs if the VM is not successfully started. Your runbook should look like the following image: <br> 
244
+
1. For the **Condition expression** field, type `$ActivityOutput['Start-AzVM'].IsSuccessStatusCode -ne $true`. This `Write-Output` control now only runs if the VM is not successfully started. Your runbook should look like the following image.
245
+
246
+

241
247
1. Save the runbook and open the Test pane.
242
248
1. Start the runbook with the VM stopped, and the machine should start.
0 commit comments