Bot not working with MicrosoftAppId and MicrosoftAppPassword. Work on bot emulator without AppId and AppPassword.
Bot NPL-with-dispatch not working with MicrosoftAppId and MicrosoftAppPassword. Works fine with bot emulator without AppId and AppPassword.
As soon as i enter MicrosoftAppId and MicrosoftAppPassword bot stop working.
Any suggestions what is wrong?
I have used curl to verify appid and password and they are fine.
curl -k -X POST https://login.microsoftonline.com/botframework.com/oauth2/v2.0/token -d "grant_type=client_credentials&client_id=&client_secret=&scope=https%3A%2F%2Fapi.botframework.com%2F.default"
I am unable to replicate this issue.
Can you verify that MicrosoftAppId and MicrosoftAppPassword are entered in both:
- appsettings.json
- Emulator
Can you expand on "As soon as i enter MicrosoftAppId and MicrosoftAppPassword bot stop working."? What isn't working? Are there any error messages?
Is it only not working locally, or is this for a deployed bot?
Thanks for quick response.
Yes, i have verified Appid and Apppassword they are correct.
What i meant was my bot is working locally without entering AppID and AppPassword. When i enter AppID and AppPassword bot stop working. I get error POST500directline.postActivity.
Same is the case when i deploy to Azure it doesn't work.
Here is the list of packages referenced
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="Microsoft.AspNetCore.Razor.Design" Version="2.1.2" PrivateAssets="All" />
<PackageReference Include="Microsoft.Bot.Builder" Version="4.4.3" />
<PackageReference Include="Microsoft.Bot.Builder.AI.Luis" Version="4.4.3" />
<PackageReference Include="Microsoft.Bot.Builder.AI.QnA" Version="4.4.3" />
<PackageReference Include="Microsoft.Bot.Builder.Dialogs" Version="4.4.3" />
<PackageReference Include="Microsoft.Bot.Builder.Integration.AspNet.Core" Version="4.4.3" />
<PackageReference Include="Microsoft.Bot.Configuration" Version="4.4.3" />
<PackageReference Include="Microsoft.Graph" Version="1.10.0" />
<PackageReference Include="Microsoft.IdentityModel.Clients.ActiveDirectory" Version="5.0.5" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="2.1.1" />
</ItemGroup>
For the life of me, I still can't seem to replicate this. Can you copy/paste the error in Visual Studio > Output? It should show up as soon as you try to connect to the bot through Emulator.
Sometimes, it helps to fully close out of Emulator and to also right-click > Exit IIS Server after stopping the bot from running:

There can be some weird caching issues that closing out of everything can sometimes solve.
Actually, I just tried using a new AppId and AppPassword without restarting these and was finally able to replicate. It was fixed as soon as I closed out of both, though.
Additionally, rarely some AppPasswords can cause problems, especially with certain special characters. It might not hurt to try changing it.
That being said, you don't need the AppId and AppPassword to test locally. You can just leave those values blank in appsettings.json and then not enter them when opening the bot in Emulator.
@gagankohli2000 Are you still experiencing this issue?
I am closing this issue as it doesn't seem to be a blocking issue. Feel free to reopen if you have need to get this resolved.