Thanks for reaching out to Microsoft Q&A.
Please go through this guidance here - https://learn.microsoft.com/en-us/shows/it-ops-talk/auto-shutdown-and-auto-start-an-azure-vm and let us know if this helps.
Other approach that can be followed is here- https://gist.github.com/neb83/8e92c7fc148a45df4cc33e8e7e0115ce
Please do not forget to "Accept the answer” and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.