I'm trying to grab the name of the Azure VM scale set from the computer's name. I'm able to get close, but not reliably so. I've found this article which mentions the (vmss name)(base 36 instance id) format which I found to be fairly accurate, although with VMSS names under 9 characters, I seem to get random extra characters added to my computer name which don't show up in Azure.
Ex: (in Azure Portal)
VMSS name = "win10"
Instance ID = 2
Computer name = "win10_2"
Therefore, I'd expect the machine name to be "win10000002", however, whenever I remote into the VM and look at the computer name, it shows "win10bc5n000002", note the extra "bc5n" added into it. Does anyone know why this happens or a way to reliably predict it so I can programmatically remove it when I grab the computer name on the machine? The length of my VMSS names won't be consistent, so I can't reliably split the string to remove the 4 extra chars.
EDIT: here's some screen shots of the Portal vs Computer name: