0

I want to programmatically deploy a new docker container on demand from an existing image from an azure function app (e.g. from a cosmodb trigger). Can someone provide some guidance? I'm having difficulty finding any documentation as all my searches bring up running an azure function within a container, which isn't what I'm trying to do.

edit further clarification in my use case, i am using a cosmosdb trigger in a function app. When that cosmosdb collection gets a new record, I extract a string from that record, and then pass that string as a run parameter to dynamically create a new docker container from an existing ACR image.

I am thinking I'll have to use powershell within the function app to do this, I was hoping there would be a C# solution.

NoCarrier
  • 2,558
  • 4
  • 33
  • 44
  • What do you mean by deploying a docker container from the Azure function app? deploy the container inside the function or deploy the function from the image? – Charles Xu Dec 17 '20 at 03:07
  • There is an azure container instances (ACI) connector in logic apps - which might be an option if your workflow is fairly simple. Otherwise, you might have to look into some of the sdks and configure it yourself. – mmking Dec 17 '20 at 03:08
  • @CharlesXu I modified the question to be a bit more specific – NoCarrier Dec 17 '20 at 19:30
  • It seems you can create a trigger via C# that create an ACI with the image from ACR. I think it's not a problem. – Charles Xu Dec 18 '20 at 08:14

1 Answers1

0

What you can do is create an Azure devops pipeline to deploy your new container. Then trigger the running of the pipeline from your function app.

Shiraz Bhaiji
  • 64,065
  • 34
  • 143
  • 252