Hi,
Below you have the documentation for how to create a FQDN name for your VM:
https://learn.microsoft.com/en-us/azure/virtual-machines/create-fqdn
After that you can use the FQDN to connect to the VM - you have to use the full name.
Hope this helps!