Overriding bot telemetry value in appsettings.json with the value in App service configuration in Bot composer

Kirti Chaturvedi 111 Reputation points Microsoft Employee
2023-07-07T15:12:19.2+00:00

I am creating a bot using bot composer. I am trying to add different telemetry based on different environment.Like for dev its different app insight , for uat different and so on

In App settings this is the structure

 "telemetry": 
{       
"logActivities": true,      
 "logPersonalInformation": true,       
"options": 
	{        
		 "connectionString": ""      
    }     
}

When I am trying to create a configuration in app services for overriding the same
I am using the variable name as below screenshot.This is the variable I am creating telemetry__options__connectionString

But its not overriding, and I am not able to log in any appinsights.My all the other setting are all done correctly and it was working fine, when I hardcode the connection string in appsettings.json file. BUt its not working when I am trying to use app config to override the value.

User's image

Thanks for helping

Azure AI Bot Service
Azure AI Bot Service
An Azure service that provides an integrated environment for bot development.
886 questions
0 comments No comments
{count} votes

Accepted answer
  1. YutongTie-MSFT 53,866 Reputation points
    2023-07-08T09:49:12.0433333+00:00

    Hello @Kirti Chaturvedi

    Thanks for reaching out to us, please try below - To override the telemetry value in your appsettings.json file with a value from App Service configuration, you need to use the correct syntax for the configuration key.

    In your case, the correct configuration key for telemetry.options.connectionString would be telemetry:options:connectionString. Note that the period (.) in the JSON path is replaced with a colon (:) in the configuration key.

    Here's an example of how you can set the telemetry.options.connectionString value in App Service configuration:

    1. Go to your App Service in the Azure portal and navigate to the "Configuration" tab.
    2. Click on the "New application setting" button to add a new configuration setting.
    3. Set the "Name" field to telemetry:options:connectionString.
    4. Set the "Value" field to the connection string for your Application Insights instance.
    5. Click on the "OK" button to save the configuration setting.

    Once you have set the configuration setting, your bot should be able to read the telemetry.options.connectionString value from App Service configuration and use it for telemetry logging.

    I hope this helps! Let me know if you have any other questions or concerns, I am happy to help further.

    Regards,

    Yutong

    -Please kindly accept the answer if you feel helpful to support the community and help more people, thanks a lot!

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.