What is the recommended way to run a piece of code...
# dotnet
What is the recommended way to run a piece of code after a resource has been provisioned? Is it to do
on a
for example and then run some kind there?
What does the code do?
The provisioner examples might be relevant
I’ll check the calendar example when on computer, thanks. My plan is to create some sql db accounts when the db has been provisioned.
I have no clue how "provisioner example" turned into "calendar example"... Anyhow, is there a more lightweight approach to run something every time you do
pulumi up
after some resources have been provisioned. The provisioners example is heavier than expected and is also based on one resource dependency as I see it. I can definitely work my way around it, but I was thinking it might be an easier way?
I guess you were referring to this example @stocky-spoon-28903 https://github.com/pulumi/examples/blob/master/azure-ts-vm-provisioners/provisioners/provisioner.ts, looks like
doesn't exist for .NET yet though.
Since dynamic providers, https://www.pulumi.com/docs/intro/concepts/programming-model/#dynamicproviders, isn't available in .NET I'm on the search for a workaround. Any pointers?
Which DB is it?
Azure sql this time.
Is that SQL Server?
The best way to do this is to fit it into resource models - Postgres has a provider for example
I definitely agree, I just don't know how to do it for SQL Server. I would love to have something like a
resource, but not sure how I would go about creating such a resource. Using a dynamic provider would make such a thing easy though.
my workaround at the moment is to solve it with db migration, but it is a little bit "hacky" because I sort of need to do two migration steps. One step to create login in master database and then one towards the actual database to create user and tables in that database.
Really appreciate your answers @stocky-spoon-28903! Not sure how I would go from that terraform provider to pulumi though. Also, not sure I want to base a pulumi provider on something that was made as an experiment two years ago. As of now I think I'll just have to live with my workaround.
You should talk to @broad-dog-22463 about this one!
👍 1
For users etc there’s probably something better than can be done
I definitely agree @stocky-spoon-28903, users (or logins as it is called in MSSQL) would ideally be created from pulumi. @broad-dog-22463, do you have any suggestion on this? I do have a workaround as mentioned so not critical at all but it would be a smoother experience working with SQL Server.