Welcome to the Microsoft Q&A Platform! Thank you for asking your question here.
Run the script on your local machine first to check for issues like missing modules, syntax errors, or logic mistakes before deploying it to Azure.
Check that all needed modules are in your Automation account. If your runbook uses any, make sure they are updated and properly installed to avoid unexpected errors.
Add more output statements to your runbook to track its execution flow. This will help you determine what occurs just before the runbook is suspended or fails.
Since you've upgraded to PowerShell 7.4, make sure all scripts and modules are compatible with this version, as it could offer better stability than previous versions.
If relevant, deploying Hybrid Runbook Workers can help resolve issues by running jobs closer to the resources they manage.
For long-running tasks, using checkpoints can help control the execution flow and recover from failures without losing progress.
For reference, please review this documentation:-
https://learn.microsoft.com/en-us/azure/automation/troubleshoot/runbooks
https://github.com/MicrosoftDocs/azure-docs/blob/main/articles/automation/troubleshoot/runbooks.md?plain=1
https://learn.microsoft.com/en-us/azure/automation/troubleshoot/extension-based-hybrid-runbook-worker
https://github.com/uglide/azure-content/blob/master/articles/automation/automation-troubleshooting-automation-errors.md
If you have any further queries, do let us know.
If the answer is helpful, please click "Accept Answer" and "Upvote it".