Hi, I posted this question in the general channel ...
# dotnet
r
Hi, I posted this question in the general channel about AppSettings getting deleted from an Azure Function app during an unrelated update (using .Net C#). If anyone can help I would be very grateful. https://pulumi-community.slack.com/archives/C84L4E3N1/p1657549693249239
e
It appears that any non-Pulumi app settings are getting wiped even when Pulumi indicates that it will not be updating the App Settings.
That's expected. Pulumi (like other IAC tools) assumes it's the only one managing the resources and so will try to make the resource state match exactly the state declared by the program. If you add a setting manually, but not to the program Pulumi will correct that drift.
This was a Pulumi Preview --diff for a function app of mine. No AppSetting changes indicated. I did the Pulumi Up and all existing App Settings were deleted. Very annoying!! This was after doing a Refresh and then also an Import to ensure all existing settings were discovered. However it does not appear that AppSettings are gathered into state using either.
I'm surprised that refresh didn't pick up the manually added settings. If it add then diff would of correctly shown that there we're going to be changes applied. Can you raise a bug about that at https://github.com/pulumi/pulumi-azure-native/issues.
w
Thanks @echoing-dinner-19531 for the response. Much appreciated. I have a similar issue with Managed Identity and SQL Server. The refresh or import does not get the details and Pulumi tries to replace things it should not. Regarding the AppSettings, if I do not add a value for them in Pulumi, are you suggesting that Pulumi should then want to delete any that have been added by other methods?
e
Regarding the AppSettings, if I do not add a value for them in Pulumi, are you suggesting that Pulumi should then want to delete any that have been added by other methods?
I'd think so. There are a few odd resources where when we send state the cloud provider will concatenate that state rather than replace, but mostly what's in the pulumi program is exactly what ends up in the cloud.