@nikhil satpute , thank you for the reply. Please see the link below which contains some sample and concepts for getting the required result using post deployment scripts in Azure Automation
Sample pre-post script
update-management-run-script-with-run-command/UpdateManagement-RunCommand.ps1
The first script contains boilerplate code for authentication using Managed Identity. The second script has a complete script to start a single script, but it uses service principal for authentication. You could mix the concepts from both of them to meet your requirement. It will require some more modification in the $scriptBlock
which contains the logic to start the service. I am uploading a sample script to start 2 services in sequence with this reply.
In the sample script uploaded, the logic to start services in sequence are available in $scriptBlock
(line 62-123).
Hope this helps. Please let us know if you have any questions.