Hi,
To use Azure Monitor for a linux service you would have to export their logs/metrics with an agent. For mariadb and apache below post gives you more details:
https://learn.microsoft.com/en-us/azure/azure-monitor/agents/data-sources-linux-applications
Hope this helps!