Hi,
For Azure VMs (Windows only) you can install Antimalware extension which is basically the free version of Windows Defender. If you want some more advanced capabilities, you will need to enable Azure Defender for Servers.. Azure Defender for Servers enables you to use Microsoft Defender for Endpoint without requiring another license (you still will pay for Azure Defender for Servers). See Integrated license for Microsoft Defender for Endpoint part in the link provided.
Please "Accept the answer" if the information helped you. This will help us and others in the community as well.