If you provide a resource name for your Azure VM that is longer than 15 characters, the name in the Windows OS will be shortened to 15 characters (OS limitation). That means that your Azure Resource name and Windows name of the VM will not be the same.
I wrote a new Azure Policy to limit the name of the Azure Virtual Machines resource to 15 characters, to prevent this from happening.
You can check it out here:
https://github.com/vukasinterzic/Azure/blob/3e654fc8130be6bf2bbcfe13ebad05f0da7adb63/Azure%20Policy/NamingPolicy-VirtualMachines.json
I wrote a new Azure Policy to limit the name of the Azure Virtual Machines resource to 15 characters, to prevent this from happening.
You can check it out here:
https://github.com/vukasinterzic/Azure/blob/3e654fc8130be6bf2bbcfe13ebad05f0da7adb63/Azure%20Policy/NamingPolicy-VirtualMachines.json