There are quite a few options, but based on tags I'm guessing you are looking at Functions and Logic Apps specifically, and that is what I would generally choose for something like this. The short answer is that Logic Apps doesn't currently support SSH for anything other than SFTP so you will need to use Functions or a combination of the two. In particular I'd take a look at the durable functions framework. This helps with chaining together tasks in a workflow and helps support restarting a workflow in the middle if it is interrupted. For example, if your SSH connection was interrupted between installing terraform and running commands, you could pick back up at the init step than you would otherwise.
Sending email directly from Azure isn't permitted- you need to use a service like Sendgrid or Outlook. Sendgrid in particular is well-integrated into Functions, or you can use the service of your choice.
The one small hiccup is the 2 hour wait between creating the container and destroying it. By default, Azure Functions consumption plan has a maximum run time of 10 minutes. There are two main options for overcoming this. The first would be to run your functions on a Premium plan which has an unlimited maximum run time- you set the value to whatever you want. The second option is to use scheduled messages in either a Service Bus or Storage queue. Your first set of functions would both output to email and schedule the message in the queue with any needed info. The next function would listen to the queue and pick up the message after the queue releases the message two hours later.