Microsoft Windows allows a VM name that has maximum of 15 characters. Also, you can't specify a DNS host name that differs from the NETBIOS host name. However, you can create host headers for a website hosted on an Azure VM with the name as per recommendation.
Learn more about the VM naming convention limitations for Azure VMs.