Recently, Microsoft introduced the concept of Ephemeral OS disk for certain types of VMs. An Ephemeral OS disk is stored on local storage and is therefore faster and free, but it is not persistent. It is therefore only used in situations where the VM is based on an image and every time it is started the OS disk will get “regenerated” from the generalized image and any changes made to the OS disk (C: ) will be lost if the VM moves to another host or is reallocated.
This would be super helpful for ephemeral Jenkins agents to have the best performance like the temporary disk (D: ) and have no cost for this disk.
What I can see it's only a small change in the json. The diffDiskSettings with option Local seems to be the key.
Machine sizes must be big enough to carry the disk image (127 GB for Windows from Marketplace) in their cache. Or use one of the smalldisk images (30 GB) and set the diskSizeGB to 100 GB for a Standard_D4s_v3.