How to connect Bot framework composer with Azure app configuration to read value from there

533 Views Asked by At

I am new to bot composer. I have gone tutorial from this link Weather tutorial to build a weather bot. Here to get the weather report, it is sending Http request to some weatherbot url.

Instead of hardcoding that url in composer itself I want to read url from azure app configuration. Similar thing will require in my project.

Is there any way to do that, if there then please help me with this.

Please let me know if question is not clear or needed any more information.

1

There are 1 best solutions below

1
On

You can either set the URL in the appsettings.json/.env or in the azure app configuration and then you can access it similar to this structure:

  • Settings:

"weatherServiceURL" : "http://weatherbot-ignite-2019.azurewebsites.net/api/getWeather?zipcode=${user.zipcode}&api_token=${dialog.weatherToken}"

"weatherApiToken": "<ACTUAL API TOKEN HERE>"

  • Dialog:

dialog.weatherToken = settings.weatherApiToken

dialog.weatherUrl = settings.weatherServiceURL