Im trying to setup the appsettings.json varibale in my App service, which can add using the colon mark.
When Im trying to add the appsetting manually it works
App configuration:
But when trying to add using the bicep script it fails.
var dbConnectionString = 'test connection'
resource siteconfigWebjob 'Microsoft.Web/sites/config@2022-03-01' = {
parent: windowsAppService
name: 'appsettings'
properties: {
'ConnectionStrings:DefaultConnection': dbConnectionString
}
}
I also tried this appSetting config in the App service bicep
resource windowsAppService 'Microsoft.Web/sites@2022-03-01' = {
name: webjobAppServiceName
location: resourceGroupLocation
kind: 'app'
properties: {
serverFarmId: windowsappServicePlan.id
siteConfig: {
appSettings: [
{
name: 'AzureWebJobsStorage'
value: storageConnectionString
}
{
name: 'MaxCsvFileSizeInBytes'
value: '4194304'
}
I want to add the nested configuration to the App settings
2
Answers
I tried this method and it worked for me.
When trying to add the app setting using portal also, it is not working for me with colon mark.
Basically, the conventional way of naming an app setting name should include only letters, numbers, underscores, periods as highlighted below.
I have used below notation to name an app setting and also added nested app settings as shown below.
'ConnectionStrings_DefaultConnection': dbConnectionString
You can either add an app setting under
siteconfig
block withMicrosoft.Web/sites
resource provider or add a separate resource provider calledMicrosoft.Web/sites/config
as detailed below.Deployment succeeded: