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:
Hope this helps!
@Dayanand Prasad - Just checking in to see if the above answer helped. If this answers your query, do click "Accept as Answer" and Up-Vote for the same, which might be beneficial to other community members reading this thread. And, if you have any further query do let us know.