I am trying to change my logging url and api key for different environments. For this, I am using the Variables, in my Azure release pipeline. At the moment, I have the database connection string working well.
However, I am struggling to get the logging variables to work. Now,there is an array, and I bvelieve you reference an array as field.child.1.field (So, that would assign the 2nd array objets's field.
I have this:
"Serilog": {
"MinimumLevel": {
"Default": "Debug",
"Override": {
"Microsoft": "Warning",
"System": "Warning"
}
},
"Enrich": [ "FromLogContext", "WithMachineName", "WithProcessId", "WithThreadId" ],
"WriteTo": [
{
"Name": "Console",
"Args": {
"outputTemplate": "[{Timestamp:HH:mm:ss.fff} {Level:u3}] {Message:lj}{NewLine}{Exception}"
}
},
{
"Name": "Seq",
"Args": {
"serverUrl": "myUrl",
"apiKey": "myApiKey"
}
}
]
}
I am trying to substitute the serverUrl and apiKey.
In my pipeline lok, all I see is:
- 2021-03-15T01:24:13.1988119Z Compressed: 17363747
- 2021-03-15T01:24:13.2942311Z Applying JSON variable substitution for **/*.json
- 2021-03-15T01:24:13.3272676Z Applying JSON variable substitution for D:\a_temp\temp_web_package_8357506149\appsettings.json
- 2021-03-15T01:24:13.3275828Z Substituting value on key: ConnectionString
- 2021-03-15T01:24:13.3717239Z Applying JSON variable substitution for D:\a_temp\temp_web_package_8357506149\MyApp.WebAPI.deps.json
- 2021-03-15T01:24:13.3819830Z Applying JSON variable substitution for D:\a_temp\temp_web_package_8357506149\MyApp.WebAPI.runtimeconfig.json
- 2021-03-15T01:24:13.3822015Z JSON variable substitution applied successfully.
It does the ConnectionString one well, but doesn't do the others. What am I missing?
