Should this.existingResource() work in the Microsoft.Web/sites/config resource for appsettings?
#18572
Unanswered
ronaldbosma
asked this question in
Q&A
Replies: 1 comment 1 reply
-
|
Created issue: Azure/bicep-types-az#2639. For Microsoft.Web/sites/config appsettings, empty properties are returned for existing resources. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I saw the blog post How to use the
thisnamespace in Bicep to check resources from Gijs Reijn and thought it might be useful for the following scenario: I've had several projects with a separation in platform and application teams. The platform team is responsible for deploying the infrastructure, including App Services, while the application team deploys the application code. In such scenarios, the platform team often configures default app settings required for the App Service, and the application team adds application specific app settings.To prevent deployments from removing app settings from the other team, I'm currently using a module that allows existing app settings to be merged with new app settings. Both the platform and application team need to use it to not overwrite each others app settings.
I was hoping that
this.existingResource()might replace this and I could do something like this:However,
this.existingResource().?propertiesseems to always be an empty object in this case.I've worked out a scenario to try it out (note: it's on the
this-existing-resourcebranch):This site.bicep will deploy a function app with some default app settings as show in this image.
This additional-app-settings.bicep should add some more app settings. Here's the snippet I'm using:
The
THIS_EXISTSapp setting will get a value oftrue, but theTHIS_EXISTING_RESOURCE_PROPERTIEShas a value of{}instead of an object with the existing app settings. See the image below.You can execute the scenario with the deploy.ps1 script by running the following command where
<your-resource-group>is the name of your resource group:. .\deploy.ps1 -ResourceGroupName "<your-resource-group>"Note that you curently need to install the nightly bicep cli build for this feature to work.
Beta Was this translation helpful? Give feedback.
All reactions