@Amol Bhalerao , Thank you for reaching out to Microsoft Q&A for this question.
Based on my understanding of the issue above, I would suggest using Azure Automation for the periodic/scheduled run of this script. When this script runs (as a runbook job in Azure Automation), the relevant details are recorded and will be available to you as shown in the following screenshot:
You can even click on individual job run as shown in the screenshot above to get details like - error, output, warning, logs etc.
This link contains a quick start guide to help you get started.
You can even forward the job status to Log Analytics workspace, from where you would be able to query the details using KQL and create workbooks.
Please let me know if you have any questions.
If the suggestion above does not meet your requirement, can you please elaborate the query to help us understand it better - with screenshots/samples etc.