Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Add a way to clear down AppConfiguration stores on bicep deploy #2168

Open
MrAntix opened this issue May 10, 2024 · 4 comments
Labels
enhancement New feature or request Needs: Triage 🔍

Comments

@MrAntix
Copy link

MrAntix commented May 10, 2024

When I change my configuration for my app the old keys remain, this means I have to clean up the old keys manually
Which I may not do, because I got distracted by a donut or something, leaving old settings confusing other developers or new members of the team

If a configuration property could be added that would clear down the keys somehow that would be super.

Could this work?

resource appConfig 'Microsoft.AppConfiguration/configurationStores@2023-09-01-preview' = {
  name: appConfigName
  location: location
  sku: {
    name: 'standard'
  }
  properties: {
      createMode: 'Clean'
  }
}

although 'createMode' does suggest it only happens when the resource is not found or deleted

would another property work?

...
  properties: {
      clean: true
  }
...

Thank you

@ahelland
Copy link

I find app configuration clunky for other reasons, but maybe that's just me :)

Are these values that are always manually input or would an overwrite from Bicep work? In general Bicep doesn't handle deletion use cases as such though depending on the resource provider the deployment mode might help you along the way.

I haven't tested this, but if the app configuration values are created with Bicep (at least initially even if they are manually changed afterwards) - would it work to have that as a separate deployment stack and have a script that deletes the stack? If the list of which values should be cleared and which should be kept is too dynamic it might be challenging though.

And that would delete the value too of course. If you need the value but want it to be null wouldn't it work to just provide an empty string as the value?

@MrAntix
Copy link
Author

MrAntix commented May 14, 2024

The reason for this is to remove manual intervention entirely.
The content of the deployed appConfig needs to be exactly what is in the bicep file, no more, no less

Currently, bicep does not remove old values and a script is needed to delete them

I am not after a work around, but a feature :)

I have updated the title to make that clear

@MrAntix MrAntix changed the title Add a way to clear down AppConfiguration stores on bicep deploy Feature Request: Add a way to clear down AppConfiguration stores on bicep deploy May 14, 2024
@ahelland
Copy link

Nothing wrong with wishing for features, but a workaround (if applicable) can be used "today". Feature requests might take a little longer :)

I'm not sure if this kind of opinionation would live in Bicep core though. Some of it probably lies within the resource provider. Take Application Gateway for instance; if you configure it for www-1.contoso.com, www-2.contoso.com & www-3.contoso.com and afterwards reconfigure it to accept www-1 without mentioning the other two those will be removed even if you didn't ask for it. So, the opposite of App Configuration values basically. Which one is right, and which one should change?

I don't like the way App Gateway does it because that creates some logical errors with deployment, but I don't have the "right answer" either.

But then again - I'm also just a member of the community so I'm not calling the shots here :)

@stephaniezyen
Copy link
Contributor

This looks to be by design within the "Microsoft.Appconfiguration" - I would reach out to that team if you wanted to streamline the issue, but I can try to route it to their team in the meantime.

@stephaniezyen stephaniezyen transferred this issue from Azure/bicep May 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Needs: Triage 🔍
Projects
Status: Todo
Development

No branches or pull requests

3 participants