I have a multi-container app that I need to run twice a day at specific times for about 30 mins each time. To save costs, I would like to:
docker-compose up -d
, waits 30 mins, then calls docker-compose stop
I'd love for this to happen automatically on a cron schedule.
So far, I've failed to find any Azure solution that can do all of this. Azure automation allows you to turn on/off VMs but it doesn't allow you to run a sh script on it after you've turned it on. Azure Logic apps allows you to spin up containers on a schedule but not with docker-compose.
Any idea on how I might accomplish this in a way that doesn't involve me having a VM that is always on?
No worries , you can use this AZ powershell command to run sh script on your Azure VMs directly via Azure automation runbook with prarm : -CommandId 'RunShellScript'
For AzureRM commands , refer to here
I have tested on my side and it works perfectly for me .