'how to change the directline secret key in a python bot on the Microsoft Botframework
I have a python chatbot (Bot framework) and I want to switch the conversation from the user and the bot to the user and a live agent using a secret key to the live agent so I connect the bot to the direct line channel on azure and I want to switch the secret key from the direct line to the live agent when the user press on the button.
Solution 1:[1]
By following the below steps you can connect a bot to the Direct Line channel:
- Add the Direct Line channel:
- Go to the Azure portal.
- Go to your Azure Bot resource. Under Bot Settings, select Channels.
- Select Direct Line from the list of Available Channels.
Your bot's now configured to use Direct Line using the Default site.
Alternatively, you can add a new site instead of using the default site. Select the New site button on the Direct Line channel page to create a new site.
- Manage secret keys:
When you add the Direct Channel, the Bot Framework generates secret keys. Your client application uses these keys to authenticate the Direct Line API requests that it issues to communicate with a bot. For more information, see Authentication.
To view an App Service Extension Key in plain text, make sure you're on the Direct Line channel page. Then select the eye icon next to the corresponding key.
Copy and securely store the key. Use the key to authenticate the Direct Line API requests that your client application issues to communicate with a bot.
The best practice is to use the Direct Line API to exchange the key for a token. The client application then will use the token to authenticate its requests within the scope of a single conversation.
- Configure settings:
To configure your site settings:
On the Direct Line channel page, select the site you want to configure from the Sites list. The Configure the site pane will open, shown below:
Select the Direct Line protocol version that your client application will use to communicate with a bot.
When finished, select Apply to save the site configuration. Repeat this process, beginning with a new site, for each client application that you want to connect to your bot.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | RajkumarMamidiChettu-MT |