Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creating a new bot with BOT PASSWORD not adding the bot password and get page 'NOT FOUND' error. #13076

Open
mrsci99 opened this issue Jan 20, 2025 · 11 comments
Assignees
Labels

Comments

@mrsci99
Copy link

mrsci99 commented Jan 20, 2025

Started in Teams Tools with the Create New App Basic Bot. This provisioned and deployed correctly and ran in Teams.

I then tried to switch the bot to multi tenant. I changed the teamsapp.yml to that shown below with a step using botAadApp/create.

This however doesn't create a password for the bot and when I click on the link 'Manage Password' next to the App Id in the Bot configuration page I get a page : Not Found.

Please explain/resolve.


see comment below for code


To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

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

Screenshots
If applicable, add screenshots to help explain your problem.

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

  • OS: Windows
  • Version 11

CLI Information (please complete the following information):

  • OS: [e.g. iOS8.1]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

@microsoft-github-policy-service microsoft-github-policy-service bot added the needs attention This issue needs the attention of a contributor. label Jan 20, 2025
Copy link

👋 Hi @mrsci99,

Thank you for reporting this issue! We want to let you know that:

⏱️ Our team will personally review your issue
🎯 You can expect a response within 2 business days

✨ This is an AI-generated initial response
🤖 AI-Generated Preliminary Analysis:

Based on your issue description, it seems you are encountering problems with the creation of a bot password when switching your bot to a multi-tenant configuration. This leads to a "Page Not Found" error when attempting to manage the password in the Bot configuration page.

Here are some steps and considerations to resolve this issue:

Steps to Resolve

  1. Ensure Proper Configuration in Yaml File:
    Make sure your teamsapp.yml is properly configured. Your current configuration seems correct, but let's double-check it. The botAadApp/create step should indeed create and save the bot password to the environment file:

    - uses: botAadApp/create
      with:
        name: BOT3${{APP_NAME_SUFFIX}}
      writeToEnvironmentFile:
        botId: BOT_ID
        botPassword: SECRET_BOT_PASSWORD
  2. Check for Sufficient Permissions:
    Ensure that the account you are using to perform these operations has sufficient permissions to create and manage Azure AD applications. Insufficient privileges can sometimes prevent the creation of application secrets.

    • Verify Privileges: Try manually creating an Azure AD application and adding a client secret via the Azure portal to ensure your account has the necessary permissions.
  3. Retry Operation:
    Sometimes, these issues can be transient. Retry the operation after waiting for a few minutes to see if the problem persists.

  4. Manual Creation of Bot Password:
    If the automatic creation of the bot password is failing, you can manually create a bot password in the Azure portal:

    • Navigate to Azure Active Directory > App registrations.
    • Find and select your bot application.
    • Go to Certificates & secrets.
    • Under Client secrets, click on New client secret.
    • Provide a description and expiration period, then click Add.
    • Copy the secret value and manually update your environment file with the new SECRET_BOT_PASSWORD.
  5. Review the Bot Configuration in Azure Portal:
    When you encounter the "Page Not Found" error, it might indicate a misconfiguration or an issue with the Azure AD app. Verify the following:

    • The Azure AD app exists and is correctly linked to your bot.
    • The app ID matches the BOT_ID in your environment file.
  6. Using Existing Microsoft Entra App:
    If you are using an existing Microsoft Entra app, ensure it is set up correctly as a multi-tenant app. Follow the guide for using an existing Microsoft Entra app in a TeamsFX project: Using Existing Microsoft Entra App in TeamsFX Project.

Additional Resources

ErrorCode

  • Common ErrorCode: Authorization_RequestDenied
    This error often indicates insufficient permissions. Ensure your account has the correct roles and permissions assigned.

By following these steps and ensuring your configuration is correct, you should be able to resolve the issue with creating and managing the bot password. If the issue persists, providing additional error logs or specific error messages can help in diagnosing the problem further.


Note: This is an automated first response generated by AI. A human team member will review your issue and provide a more detailed response soon. We appreciate your patience!

@mrsci99
Copy link
Author

mrsci99 commented Jan 20, 2025

I am able to manually create an app registation with password in Azure

@mrsci99
Copy link
Author

mrsci99 commented Jan 20, 2025


# yaml-language-server: $schema=https://aka.ms/teams-toolkit/1.0.0/yaml.schema.json
# Visit https://aka.ms/teamsfx-v5.0-guide for details on this file
# Visit https://aka.ms/teamsfx-actions for details on actions
version: 1.0.0
environmentFolderPath: ./env

# Triggered when 'teamsapp provision' is executed
provision:
  # Automates the creation of a Teams app registration and saves the App ID to an environment file.
  - uses: teamsApp/create
    with:
      # Teams app name
      name: BOT3${{APP_NAME_SUFFIX}}
    # Write the information of created resources into environment file for
    # the specified environment variable(s).
    writeToEnvironmentFile:
      teamsAppId: TEAMS_APP_ID
  # Automates the creation an Azure AD app registration which is required for a bot.
  # The Bot ID (AAD app client ID) and Bot Password (AAD app client secret) are saved to an environment file.
  - uses: botAadApp/create
    with:
      name: BOT3${{APP_NAME_SUFFIX}}
    writeToEnvironmentFile:
      botId: BOT_ID
      botPassword: SECRET_BOT_PASSWORD

  # Create or update the bot registration on dev.botframework.com
  #- uses: botFramework/create
  #  with:
  #    botId: ${{BOT_ID}}
  #    name: BOT3
  #    messagingEndpoint: ${{BOT_ENDPOINT}}${{BOT_APP_PATH}}/api/messages
  #    description: ""
  #    channels:
  #      - name: msteams

@Prasad-MSFT
Copy link

Hi @mrsci99, thank you for reaching out! To assist you better, could you please provide more details or clarify the issue you are experiencing?

  • Reproduction Steps: A detailed description of the steps you took to encounter the issue.
  • Documentation Reference: Any specific documentation or guide you were following when you encountered this issue.

@mrsci99
Copy link
Author

mrsci99 commented Jan 20, 2025

Reproduction Steps

Started in Teams Tools with the Create New App Basic Bot. This provisioned and deployed correctly and ran in Teams.

I then tried to switch the bot to multi tenant. I changed the teamsapp.yml to that shown about with a step using botAadApp/create.

This however doesn't create a password for the bot and when I click on the link 'Manage Password' next to the App Id in the Bot configuration page I get a page : Not Found.

Documentation Reference

I Used the Create New App function in Teams Tools VS Code to create a Basic Bot, then tried to switch it to multi tenant with a client secret as shown above

@mrsci99
Copy link
Author

mrsci99 commented Jan 20, 2025

Is there a guide I could follow for switching to multi tenant with a password?

@adashen adashen added investigating TA:Auth Team Area: Auth labels Jan 20, 2025
@blackchoey blackchoey removed the needs attention This issue needs the attention of a contributor. label Jan 21, 2025
@blackchoey
Copy link
Contributor

@mrsci99 can you show the error message you get from botAadApp/create? Usually if you specified the BOT_ID in .env.local file but doesn't specify a SECRET_BOT_PASSWORD in .env.local.user file, you will get an error message telling you bot password is empty. If this is what you met, you can manually fill the SECRET_BOT_PASSWORD with the secret you created on Azure Portal.

By the way, can you also share your scenario about "switching to multi tenantand why you want to usebotAadApp/create? The aadApp/create` action in the template should already creating a multi tenant app for the bot. We would like to better understand your scenarios.

@mrsci99
Copy link
Author

mrsci99 commented Jan 21, 2025

I don't get an error message. It creates the bot but the password isn't setup. It adds a SECRET_BOT_PASSWORD to the .env.local.user file with the encrypted value.

I was using teamsApp/create then botAadApp/create. I was thinking this would create the bot with a TEAM APP and add Password. Following your response I've tried to use aadApp/create today, but this also doesn't setup the password correctly linked to the Bot.

@microsoft-github-policy-service microsoft-github-policy-service bot added the needs attention This issue needs the attention of a contributor. label Jan 21, 2025
@blackchoey
Copy link
Contributor

What do you mean by the password isn't setup? As long as you see a SECRET_BOT_PASSWORD to the .env.local.user file with the encrypted value, the client secret should be created for the AAD app.

@blackchoey blackchoey removed the needs attention This issue needs the attention of a contributor. label Jan 22, 2025
@mrsci99
Copy link
Author

mrsci99 commented Jan 22, 2025

As I said further up the thread ' when I click on the link 'Manage Password' next to the App Id in the Bot configuration page I get a page : Not Found.'

@microsoft-github-policy-service microsoft-github-policy-service bot added the needs attention This issue needs the attention of a contributor. label Jan 22, 2025
@blackchoey blackchoey removed the needs attention This issue needs the attention of a contributor. label Jan 23, 2025
@blackchoey
Copy link
Contributor

For the invalid Manage Password link, you may create an Azure ticket for help. From what you described, the AAD app and secret should already been created. You could go to https://ms.portal.azure.com/#view/Microsoft_AAD_RegisteredApps/ApplicationsListBlade to find your app and check the existence of client secret.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants