How to convert appsettings.json to (bicep) parameters.json file for logging? #10404
-
I'm deploying a webapp & appconfig using bicep file and bicep parameters.json file. I want to specify "trace" level for all the logging providers in the sample appsettings.json file here: https://learn.microsoft.com/en-us/aspnet/core/fundamentals/logging/?view=aspnetcore-7.0#configure-logging Here is a fragment of my parameters.json file . { Here is a fragment from my bicep file:
This is working! yahoo! I'm not clear on how to enhance my parameters.json file and my bicep file to include the log settings since the nesting of logging objects gets kinda deep as exemplfied in this appsettings.json file:
Can someone point me to an example I could follow? Please also include the nested for loop in the bicep file that would stuff this into an azure AppConfig so that the C# Visual Studio code for a Web App would automagically grab it after having specified the connection string to the AppConfig. Also, it seems like there should be a nice little tool to convert the appsettings.json file to the parameters.json file. Maybe this is a job for emacs/elisp? Hopefully there is a better way! I wonder if there is an VSCode or Visual Studio extension? This appsettings.json file could be tedious with out a tool:
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
Add your logging as a settings object notation to an app config object. Assuming dotnet, it would look something like this: resource appSettings 'Microsoft.Web/sites/config@2021-02-01' = {
name: '${appName}/appsettings'
properties: {
// 'APPINSIGHTS_INSTRUMENTATIONKEY': instrumentationKey
// 'ApplicationInsights:InstrumentationKey': instrumentationKey
'Logging:ApplicationInsights:Enabled': 'true'
'Logging:ApplicationInsights:LogLevel': 'Information'
'Logging:LogLevel:Default' : 'Error'
'Logging.LogLevel:Microsoft' : 'Warning'
}
} |
Beta Was this translation helpful? Give feedback.
Add your logging as a settings object notation to an app config object. Assuming dotnet, it would look something like this: