I have a .net core web api that requires cosmos db...
# dotnet
f
I have a .net core web api that requires cosmos db, azure file share, and I was wondering how you guys structure the solution so you can deploy a .net core web app/api using azure-csharp. Would you create a new project or would you install pulumi in the api you want to deploy?
This is my current setup
w
Haven’t done it in prod yet, but that is sort of how I imagine it. I might separate it out in folders as well, one for the infrastructure and one for the app.
👍 1
f
Yep. I’m currently doing it that way, so I can add my azure-pipelines.yml in the root directory and publish my app and then call the Pulumi ADO Task.
I have this running locally when I specify where the publish folder of the WebApi, however I’m having some trouble trying to change that value when Pulumi runs on ADO Pipelines since the path is not a file system anymore and the Staging folder is not shared by the task that publishes and the Pulumi task. Have you used ADO pipelines for this @wet-noon-14291?
w
Yes I did in my proof of concept. But I used a make script to run a fake script that ran pulumi. So all I needed in devops was “make deploy” basically, and set the pulumi token.
The code for it is here https://github.com/mastoj/sweetspot. Might not be straightforward to follow since it is a playground.
f
I see, I’m currently using the Pulumu ADO task, might be a little bit hacky what I’m doing but I will go your route if I can’t figure this out. Thank you for sharing!
w
I would say my way is more hacky, but it is also easier to run the exact same thing locally. To test it from local I can just run “make deploy” the same way as I do in devops.
f
I figured something out! This is what I ended up with https://gist.github.com/frankely/de9a9113e5618ac3c4ffa3f48d430ae2
Make sure to set up the stagingDirectory locally so you can also run pulumi preview/up.