I would suggest to onbaord your on-permises servers via ARC for servers. That way these will servers will be visible in Azure as ARC machines. With that _ResourceId column will be filled for the data in Event table and each machine will have different _ResourceId value no matter that the computer names are the same. This will not require doing join with Heartbeat every time you want to investigate the data.
Please "Accept the answer" if the information helped you. This will help us and others in the community as well.