I have a container instance and would like to have azure send an email when some command fails inside my azure container instance.
I was thinking of having an azure function scheduled at a certain period of time to run every 30 minutes between 00:00:00 utc and 2h utc and it would check the state of the azure container instance and if a certain string was present in the logs of that ACI and then send an email.
But I've found that azure functions don't allow to use the azure cli commands inside the azure functions and as such I cannot access the logs of my ACI with az container
logs.
I also thought of using an azure batch job, but I don't know if I can create a pool with my ACI which uses an image I have created running at the abovementioned period of time and check the logs of my ACI and have azure send an email with the logs if a certain string is present in the logs.
I am new to Azure and any help on this would be appreciated.