https://pulumi.com logo
Title
s

salmon-printer-16080

09/19/2021, 9:53 PM
Hi there, We have a Pulumi stack that contains an Azure App Service, which has some default AppSettings. When we deploy into this app Service from a different pipeline, the AppSettings are also updated. However, whenever I re-run the pulumi stack, the AppSettings are replaced with the original ones, not from the deployment. Now I know I can ignore changes made to those appsettings, however, this still gets replaced when I update the appsettings on Pulumi's side. Is there anyway to update the settings that have changed on the pulumi side, but ignoring existing ones? I have thought about using refresh to get those settings into state, but these are replaced on subsequent runs anyway.
b

billowy-army-68599

09/19/2021, 10:24 PM
just so I'm clear, you're running Pulumi from two different places with two different configurations? it's not totally clear what's happening here
s

salmon-printer-16080

09/19/2021, 10:31 PM
Sorry, we have infrastructure deployments with Pulumi to create some underlying infra and an App Service. As part of that, we want to set some defaults for some App and config settings. We have a separate deployment pipeline in ADO which deploys into that App Service, its not in Pulumi. This also sets some appSettings which are specific to the app. When re-deploying the pulumi pipelines, the config set by the ADO pipeline is wiped.
I want to ignore all changes to the settings (which I have done using
ignore
), however, this does not work if we add an extra app setting in pulumi. It just replaces whatever is there with what it thinks should be there and ignores any existing settings.
I want to be able to update app settings in pulumi, which will only update or change the value I added/changed, but ignoring all others.
(We could also be going about this wrong, still quite new to this 😅 )
b

billowy-army-68599

09/19/2021, 10:40 PM
unfortunately that's not the right way to go about it. Pulumi drives towards a desired end state, so when your ADO pipeline runs, it changes the state of the services.
the only way for this to work would be use pulumi, delete all the resources from the state, then use the ADO pipeline, but then you can't update anything with Pulumi
I would recommend using just Pulumi if you can
s

salmon-printer-16080

09/19/2021, 10:48 PM
Sadly we are not in a position to do that, I might suggest we do not set app settings on the Pulumi deployments; instead always set at the app deployment level. Could it be an option to programmatically grab the updated settings and re-set them? Something like... 1. When deploying a app service, check to see if existing settings exist (using the
existing resource lookup
) 2. If exists, get all settings and add them to a list 3. Run through the list, check those settings against the ones set in pulumi 4. Replace the settings with the pulumi versions, keeping all the others 5. update the app service with new settings
b

billowy-army-68599

09/19/2021, 11:04 PM
that's currently not available as an option, but we do have an issue open for it. Pulumi expects to have a desired state to drive towards, in a declarative manner. your logic is very imperative, so it's not possible to define in Pulumi
s

salmon-printer-16080

09/19/2021, 11:47 PM
Okay thanks