Is it possible to use Azure Functions endpoints to...
# automation-api
w
Is it possible to use Azure Functions endpoints to wrap pulumi Automation? I have some simple pulumi TS code that creates a resource group and want to hit an endpoint in azure that will then provision a resource group for me. Basically const stack = await LocalWorkspace.createStack({ stackName: orgAndStack, projectName, program: createPulumiProgram(context, content), } ); inside an azure function. I have tried and I can run it locally but not on azure. Errors are "errno": -4058, "code": "ENOENT", "syscall": "spawn pulumi", I think this implies it tries to call the CLI which I guess is not available at the point where the code is executed. Should I just dump all my stuff into a docker container instead and give up on the Azure Functions idea?
b
Currently automation api requires the use of the CLI locally still. So if you can't make that accessible within the azure function than it won't be doable
👍 1
w
Alright. Thanks, I suspected this, really good to get a confirmation. I have set up a new path hosting this in a container instead. Adding the CLI to the container should be much simpler, I hope 🙂
b
It was implemented modularly such that there are plans to not need the CLI eventually and it could be pulled out / replaced, but that's probably a ways off. Good luck!
b
👍 1
🙌 1