Azure / bicep-types-az

Bicep type definitions for ARM resources
MIT License
86 stars 27 forks source link

[Microsoft.DevTestLab/schedules@2018-09-15]: timeZoneId was incorrectly removed from documentation #2058

Open TiTi opened 8 months ago

TiTi commented 8 months ago

Resource Type

Microsoft.DevTestLab/schedules

Api Version

2018-09-15

Issue Type

Missing property(s)

Other Notes

However official documentation is INCORRECT here: https://learn.microsoft.com/en-us/azure/templates/microsoft.devtestlab/schedules?pivots=deployment-language-bicep timeZoneId is no more mentionned since @2018-09-15 (i don't know where to report this)

Type is CORRECT here: https://github.com/Azure/bicep-types-az/blob/main/generated/devtestlabs/microsoft.devtestlab/2018-09-15/types.md#scheduleproperties

As seen in the changelog https://learn.microsoft.com/en-us/azure/templates/microsoft.devtestlab/change-log/schedules timeZoneId was removed (provisioningState & uniqueIdentifier are readOnly)

However this is working:

resource autoShutdownConfig 'Microsoft.DevTestLab/schedules@2018-09-15' = [for i in range(0, vmCount): if (autoShutdown) {
  name: 'shutdown-computevm-${vms[i].name}'
  location: location
  properties: {
    status: 'Enabled'
    taskType: 'ComputeVmShutdownTask'
    timeZoneId: autoShutdownTimeZone
    targetResourceId: vms[i].id
    dailyRecurrence: {
      time: autoShutdownTime
    }
    notificationSettings: {
      status: 'Disabled'
      timeInMinutes: 30
    }
  }
}]

And timeZoneId is probably mandatory.

Bicep Repro

param vmName
param location

resource vm 'Microsoft.Compute/virtualMachines@2023-09-01' existing = {
  name: vmName
}

resource autoShutdownConfig 'Microsoft.DevTestLab/schedules@2018-09-15' = {
  name: 'shutdown-computevm-${vmName}'
  location: location
  properties: {
    status: 'Enabled'
    taskType: 'ComputeVmShutdownTask'
    timeZoneId: 'Romance Standard Time'
    targetResourceId: vm.id
    dailyRecurrence: {
      time: '2000'
    }
    notificationSettings: {
      status: 'Disabled'
      timeInMinutes: 30
    }
  }
}

Confirm

microsoft-github-policy-service[bot] commented 8 months ago

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @Tanmayeekamath. Please see https://aka.ms/biceptypesinfo for troubleshooting help.