Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Best approach to run a container from an Azure function

Some general advice and pointers.

I want to run a task in a container from an azure function. So either triggered by a queue or HTTP the function would spin up a container, passing some parameters and that container would do it's work and then be deleted, so just paying for computation time. This could happen in parallel but each time is totally independent from others.

So i believe i can use Powershell with Azure functions but i would prefer to create a c# function through a VS template. Is there an SDK that would allow me to run containers in c#? Can someone point me to docks?

I know that there are orchestration frameworks (maybe too complicated) and there are Batch jobs that would spin up one - but it strikes me that i need a very simple approach?

One of the challenges with Azure is too much choice!

thanks in advance Paul

like image 729
paulinventome Avatar asked Nov 07 '22 06:11

paulinventome


1 Answers

My suggestion would be to use an HTTP trigger to call an Azure function to start an Azure Container Instance using the ACI SDK.

Here is a good example walkthrough.

Good luck.

like image 57
Lou O. Avatar answered Nov 15 '22 08:11

Lou O.