Closed
Description
Question
We are trying to integrate a A Teams Bot into our application. We are facing issues with authentication and getting errors related to the Azure AD application and service principal.
At each try
Code snippets
import { App } from '@microsoft/teams.apps';
import { DevtoolsPlugin } from '@microsoft/teams.dev';
//Guide
//https://microsoft.github.io/teams-ai/teams/m365-toolkit.html
async function start(){
const teamsApp = new App({
plugins: [new DevtoolsPlugin()],
clientId: process.env.MICROSOFT_APP_ID,
clientSecret: process.env.MICROSOFT_APP_PASSWORD,
tenantId: process.env.MICROSOFT_APP_TENANT_ID,
});
teamsApp.on("message", c=>{
c.send("Hello")
})
await teamsApp.start(process.env.TEAMS_PORT || 3000)
}
start();
What you have tried already
Attempt 1
- Created an Azure Bot Service.
- Retrieved the App ID and App Secret from the corresponding Azure AD App Registration.
- Put these credentials into our application as MICROSOFT_APP_ID, MICROSOFT_APP_PASSWORD, MICROSOFT_APP_TENANT_ID
- Created a development tunnel using ngrok to expose the bot endpoint.
- Uploaded manifest + icons into teams
When testing, we received the following error on start:
AADSTS7000229: The client application xxxxx-xx-xx-xx-xxxxxxxx is missing service principal in the tenant xxxx-xx-xxx-xxx-xxxxxx.
See instructions here: https://go.microsoft.com/fwlink/?linkid=2225119
then the app crashes
And if we create the application service principal using pwsh the message is still the same
Attempt 2
- Created an Azure Bot Service.
- Created a new App Registration under the same Azure Bot Service (with collaborator role).
- Put these credentials into our application as MICROSOFT_APP_ID, MICROSOFT_APP_PASSWORD, MICROSOFT_APP_TENANT_ID
- Created a development tunnel using ngrok to expose the bot endpoint.
- Uploaded manifest + icons into teams
When trying to send a message, we received a 401 Unauthorized error.
Metadata
Metadata
Assignees
Labels
No labels