
Explanation:
https://learn.microsoft.com/en-us/azure/azure-sql/virtual-machines/windows/performance- guidelines-best-practices-storage?view=azuresql#caching We need to set 'Read-Only' caching for data disks and 'None' for the log disk.
There is a loop (copy) in the ARM template, it evaluates whether current disk ID is greater than sum of data disks. If yes then it's the log disk, so assign None, otherwise the value in the variable (i.e. Read-Only).
https://learn.microsoft.com/en-us/azure/azure-sql/virtual-machines/windows/create-sql-vm- resource-manager-template