RestError: Authorization has been denied for this request

Copper Contributor

I am trying to create(createConversationAsync) a conversation (dm) in microsoft teams bot framework, but I am getting this error err: RestError: Authorization has been denied for this request


I have created the bot with vscode's extension teams toolkit and I am trying to send a dm to the user when submits a task module, below is the code I am using


import { MessageFactory, TeamsInfo, TurnContext } from "botbuilder"

const BOT_APP_ID = process.env["BOT_ID"]

export async function send_dm(context: TurnContext) {

const user = await TeamsInfo.getMember(context,

const tenantId = context.activity.conversation.tenantId

const channelId = context.activity.channelId

const serviceUrl = context.activity.serviceUrl

const message = MessageFactory.text(`Hello I'm a Teams conversation bot.`)


await context.adapter.createConversationAsync(






members: [user],

bot: context.activity.recipient,

isGroup: false,


activity: context.activity,

channelData: undefined,


async (newContext) => {

await newContext.sendActivity(message)





I have created a test tenant with developer program and I am running my bot in the local with the help of team toolkit vscode extension.
I am attaching my package.json, manifest.json for reference let me know if you need something else

thanks in advance.


Screenshot 2023-06-19 at 5.35.17 PM.pngScreenshot 2023-06-19 at 5.40.14 PM.png

8 Replies
@themashcodee- Thanks for reporting your issue.
We will check this at our end and will get back to you.

@Sayali-MSFT also getting the similar error.

@themashcodee- We have tried the above scenario with the below sample to repro the issue, but it working fine from our end.
Microsoft Teams Version (64-bit)
Sample Link- Microsoft-Teams-Samples/samples/bot-conversation/nodejs/bots/teamsConversationBot.js at 5e74a4af1739...

Thanks, I will try it again and let you know if it would not work.
Hi everyone,
I'm trying to develop an echo-bot provided from you ( and I keep receiveing the same generic error "Error: Authorization has been denied for this request.". What do I need to do? Also, I've created a Azure Support Request (N° 2306210050004437) and I didn't receive any response.
@mrpsycox -Thanks for sharing the sample, we will test this from our end and let you know the update.

@mrpsycox -Could you please directly add App Id(Instead of 

process.env.MicrosoftAppId) and Password value in index.JS file like below and check it once.

Screenshot 2023-06-28 130643.png

@mrpsycox -Did you get chance to check?