OfficeDev / TeamsFx

Developer tools for building Teams apps
Other
427 stars 165 forks source link

bug report: Why doesn't the message extension of teamsBot run after deploying? #7276

Closed tuxxon closed 1 year ago

tuxxon commented 1 year ago

Describe the bug When running the message extension app locally, it works normally, By the way, When running the one after deploying by using teamsfx deploy, it cant' browse a webview for fetchTask=true

The error message is 앱에 연결할 수 없습니다. 다시 시도하세요..

please let me know what the problem is on my deploying process as follows.

To Reproduce Steps to reproduce the behavior:

  1. Running the existing message extension.
  2. $ teamsfx provision
  3. $ teamsfx deploy
  4. $ teamsfx package
  5. open teamsApp
  6. click Apps.
  7. click Manage your app.
  8. click Publish an app.
  9. click Upload a custom app.
  10. select the one among compose, commandBox, message,
  11. click the one among OpenAssessments, ClosedAssessment,

You can see the abnormal messages as the screenshot shows.

Expected behavior A clear and concise description of what you expected to happen.

Screenshots Normal screenshot on local image

Abnormal screenshot after deploying image

VS Code Extension Information (please complete the following information):

CLI Information (please complete the following information):

Additional context

manifest.xml

{
    "$schema": "https://developer.microsoft.com/en-us/json-schemas/teams/v1.14/MicrosoftTeams.schema.json",
    "manifestVersion": "1.14",
    "version": "1.0.0",
    "id": "1f76f8d4-2a6d-44d0-a298-e193e81eedc5",
    "packageName": "com.microsoft.teams.extension",
    "developer": {
        "name": "Teams App, Inc.",
        "websiteUrl": "https://www.example.com",
        "privacyUrl": "https://www.example.com/termofuse",
        "termsOfUseUrl": "https://www.example.com/privacy"
    },
    "icons": {
        "color": "resources/color.png",
        "outline": "resources/outline.png"
    },
    "name": {
        "short": "teamsaction",
        "full": "Full name for teamsaction"
    },
    "description": {
        "short": "Short description of teamsaction",
        "full": "Full description of teamsaction"
    },
    "accentColor": "#FFFFFF",
    "bots": [],
    "composeExtensions": [
        {
            "botId": "8c06e979-da18-4c89-9005-b65d79d975f5",
            "commands": [
                {
                    "id": "OpenAssessments",
                    "description": "Open Assessments",
                    "title": "Open Assessments",
                    "type": "action",
                    "fetchTask": true,
                    "context": [
                        "compose",
                        "commandBox"
                    ]
                },
                {
                    "id": "OpenAdvice",
                    "description": "Open Advice Shared with Appraisee",
                    "title": "Open Advice",
                    "type": "action",
                    "fetchTask": true,
                    "context": [
                        "message"
                    ]
                },
                {
                    "id": "ClosedAssessment",
                    "description": "Closed Assessment to Appraisee",
                    "title": "Closed Assessment",
                    "type": "action",
                    "fetchTask": true,
                    "context": [
                        "message"
                    ]
                },
                {
                    "id": "searchQuery",
                    "context": [
                        "compose",
                        "commandBox"
                    ],
                    "description": "Test command to run query",
                    "title": "Search",
                    "type": "query",
                    "parameters": [
                        {
                            "name": "searchQuery",
                            "title": "Search Query",
                            "description": "Your search query",
                            "inputType": "text"
                        }
                    ]
                }
            ],
            "messageHandlers": [
                {
                    "type": "link",
                    "value": {
                        "domains": [
                            "*.botframework.com"
                        ]
                    }
                }
            ]
        }
    ],
    "configurableTabs": [],
    "staticTabs": [],
    "permissions": [
        "identity",
        "messageTeamMembers"
    ],
    "validDomains": [
        "teamsactio35c392bot.azurewebsites.net",
        "pas.example.com"
    ]
}

teamsBot.ts

import { default as axios } from "axios";
import * as querystring from "querystring";
import {
  TeamsActivityHandler,
  CardFactory,
  TurnContext,
  AdaptiveCardInvokeValue,
  AdaptiveCardInvokeResponse,
  ConsoleTranscriptLogger,
  TeamsInfo,
  MessageFactory,
} from "botbuilder";
import rawWelcomeCard from "./adaptiveCards/welcome.json";
import rawLearnCard from "./adaptiveCards/learn.json";
import { AdaptiveCards } from "@microsoft/adaptivecards-tools";
import * as dotenv from "dotenv";

export interface DataInterface {
  likeCount: number;
}

require('dotenv').config()
const baseUrl = "https://dddd.example.com";

export class TeamsBot extends TeamsActivityHandler {
  // record the likeCount
  likeCountObj: { likeCount: number };

  constructor() {
    super();

    this.likeCountObj = { likeCount: 0 };

    this.onMessage(async (context, next) => {
      console.log("Running with Message Activity.");

      let txt = context.activity.text;
      const removedMentionText = TurnContext.removeRecipientMention(context.activity);
      if (removedMentionText) {
        // Remove the line break
        txt = removedMentionText.toLowerCase().replace(/\n|\r/g, "").trim();
      }

      // Trigger command by IM text
      switch (txt) {
        case "welcome": {
          const card = AdaptiveCards.declareWithoutData(rawWelcomeCard).render();
          await context.sendActivity({ attachments: [CardFactory.adaptiveCard(card)] });
          break;
        }
        case "learn": {
          this.likeCountObj.likeCount = 0;
          const card = AdaptiveCards.declare<DataInterface>(rawLearnCard).render(this.likeCountObj);
          await context.sendActivity({ attachments: [CardFactory.adaptiveCard(card)] });
          break;
        }
        /**
         * case "yourCommand": {
         *   await context.sendActivity(`Add your response here!`);
         *   break;
         * }
         */
      }

      // By calling next() you ensure that the next BotHandler is run.
      await next();
    });

    this.onMembersAdded(async (context, next) => {
      const membersAdded = context.activity.membersAdded;
      for (let cnt = 0; cnt < membersAdded.length; cnt++) {
        if (membersAdded[cnt].id) {
          const card = AdaptiveCards.declareWithoutData(rawWelcomeCard).render();
          await context.sendActivity({ attachments: [CardFactory.adaptiveCard(card)] });
          break;
        }
      }
      await next();
    });
  }

  // Invoked when an action is taken on an Adaptive Card. The Adaptive Card sends an event to the Bot and this
  // method handles that event.
  async onAdaptiveCardInvoke(
    context: TurnContext,
    invokeValue: AdaptiveCardInvokeValue
  ): Promise<AdaptiveCardInvokeResponse> {
    // The verb "userlike" is sent from the Adaptive Card defined in adaptiveCards/learn.json
    if (invokeValue.action.verb === "userlike") {
      this.likeCountObj.likeCount++;
      const card = AdaptiveCards.declare<DataInterface>(rawLearnCard).render(this.likeCountObj);
      await context.updateActivity({
        type: "message",
        id: context.activity.replyToId,
        attachments: [CardFactory.adaptiveCard(card)],
      });
      return { statusCode: 200, type: undefined, value: undefined };
    }
  }

  // Message extension Code
  // Action.
  public async handleTeamsMessagingExtensionSubmitAction(
    context: TurnContext,
    action: any
  ): Promise<any> {
    switch (action.commandId) {
      // case "createCard":
      //   return createCardCommand(context, action);
      // case "shareMessage":
      //  return shareMessageCommand(context, action);
      case "openAssessments":
        return await openAdivceCommand(context, action);
      case "openAdivce":
        return await openAdivceCommand(context, action);
      case "closedAssessment":
        return await closedAssessmentCommand(context, action);

      // case 'webView':
      //     return await webViewResponse(action);
      default:
        throw new Error("NotImplemented");
    }
  }

  public async handleTeamsMessagingExtensionFetchTask(
    context: TurnContext,
    action: any
  ): Promise<any> {
    switch (action.commandId) {
    case 'OpenAssessments':
        return openAssessments(context, action);
    case 'OpenAdvice':
        return openAdvice(context, action);
    case 'ClosedAssessment':
        return closedAssessment(context, action);
    default:
        try {
            const member = await getSingleMember(context);
            return {
                task: {
                    type: 'continue',
                    value: {
                        card: GetAdaptiveCardAttachment(),
                        height: 400,
                        title: `Hello ${ member }`,
                        width: 300
                    }
                }
            };
        } catch (e) {
            if (e.code === 'BotNotInConversationRoster') {
                return {
                    task: {
                        type: 'continue',
                        value: {
                            card: GetJustInTimeCardAttachment(),
                            height: 400,
                            title: 'Adaptive Card - App Installation',
                            width: 300
                        }
                    }
                };
            }
            throw e;
        }
    }
  }

  // Search.
  public async handleTeamsMessagingExtensionQuery(context: TurnContext, query: any): Promise<any> {
    const searchQuery = query.parameters[0].value;
    const response = await axios.get(
      `http://registry.npmjs.com/-/v1/search?${querystring.stringify({
        text: searchQuery,
        size: 8,
      })}`
    );

    const attachments = [];
    response.data.objects.forEach((obj) => {
      const heroCard = CardFactory.heroCard(obj.package.name);
      const preview = CardFactory.heroCard(obj.package.name);
      preview.content.tap = {
        type: "invoke",
        value: { name: obj.package.name, description: obj.package.description },
      };
      const attachment = { ...heroCard, preview };
      attachments.push(attachment);
    });

    return {
      composeExtension: {
        type: "result",
        attachmentLayout: "list",
        attachments: attachments,
      },
    };
  }

  public async handleTeamsMessagingExtensionSelectItem(
    context: TurnContext,
    obj: any
  ): Promise<any> {
    return {
      composeExtension: {
        type: "result",
        attachmentLayout: "list",
        attachments: [CardFactory.heroCard(obj.name, obj.description)],
      },
    };
  }

  // Link Unfurling.
  public async handleTeamsAppBasedLinkQuery(context: TurnContext, query: any): Promise<any> {
    const attachment = CardFactory.thumbnailCard("Image Preview Card", query.url, [query.url]);

    const result = {
      attachmentLayout: "list",
      type: "result",
      attachments: [attachment],
    };

    const response = {
      composeExtension: result,
    };
    return response;
  }
}

async function createCardCommand(context: TurnContext, action: any): Promise<any> {
  // The user has chosen to create a card by choosing the 'Create Card' context menu command.
  const data = action.data;
  const heroCard = CardFactory.heroCard(data.title, data.text);
  heroCard.content.subtitle = data.subTitle;
  const attachment = {
    contentType: heroCard.contentType,
    content: heroCard.content,
    preview: heroCard,
  };

  return {
    composeExtension: {
      type: "result",
      attachmentLayout: "list",
      attachments: [attachment],
    },
  };
}

async function openAdivceCommand(context: TurnContext, action: any) {
  /**
   *  The user has chosen to create a card by choosing the 'appraiseMessage' 
   *   from message menu command.
   * 
   */
  const data = action.data;

  console.log(`[DEBUG] data = ${JSON.stringify(data)} `);

  const heroCard = CardFactory.heroCard(data.title, data.text);
  heroCard.content.subtitle = data.subTitle;
  const attachment = {
    contentType: heroCard.contentType,
    content: heroCard.content,
    preview: heroCard,
  };

  return {
    composeExtension: {
      type: "result",
      attachmentLayout: "list",
      attachments: [attachment],
    },
  };
}

async function closedAssessmentCommand(context: TurnContext, action: any) {
  /**
   *  The user has chosen to create a card by choosing the 'appraiseMessage' 
   *   from message menu command.
   * 
   */
  const data = action.data;

  console.log(`[DEBUG] data = ${JSON.stringify(data)} `);

  const heroCard = CardFactory.heroCard(data.title, data.text);
  heroCard.content.subtitle = data.subTitle;
  const attachment = {
    contentType: heroCard.contentType,
    content: heroCard.content,
    preview: heroCard,
  };

  return;
  // return {
  //   composeExtension: {
  //     type: "result",
  //     attachmentLayout: "list",
  //     attachments: [attachment],
  //   },
  // };
}

async function shareMessageCommand(context: TurnContext, action: any): Promise<any> {
  // The user has chosen to share a message by choosing the 'Share Message' context menu command.
  let userName = "unknown";
  if (
    action.messagePayload &&
    action.messagePayload.from &&
    action.messagePayload.from.user &&
    action.messagePayload.from.user.displayName
  ) {
    userName = action.messagePayload.from.user.displayName;
  }

  // This Message Extension example allows the user to check a box to include an image with the
  // shared message.  This demonstrates sending custom parameters along with the message payload.
  let images = [];
  const includeImage = action.data.includeImage;
  if (includeImage === "true") {
    images = [
      "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQtB3AwMUeNoq4gUBGe6Ocj8kyh3bXa9ZbV7u1fVKQoyKFHdkqU",
    ];
  }
  const heroCard = CardFactory.heroCard(
    `${userName} originally sent this message:`,
    action.messagePayload.body.content,
    images
  );

  if (
    action.messagePayload &&
    action.messagePayload.attachment &&
    action.messagePayload.attachments.length > 0
  ) {
    // This sample does not add the MessagePayload Attachments.  This is left as an
    // exercise for the user.
    heroCard.content.subtitle = `(${action.messagePayload.attachments.length} Attachments not included)`;
  }

  const attachment = {
    contentType: heroCard.contentType,
    content: heroCard.content,
    preview: heroCard,
  };

  return {
    composeExtension: {
      type: "result",
      attachmentLayout: "list",
      attachments: [attachment],
    },
  };
}

function GetAdaptiveCardAttachment() {
  return CardFactory.adaptiveCard({
      actions: [{ type: 'Action.Submit', title: 'Close' }],
      body: [
          {
              text: 'This app is installed in this conversation. You can now use it to do some great stuff!!!',
              type: 'TextBlock',
              isSubtle: false,
              wrap: true
          }
      ],
      type: 'AdaptiveCard',
      version: '1.0'
  });
}

function GetJustInTimeCardAttachment() {
  return CardFactory.adaptiveCard({
      actions: [
          {
              type: 'Action.Submit',
              title: 'Continue',
              data: { msteams: { justInTimeInstall: true } }
          }
      ],
      body: [
          {
              text: 'Looks like you have not used Action Messaging Extension app in this team/chat. Please click **Continue** to add this app.',
              type: 'TextBlock',
              wrap: true
          }
      ],
      type: 'AdaptiveCard',
      version: '1.0'
  });
}

async function getSingleMember(context) {
  try {
      const member = await TeamsInfo.getMember(
          context,
          context.activity.from.id
      );
      return member.name;
  } catch (e) {
      if (e.code === 'MemberNotFoundInConversation') {
          context.sendActivity(MessageFactory.text('Member not found.'));
          return e.code;
      }
      throw e;
  }
}

async function webViewResponse(action) {
  // The user has chosen to create a card by choosing the 'Create Card' context menu command.
  const data = await action.data;
  const heroCard = CardFactory.heroCard(`ID: ${ data.EmpId }`, `E-Mail: ${ data.EmpEmail }`);
  heroCard.content.subtitle = `Name: ${ data.EmpName }`;
  const attachment = { contentType: heroCard.contentType, content: heroCard.content, preview: heroCard };
  return {
      composeExtension: {
          type: 'result',
          attachmentLayout: 'list',
          attachments: [
              attachment
          ]
      }
  };
}

function openAssessments(context, action) {

  console.log(`[DEBUG] openAssessments> action = ${JSON.stringify(action)}`);
  console.log(`[DEBUG] openAssessments> context = ${JSON.stringify(context)}`);

  const paramGraphId = `?graphId=${context._activity.from.aadObjectId}`;
  const paramTeamsChecked = '&teamschecked=true';  
  const pluginUrl = `${baseUrl}/plugin/teams${paramGraphId}${paramTeamsChecked}`;
    console.log(pluginUrl);

  const task = 
    {
        task: {
            type: 'continue',
            value: {
                width: 600,
                height: 900,
                title: 'Open Assessments',
                url: pluginUrl
            }
        }
    };

    console.log(`task = ${JSON.stringify(task)}`);

    return task;
}

function openAdvice(context, action) {

  console.log(`[DEBUG] openAdvice> action = ${JSON.stringify(action)}`);
  console.log(`[DEBUG] openAdvice> context = ${JSON.stringify(context)}`);

  const paramGraphId = `?graphId=${context._activity.from.aadObjectId}`;
  const paramTeamsChecked = '&teamschecked=true';
  const pluginUrl = `${baseUrl}/plugin/teams/open${paramGraphId}${paramTeamsChecked}`;
    console.log(pluginUrl);

  const task = 
    {
        task: {
            type: 'continue',
            value: {
                width: 640,
                height: 900,
                title: 'Open Advice',
                url: pluginUrl
            }
        }
    };

    console.log(`task = ${JSON.stringify(task)}`);

    return task;
}

function closedAssessment(context, action) {

  console.log(`[DEBUG] closedAssessment> action = ${JSON.stringify(action)}`);
  console.log(`[DEBUG] closedAssessment> context = ${JSON.stringify(context)}`);

  const paramGraphId = `?graphId=${context._activity.from.aadObjectId}`;
  const paramTeamsChecked = '&teamschecked=true';
  const pluginUrl = `${baseUrl}/plugin/teams/close${paramGraphId}${paramTeamsChecked}`;
    console.log(pluginUrl);

    return {
        task: {
            type: 'continue',
            value: {
                width: 640,
                height: 900,
                title: 'Closed Assessment',
                url: pluginUrl
            }
        }
    };
}
ghost commented 1 year ago

Thank you for contacting us! Any issue or feedback from you is quite important to us. We will do our best to fully respond to your issue as soon as possible. Sometimes additional investigations may be needed, we will usually get back to you within 2 days by adding comments to this issue. Please stay tuned.

yukun-dong commented 1 year ago

Hi @tuxxon , thanks for reporting this issue. There are many reasons for causing this "Unable to reach app. Please try again", so I need more info to identify your problem. I saw from your provided manifest and source code that you kept the "searchQuery" command from the template. Can you please try this command on your deploy and see if it works? Through this test I can know whether part of your commands work or all command don't work.

To test this, you can @ your deployed message extension and search "test" from the Teams top search bar. If it works, you should see the following items: image

tuxxon commented 1 year ago

Hi @yukun-dong

1. image 2. image

  1. image

  2. image

I have got the same error message - "Unable to reach app. Please try again" = "앱에 연결할 수 없습니다. 다시 시도하세요."

yukun-dong commented 1 year ago

Hi @tuxxon. I have tried your manifest, code and your steps on my machine and I didn't see this error. So I think your deploy process is OK. Did you customise some config before provision and deploy?

From your reply, it seems your message extension has trouble connecting to your app service. You can use below methods to do some troubleshoot:

  1. Go to portal.azure.com and go to your provisioned Bot Service. Click "Channels" and see if there are error messages in the Microsoft Teams Channel.
  2. Go to your provisioned App Service. Follow this guide to see if there are some error messages.

Please let me know if you find any insights.

tuxxon commented 1 year ago

Your Question: Did you customise some config before provision and deploy?

I think I didn't. but, Just in case I will create another project again and will try this again.

  1. I couldn't see any error messages from Bot Service => Channels => Microsoft Teams Channel.
  2. I am checking out your comment according to your comment.

I will be back soon. :-)

tuxxon commented 1 year ago

Hello @yukun-dong

After creating a new sample as follows:

  1. In VSC, click Teams Toolkit,
  2. select DEVLOPMENT and click Create a new Teams App

and created a new app without any chagnes. and I did my steps that I commented above. and I've got the success only once.

But, after that, The message - "Unable to reach app. Please try again" is shown again.

I've got the error messages from azure log steams by the guide as follows:

<html xmlns="http://www.w3.org/1999/xhtml"><head><title>IIS Detailed Error - 404.0 - Not Found</title><style type="text/css"><!--body{margin:0;font-size:.7em;font-family:Verdana,Arial,Helvetica,sans-serif;}code{margin:0;color:#006600;font-size:1.1em;font-weight:bold;}.config_source code{font-size:.8em;color:#000000;}pre{margin:0;font-size:1.4em;word-wrap:break-word;}ul,ol{margin:10px 0 10px 5px;}ul.first,ol.first{margin-top:5px;}fieldset{padding:0 15px 10px 15px;word-break:break-all;}.summary-container fieldset{padding-bottom:5px;margin-top:4px;}legend.no-expand-all{padding:2px 15px 4px 10px;margin:0 0 0 -12px;}legend{color:#333333;;margin:4px 0 8px -12px;_margin-top:0px;font-weight:bold;font-size:1em;}a:link,a:visited{color:#007EFF;font-weight:bold;}a:hover{text-decoration:none;}h1{font-size:2.4em;margin:0;color:#FFF;}h2{font-size:1.7em;margin:0;color:#CC0000;}h3{font-size:1.4em;margin:10px 0 0 0;color:#CC0000;}h4{font-size:1.2em;margin:10px 0 5px 0;}#header{width:96%;margin:0 0 0 0;padding:6px 2% 6px 2%;font-family:"trebuchet MS",Verdana,sans-serif;color:#FFF;background-color:#5C87B2;}#content{margin:0 0 0 2%;position:relative;}.summary-container,.content-container{background:#FFF;width:96%;margin-top:8px;padding:10px;position:relative;}.content-container p{margin:0 0 10px 0;}#details-left{width:35%;float:left;margin-right:2%;}#details-right{width:63%;float:left;overflow:hidden;}#server_version{width:96%;_height:1px;min-height:1px;margin:0 0 5px 0;padding:11px 2% 8px 2%;color:#FFFFFF;background-color:#5A7FA5;border-bottom:1px solid #C1CFDD;border-top:1px solid #4A6C8E;font-weight:normal;font-size:1em;color:#FFF;text-align:right;}#server_version p{margin:5px 0;}table{margin:4px 0 4px 0;width:100%;border:none;}td,th{vertical-align:top;padding:3px 0;text-align:left;font-weight:normal;border:none;}th{width:30%;text-align:right;padding-right:2%;font-weight:bold;}thead th{background-color:#ebebeb;width:25%;}#details-right th{width:20%;}table tr.alt td,table tr.alt th{}.highlight-code{color:#CC0000;font-weight:bold;font-style:italic;}.clear{clear:both;}.preferred{padding:0 5px 2px 5px;font-weight:normal;background:#006633;color:#FFF;font-size:.8em;}--></style>
</head><body><div id="content"><div class="content-container"><h3>HTTP Error 404.0 - Not Found</h3><h4>The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.</h4></div><div class="content-container"><fieldset><h4>Most likely causes:</h4><ul>  <li>The directory or file specified does not exist on the Web server.</li>  <li>The URL contains a typographical error.</li>    <li>A custom filter or module, such as URLScan, restricts access to the file.</li> </ul></fieldset></div><div class="content-container"><fieldset><h4>Things you can try:</h4><ul>  <li>Create the content on the Web server.</li>  <li>Review the browser URL.</li>    <li>Create a tracing rule to track failed requests for this HTTP status code and see which module is calling SetStatus. For more information about creating a tracing rule for failed requests, click <a href="http://go.microsoft.com/fwlink/?LinkID=66439">here</a>. </li> </ul></fieldset></div>
<div class="content-container"><fieldset><h4>Detailed Error Information:</h4><div id="details-left"><table border="0" cellpadding="0" cellspacing="0"><tr class="alt"><th>Module</th><td>&nbsp;&nbsp;&nbsp;IIS Web Core</td></tr><tr><th>Notification</th><td>&nbsp;&nbsp;&nbsp;MapRequestHandler</td></tr><tr class="alt"><th>Handler</th><td>&nbsp;&nbsp;&nbsp;StaticFile</td></tr><tr><th>Error Code</th><td>&nbsp;&nbsp;&nbsp;0x80070002</td></tr>
</table></div><div id="details-right"><table border="0" cellpadding="0" cellspacing="0"><tr class="alt"><th>Requested URL</th><td>&nbsp;&nbsp;&nbsp;https://pas9179cbbot:80/api/messages</td></tr><tr><th>Physical Path</th><td>&nbsp;&nbsp;&nbsp;C:\home\site\wwwroot\api\messages</td></tr><tr class="alt"><th>Logon Method</th><td>&nbsp;&nbsp;&nbsp;Anonymous</td></tr><tr><th>Logon User</th><td>&nbsp;&nbsp;&nbsp;Anonymous</td></tr>
</table><div class="clear"></div></div></fieldset></div>
<div class="content-container"><fieldset><h4>More Information:</h4>This error means that the file or directory does not exist on the server. Create the file or directory and try the request again.<p><a href="http://go.microsoft.com/fwlink/?LinkID=62293&amp;IIS70Error=404,0,0x80070002,14393">View more information &raquo;</a></p><p>Microsoft Knowledge Base Articles:</p>
</fieldset></div></div></body></html>

image

Please let me know how to fix this problem.

yukun-dong commented 1 year ago

@tuxxon Can you help provide the following info?

  1. Go to your App Service, Configuration, and paste a screenshot of your keys and values (for PII you can just hide them).
  2. Go to you App Service's SCM site. For example if your App Service url is "https://abcde.azurewebsites.net", then your SCM url is "https://abcde.scm.azurewebsites.net".

Click "Debug Console" -> "CMD" image

Go to "site/deployments", there should be a folder with very long string name. For example: image

Go to it and paste a screenshot of the "log.log". If there are multiple folders, just provide the lastest one.

tuxxon commented 1 year ago

@yukun-dong

  1. screen-shot image

  2. url = https://pas9179cbbot.azurewebsites.net image

As you see, there is no folder having a long string.

I will remove this bot after fixing the issue.

yukun-dong commented 1 year ago

@tuxxon For 1, the config is OK. For 2, did you actually do the deploy? If you deployed before there should have such files, no matter succeed or fail. To double check, you can go to "Deployment Center" "Logs", see if there is any logs. If yes, click the log and you can see some deployment details. image

Also go to "Console", type in "dir" under "wwwroot" and see if your files are actually uploaded to App Service. image

If you cannot see the deployment log and doesn't see you file uploaded. I suggest you to do the deploy again. Make sure you select the right subscription.

tuxxon commented 1 year ago

@yukun-dong I did the command below

$ teamsfx deploy

if this command is right, I deployed this bot app.

Anyway, According to your comment, I will try this again. be back soon.

tuxxon commented 1 year ago

I've got a new error after removing this bot app and creating a new sample.

Refer to https://github.com/OfficeDev/TeamsFx/issues/7322

tuxxon commented 1 year ago

@yukun-dong

tuxxon commented 1 year ago

@yukun-dong

~I've got the error message - Unable to reach app. Please try again.~

tuxxon commented 1 year ago

~### scm log~

tuxxon commented 1 year ago

I've got the issue point