Hi @Zafar Ahmed ,
Welcome to Microsoft Q&A! Thanks for posting the question.
Based on my understanding, you are trying to set the InstrumentationKey in the following method using the TelemetryConfiguration.InstrumentationKey
property. Ref: TelemetryConfiguration.InstrumentationKey Property
LoneWolf.API.AccountsPayable.Program.<>c.<CreateHostBuilder>b_1_0(HostBuilderContext hostingContext, LoggerConfiguration loggerConfiguration) in /src/LoneWolf.API.AccountsPayable/Program.cs:line 42
I would suggest using environment variable feature of dockerfile/docker compose to pass on the instrumentation key as environment variable in your PipeLine. More details are available here: Environment variable in Compose. This environment variable can then be read in your method and then assigned to the InstrumentationKey
property.
Please let me know if you have any questions.
---
Please 'Accept as answer' and ‘Upvote’ if it helped so that it can help others in the community looking for help on similar topics.