I am trying to link a schedule to a runbook using bicep. It fails with the error "Bad Request" and give no other information. Can anyone help with what I am doing wrong here?? The schedule and runbook both exist inside the automation account.
I have followed the Azure documentation and examples so I would expect the code to work but I only receive "Bad Request"
param automationAccountName string
resource automation_account 'Microsoft.Automation/automationAccounts@2022-08-08' existing = {
name: automationAccountName
}
resource job_schedule 'Microsoft.Automation/automationAccounts/jobSchedules@2022-08-08' = {
name: 'test-schedule-xxxxxxxxxxxxxxxxxxxxxx'
parent: automation_account
properties:{
parameters: {} //scheduleParams
schedule: {
name: 'myschedule'
}
runbook: {
name: 'CheckFileExistsTest'
}
}
}
JobSchedule name must be the 'uuid' string, can not be arbitray. if name is not formated with 'uuid', will throw the error BadRequest
without any additional messages.
I have already test at my side, works well.
param automationAccountName string = 'wbautoaccounttest'
param guidValue string = newGuid()
resource automation_account 'Microsoft.Automation/automationAccounts@2023-11-01' existing = {
name: automationAccountName
}
resource job_schedule 'Microsoft.Automation/automationAccounts/jobSchedules@2023-11-01' = {
name: guidValue
parent: automation_account
properties:{
parameters: {}
schedule: {
name: 'wbtest'
}
runbook: {
name: 'wbtestrunbook'
}
}
}