There are some options for this but I'm not sure if they are suited to your exact scenario.
You can perform pre or post backup scripts for Linux: https://learn.microsoft.com/en-us/azure/backup/backup-azure-linux-app-consistent
Otherwise, instead of using Azure Backup for IaaS VMs you can use MABS which is also part of the Azure Backup family and this also has support for pre and post backup scripts: https://learn.microsoft.com/en-us/azure/backup/pre-backup-post-backup-scripts
MABS: https://learn.microsoft.com/en-us/azure/backup/backup-azure-microsoft-azure-backup