Venkat
Venkat

Reputation: 265

Azure Web App bot not working - Authentication issues

I have created a new WebApp Bot in Azure Portal, using Microsoft AppId and Password which was provided by my organization admin, because of my permissions (I don't have Active Directory permissions to register a new application).

I created the bot successfully, but it is not working as expected. The messages are not sent from the bot. As soon as I send the message I got this error in bot output,

Error: Refresh access token failed with status code: 400 at Request._callback (D:\home\site\wwwroot\node_modules\botbuilder\lib\bots\ChatConnector.js:697:36) at Request.self.callback (D:\home\site\wwwroot\node_modules\request\request.js:185:22) at emitTwo (events.js:106:13) at Request.emit (events.js:191:7) at Request. (D:\home\site\wwwroot\node_modules\request\request.js:1161:10) at emitOne (events.js:96:13) at Request.emit (events.js:188:7) at IncomingMessage. (D:\home\site\wwwroot\node_modules\request\request.js:1083:12) at IncomingMessage.g (events.js:291:16) at emitNone (events.js:91:20)

Then I tried to troubleshoot the bot authentication, I followed the step provided in this page https://learn.microsoft.com/en-us/azure/bot-service/bot-service-troubleshoot-authentication-problems?view=azure-bot-service-3.0#step-2

Here after the POST request from curl with AppId as clientId and App password as client secret, I got the below error

{
    "error": "unauthorized_client",
    "error_description": "AADSTS700016: Application with identifier '[AppId]' was not found in the directory 'botframework.com'. This can happen if the application has not been installed by the administrator of the tenant or consented to by any user in the tenant. You may have sent your authentication request to the wrong tenant\r\nTrace ID: fb60c381-afa9-48f4-8946-155a3ab21a00\r\nCorrelation ID: 5f51355a-8e8d-471d-aeba-a286ba620362\r\nTimestamp: 2019-01-10 06:54:24Z",
    "error_codes": [700016],
    "timestamp": "2019-01-10 06:54:24Z",
    "trace_id": "fb60c381-afa9-48f4-8946-155a3ab21a00",
    "correlation_id": "5f51355a-8e8d-471d-aeba-a286ba620362"
}

From this one, I understood there is an issue with Bot's AppId and Password.

How can I fix this issue ??

Upvotes: 0

Views: 1250

Answers (1)

Sotiris Panopoulos
Sotiris Panopoulos

Reputation: 1613

It's not an issue with the credentials.

You have to change the 'BotId' to the one registered in the Azure Dashboard.

Upvotes: 0

Related Questions