azureautomation / automation-packs

Collections of Automation resources that can include runbooks, configurations, modules, credentials, schedules, variables, connections, certificates, jobs, compilation jobs, and nodes.
MIT License
75 stars 42 forks source link

Cannot apply ARM template several with job schedule #22

Open r3dlin3 opened 5 years ago

r3dlin3 commented 5 years ago

Hi,

I have been using the sample 102-sample-automation-setup. It confirmed the fact that it is impossible de use ARM templates to manage job schedules.

Anytime I try to apply twice the same ARM with jobSchedules, I get the error:

"Job with specified id already exists. Job id: 17887671-2bbd-4e79-bdee-40378a485a93"

Is there any way to work around this?

VladimirtheGreatest commented 3 years ago

@r3dlin3 You can create a simple powershell script that will be executed before your arm template gets deployed. You powershell script can just remove your jobschedule resource Something like this Set-AzAutomationSchedule -AutomationAccountName "Contoso17" -Name "Schedule01" -Description "Automation Schedule" -ResourceGroupName "ResourceGroup01"