Skip to content

Commit d23671c

Browse files
authored
Merge pull request #112570 from paulth1/scheduling-and-troubleshoot-tracking-and-dsc
edit pass: Scheduling and troubleshoot tracking and dsc
2 parents 96a70ca + ce282b6 commit d23671c

File tree

6 files changed

+117
-118
lines changed

6 files changed

+117
-118
lines changed

articles/automation/automation-solution-vm-management-config.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ When you run the **AutoStop_CreateAlert_Parent** runbook, it verifies that the t
120120

121121
### To target the autostop action to a list of VMs
122122

123-
1. Create a new [Schedule](shared-resources/schedules.md#creating-a-schedule) and link it to the **AutoStop_CreateAlert_Parent** runbook, adding a comma-separated list of VM names to the `VMList` parameter.
123+
1. Create a new [Schedule](shared-resources/schedules.md#create-a-schedule) and link it to the **AutoStop_CreateAlert_Parent** runbook, adding a comma-separated list of VM names to the `VMList` parameter.
124124

125125
2. Optionally, if you want to exclude some VMs from the auto shutdown, you can add a comma-separated list of VM names to the `External_ExcludeVMNames` variable.
126126

articles/automation/shared-resources/schedules.md

Lines changed: 37 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Manage schedules in Azure Automation
3-
description: Automation schedules are used to schedule runbooks in Azure Automation to start automatically. Describes how to create and manage a schedule in so that you can automatically start a runbook at a particular time or on a recurring schedule.
3+
description: Learn how to create and manage a schedule in Azure Automation so that you can automatically start a runbook at a particular time or on a recurring schedule.
44
services: automation
55
ms.service: automation
66
ms.subservice: shared-capabilities
@@ -12,15 +12,15 @@ manager: carmonm
1212
---
1313
# Manage schedules in Azure Automation
1414

15-
To schedule a runbook in Azure Automation to start at a specified time, you link it to one or more schedules. A schedule can be configured to either run once or on a reoccurring hourly or daily schedule for runbooks in the Azure portal. You can also schedule them for weekly, monthly, specific days of the week or days of the month, or a particular day of the month. A runbook can be linked to multiple schedules, and a schedule can have multiple runbooks linked to it.
15+
To schedule a runbook in Azure Automation to start at a specified time, you link it to one or more schedules. A schedule can be configured to either run once or on a recurring hourly or daily schedule for runbooks in the Azure portal. You can also schedule them for weekly, monthly, specific days of the week or days of the month, or a particular day of the month. A runbook can be linked to multiple schedules, and a schedule can have multiple runbooks linked to it.
1616

1717
> [!NOTE]
18-
> Schedules do not currently support Azure Automation DSC configurations.
18+
> Schedules don't currently support Azure Automation DSC configurations.
1919
2020
>[!NOTE]
21-
>This article has been updated to use the new Azure PowerShell Az module. You can still use the AzureRM module, which will continue to receive bug fixes until at least December 2020. To learn more about the new Az module and AzureRM compatibility, see [Introducing the new Azure PowerShell Az module](https://docs.microsoft.com/powershell/azure/new-azureps-module-az?view=azps-3.5.0). For Az module installation instructions on your Hybrid Runbook Worker, see [Install the Azure PowerShell Module](https://docs.microsoft.com/powershell/azure/install-az-ps?view=azps-3.5.0). For your Automation account, you can update your modules to the latest version using [How to update Azure PowerShell modules in Azure Automation](../automation-update-azure-modules.md).
21+
>This article has been updated to use the new Azure PowerShell Az module. You can still use the AzureRM module, which will continue to receive bug fixes until at least December 2020. To learn more about the new Az module and AzureRM compatibility, see [Introducing the new Azure PowerShell Az module](https://docs.microsoft.com/powershell/azure/new-azureps-module-az?view=azps-3.5.0). For Az module installation instructions on your Hybrid Runbook Worker, see [Install the Azure PowerShell module](https://docs.microsoft.com/powershell/azure/install-az-ps?view=azps-3.5.0). For your Automation account, you can update your modules to the latest version by using [How to update Azure PowerShell modules in Azure Automation](../automation-update-azure-modules.md).
2222
23-
## PowerShell Cmdlets
23+
## PowerShell cmdlets
2424

2525
The cmdlets in the following table are used to create and manage schedules with PowerShell in Azure Automation. They ship as part of the [Azure PowerShell module](/powershell/azure/overview).
2626

@@ -34,37 +34,37 @@ The cmdlets in the following table are used to create and manage schedules with
3434
| [Set-AzAutomationSchedule](https://docs.microsoft.com/powershell/module/Az.Automation/Set-AzAutomationSchedule?view=azps-3.7.0) |Sets the properties for an existing schedule. |
3535
| [Unregister-AzAutomationScheduledRunbook](https://docs.microsoft.com/powershell/module/Az.Automation/Unregister-AzAutomationScheduledRunbook?view=azps-3.7.0) |Dissociates a runbook from a schedule. |
3636

37-
## Creating a schedule
37+
## Create a schedule
3838

3939
You can create a new schedule for runbooks in the Azure portal or with PowerShell.
4040

4141
> [!NOTE]
42-
> Azure Automation uses the latest modules in your Automation account when a new scheduled job is run. To avoid impacting your runbooks and the processes they automate, you should first test any runbooks that have linked schedules with an Automation account dedicated for testing. This validates your scheduled runbooks continue to work correctly and if not, you can further troubleshoot and apply any changes required before migrating the updated runbook version to production.
43-
> Your Automation account does not automatically get any new versions of modules unless you have updated them manually by selecting the [Update Azure Modules](../automation-update-azure-modules.md) option from the **Modules**.
42+
> Azure Automation uses the latest modules in your Automation account when a new scheduled job is run. To avoid affecting your runbooks and the processes they automate, you should first test any runbooks that have linked schedules with an Automation account dedicated for testing. A test validates that your scheduled runbooks continue to work correctly. If you see a problem, you can troubleshoot and apply any changes required before you migrate the updated runbook version to production.
43+
> Your Automation account doesn't automatically get any new versions of modules unless you've updated them manually by selecting the [Update Azure Modules](../automation-update-azure-modules.md) option from **Modules**.
4444
4545
### Create a new schedule in the Azure portal
4646

47-
1. In the Azure portal, from your automation account, select **Schedules** under the section **Shared Resources** on the left.
48-
2. Click **Add a schedule** at the top of the page.
49-
3. On the New schedule pane, type a name and optionally a description for the new schedule.
50-
4. Select whether the schedule runs one time, or on a reoccurring schedule by selecting **Once** or **Recurring**. If you select **Once**, specify a start time and then click **Create**. If you select **Recurring**, specify a start time. For **Recur every**, select how often you want the runbook to repeat - by hour, day, week, or month.
51-
1. If you select **week**, the days of the week are presented for you to choose from. Select as many days as you want. The first run of your schedule will happen on the first day selected after the start time. For example, to choose a weekend schedule, select Saturday and Sunday.
47+
1. In the Azure portal, from your Automation account, select **Schedules** under the section **Shared Resources** on the left.
48+
1. Select **Add a schedule** at the top of the page.
49+
1. On the **New schedule** pane, enter a name and optionally enter a description for the new schedule.
50+
1. Select whether the schedule runs one time or on a reoccurring schedule by selecting **Once** or **Recurring**. If you select **Once**, specify a start time and then select **Create**. If you select **Recurring**, specify a start time. For **Recur every**, select how often you want the runbook to repeat. Select by hour, day, week, or month.
51+
1. If you select **Week**, the days of the week are presented for you to choose from. Select as many days as you want. The first run of your schedule will happen on the first day selected after the start time. For example, to choose a weekend schedule, select Saturday and Sunday.
5252

5353
![Setting weekend recurring schedule](../media/schedules/week-end-weekly-recurrence.png)
5454

55-
2. If you select **month**, you're given different options. For the **Monthly occurrences** option, select either **Month days** or **Week days**. If you choose **Month days**, a calendar is shown that allows you to choose as many days as you want. If you choose a date such as the 31st that doesn't occur in the current month, the schedule won't run. If you want the schedule to run on the last day, choose **Yes** under **Run on last day of month**. If you choose **Week days**, the **Recur every** option is presented. Choose **First**, **Second**, **Third**, **Fourth**, or **Last**. Finally choose a day to repeat on.
55+
2. If you select **Month**, you're given different options. For the **Monthly occurrences** option, select either **Month days** or **Week days**. If you select **Month days**, a calendar appears so that you can choose as many days as you want. If you choose a date such as the 31st that doesn't occur in the current month, the schedule won't run. If you want the schedule to run on the last day, select **Yes** under **Run on last day of month**. If you select **Week days**, the **Recur every** option appears. Choose **First**, **Second**, **Third**, **Fourth**, or **Last**. Finally, choose a day to repeat on.
5656

5757
![Monthly schedule on first, fifteenth, and last day of the month](../media/schedules/monthly-first-fifteenth-last.png)
5858

59-
5. When done click **Create**.
59+
1. When you're finished, select **Create**.
6060

6161
### Create a new schedule with PowerShell
6262

6363
Use the [New-AzAutomationSchedule](https://docs.microsoft.com/powershell/module/Az.Automation/New-AzAutomationSchedule?view=azps-3.7.0) cmdlet to create schedules. You specify the start time for the schedule and the frequency it should run. The following examples show how to create many different schedule scenarios.
6464

6565
#### Create a one-time schedule
6666

67-
The following sample commands create a one time schedule.
67+
The following sample commands create a one-time schedule.
6868

6969
```azurepowershell-interactive
7070
$TimeZone = ([System.TimeZoneInfo]::Local).Id
@@ -73,7 +73,7 @@ New-AzAutomationSchedule -AutomationAccountName "ContosoAutomation" -Name "Sched
7373

7474
#### Create a recurring schedule
7575

76-
The following example shows how to create a recurring schedule that runs every day at 1:00PM for a year.
76+
The following example shows how to create a recurring schedule that runs every day at 1:00 PM for a year.
7777

7878
```azurepowershell-interactive
7979
$StartTime = Get-Date "13:00:00"
@@ -101,31 +101,30 @@ $StartTime = (Get-Date "18:00:00").AddDays(1)
101101
New-AzAutomationSchedule -AutomationAccountName "ContosoAutomation" -Name "Weekends 6PM" -StartTime $StartTime -WeekInterval 1 -DaysOfWeek $WeekendDays -ResourceGroupName "ResourceGroup01"
102102
```
103103

104-
#### Create a recurring schedule for first, 15th, and last days of the month
104+
#### Create a recurring schedule for the first, fifteenth, and last days of the month
105105

106-
The following example shows how to create a recurring schedule that runs on the 1st, 15th, and last day of a month.
106+
The following example shows how to create a recurring schedule that runs on the first, fifteenth, and last day of a month.
107107

108108
```azurepowershell-interactive
109109
$StartTime = (Get-Date "18:00:00").AddDays(1)
110110
New-AzAutomationSchedule -AutomationAccountName "TestAzureAuto" -Name "1st, 15th and Last" -StartTime $StartTime -DaysOfMonth @("One", "Fifteenth", "Last") -ResourceGroupName "TestAzureAuto" -MonthInterval 1
111111
```
112112

113-
## Linking a schedule to a runbook
113+
## Link a schedule to a runbook
114114

115-
A runbook can be linked to multiple schedules, and a schedule can have multiple runbooks linked to it. If a runbook has parameters, then you can provide values for them. You must provide values for any mandatory parameters and may provide values for any optional parameters. These values are used each time the runbook is started by this schedule. You can attach the same runbook to another schedule and specify different parameter values.
115+
A runbook can be linked to multiple schedules, and a schedule can have multiple runbooks linked to it. If a runbook has parameters, you can provide values for them. You must provide values for any mandatory parameters, and you also can provide values for any optional parameters. These values are used each time the runbook is started by this schedule. You can attach the same runbook to another schedule and specify different parameter values.
116116

117117
### Link a schedule to a runbook with the Azure portal
118118

119119
1. In the Azure portal, from your automation account, select **Runbooks** under **Process Automation**.
120-
2. Click on the name of the runbook to schedule.
121-
3. If the runbook isn't currently linked to a schedule, then you're offered the option to create a new schedule or link to an existing schedule.
122-
4. If the runbook has parameters, you can select the option **Modify run settings (Default:Azure)** and the Parameters pane is presented. You can enter parameter information here.
120+
1. Select the name of the runbook to schedule.
121+
1. If the runbook isn't currently linked to a schedule, you're offered the option to create a new schedule or link to an existing schedule.
122+
1. If the runbook has parameters, you can select the option **Modify run settings (Default:Azure)** and the **Parameters** pane appears. You can enter parameter information here.
123123

124124
### Link a schedule to a runbook with PowerShell
125125

126-
Use the [Register-AzAutomationScheduledRunbook](https://docs.microsoft.com/powershell/module/Az.Automation/Register-AzAutomationScheduledRunbook?view=azps-3.7.0) cmdlet to link a schedule. You can specify values for the runbook’s parameters with the Parameters parameter. For more information on specifying parameter values,
127-
see [Starting a Runbook in Azure Automation](../automation-starting-a-runbook.md).
128-
The following example shows how to link a schedule to a runbook using an Azure Resource Manager cmdlet with parameters.
126+
Use the [Register-AzAutomationScheduledRunbook](https://docs.microsoft.com/powershell/module/Az.Automation/Register-AzAutomationScheduledRunbook?view=azps-3.7.0) cmdlet to link a schedule. You can specify values for the runbook’s parameters with the Parameters parameter. For more information on how to specify parameter values, see [Starting a Runbook in Azure Automation](../automation-starting-a-runbook.md).
127+
The following example shows how to link a schedule to a runbook by using an Azure Resource Manager cmdlet with parameters.
129128

130129
```azurepowershell-interactive
131130
$automationAccountName = "MyAutomationAccount"
@@ -137,32 +136,32 @@ Register-AzAutomationScheduledRunbook –AutomationAccountName $automationAccoun
137136
-ResourceGroupName "ResourceGroup01"
138137
```
139138

140-
## Scheduling runbooks to run more frequently
139+
## Schedule runbooks to run more frequently
141140

142-
The most frequent interval a schedule in Azure Automation can be configured for is one hour. If you require schedules to execute more frequently than that, there are two options:
141+
The most frequent interval for which a schedule in Azure Automation can be configured is one hour. If you require schedules to run more frequently than that, there are two options:
143142

144-
* Create a [webhook](../automation-webhooks.md) for the runbook and use [Azure Logic Apps](../../logic-apps/logic-apps-overview.md) to call the webhook. Azure Logic Apps provides more fine-grained granularity when defining a schedule.
143+
* Create a [webhook](../automation-webhooks.md) for the runbook, and use [Azure Logic Apps](../../logic-apps/logic-apps-overview.md) to call the webhook. Azure Logic Apps provides more fine-grained granularity to define a schedule.
145144

146-
* Create four schedules all starting within 15 minutes of each other running once every hour. This scenario allows the runbook to run every 15 minutes with the different schedules.
145+
* Create four schedules that all start within 15 minutes of each other and run once every hour. This scenario allows the runbook to run every 15 minutes with the different schedules.
147146

148-
## Disabling a schedule
147+
## Disable a schedule
149148

150-
When you disable a schedule, any runbook linked to it no longer runs on that schedule. You can manually disable a schedule or set an expiration time for schedules with a frequency when you create them. Once the expiration time is reached, the schedule is disabled.
149+
When you disable a schedule, any runbook linked to it no longer runs on that schedule. You can manually disable a schedule or set an expiration time for schedules with a frequency when you create them. When the expiration time is reached, the schedule is disabled.
151150

152151
### Disable a schedule from the Azure portal
153152

154153
1. In your Automation account, select **Schedules** under **Shared Resources**.
155-
2. Click the name of a schedule to open the details pane.
156-
3. Change **Enabled** to **No**.
154+
1. Select the name of a schedule to open the details pane.
155+
1. Change **Enabled** to **No**.
157156

158157
> [!NOTE]
159-
> If you want to disable a schedule that has a start time in the past, you must change the start date to a time in the future before saving it.
158+
> If you want to disable a schedule that has a start time in the past, you must change the start date to a time in the future before you save it.
160159
161160
### Disable a schedule with PowerShell
162161

163162
Use the [Set-AzAutomationSchedule](https://docs.microsoft.com/powershell/module/Az.Automation/Set-AzAutomationSchedule?view=azps-3.7.0) cmdlet to change the properties of an existing schedule. To disable the schedule, specify False for the `IsEnabled` parameter.
164163

165-
The following example shows how to disable a schedule for a runbook using an Azure Resource Manager cmdlet.
164+
The following example shows how to disable a schedule for a runbook by using an Azure Resource Manager cmdlet.
166165

167166
```azurepowershell-interactive
168167
$automationAccountName = "MyAutomationAccount"
@@ -194,4 +193,4 @@ Remove-AzAutomationSchedule -AutomationAccountName $automationAccountName `
194193

195194
## Next steps
196195

197-
* To get started with runbooks in Azure Automation, see [Starting a Runbook in Azure Automation](../automation-starting-a-runbook.md).
196+
To get started with runbooks in Azure Automation, see [Starting a runbook in Azure Automation](../automation-starting-a-runbook.md).

0 commit comments

Comments
 (0)