I plan to use the Feature Management functionality within Azure App Configuration service.
Using bicep I create the configuration store.
Using bicep I add a feature flag.
The value should be initially set to false
and once available it's up to the business/ops to change the value to true
in the Azure Portal.
So I'm looking for a way to conditionally create the feature flag in my bicep; create the feature flag if it not exists. When it already exists, the bicep should skip creation because it could otherwise overwrite/reset the flag value changed by the business/ops.
I found this issue on GitHub from which I conclude that bicep does not yet support this requirement: https://github.com/Azure/bicep/issues/4023
Any suggestions for a workaround?
You can't really do that unless you check manually if the
featureFlag
exists before running the deployment. ARM templates (and Bicep) try to be idempotent so if you apply the same template multiple times it will reset any manual changes.Here is a bicep file that creates a config store and feature flag:
And here is a sample powershell script that invoke it: