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

Missing BOT_ENDPOINT trying to provision #13303

Open
ridomin opened this issue Feb 26, 2025 · 6 comments
Open

Missing BOT_ENDPOINT trying to provision #13303

ridomin opened this issue Feb 26, 2025 · 6 comments
Assignees
Labels
needs more info Need user to provide more info TA:Auth Team Area: Auth

Comments

@ridomin
Copy link

ridomin commented Feb 26, 2025

Trying to run the Basic AI Bot template.

After creating the project, when I try to "Prepare Dependencies"

Error

Preparing Teams app dependencies failed. Check the Teams Toolkit Output window for more information.

Executing provision

Lifecycle stage: provision(8 step(s) in total). The following actions will be executed:
(1/8) Action teamsApp/create: create Teams app.
(2/8) Action aadApp/create: Create a Microsoft Entra app to authenticate users
(3/8) Action file/createOrUpdateJsonFile: Create or update JSON file.
(4/8) Action botFramework/create: creates or updates the bot registration on dev.botframework.com
(5/8) Action teamsApp/validateManifest: validate Teams app.
(6/8) Action teamsApp/zipAppPackage: build Teams app package.
(7/8) Action teamsApp/validateAppPackage: validate Teams app.
(8/8) Action teamsApp/update: update Teams app.

Executing lifecycle provision
Executing action teamsApp/create in lifecycle provision
Teams app 2f70d93f-9dde-452d-999f-8c6c44e977dc created successfully
Action teamsApp/create in lifecycle provision succeeded with output {"TEAMS_APP_ID":"XXXXXX","TEAMS_APP_TENANT_ID":"XXXXX"}
Executing action aadApp/create in lifecycle provision
Executing action aadApp/create
Environment variable BOT_ID does not exist, creating a new Microsoft Entra app...
Created Microsoft Entra application with object id XXXX
Environment variable SECRET_BOT_PASSWORD does not exist, generating client secret for Microsoft Entra app...
Generated client secret for Microsoft Entra application with object id XXXXX
Action aadApp/create executed successfully
Action aadApp/create in lifecycle provision succeeded with output {"BOT_ID":"****","BOT_OBJECT_ID":"*****","SECRET_BOT_PASSWORD":"******"}
Executing action file/createOrUpdateJsonFile in lifecycle provision
Action file/createOrUpdateJsonFile in lifecycle provision succeeded with output {}
Executing action botFramework/create in lifecycle provision
Unresolved placeholders(BOT_ENDPOINT) found for Action botFramework/create in lifecycle provision
Failed to Execute lifecycle provision because there are unresolved placeholders ["BOT_ENDPOINT"] for action: botFramework/create. Env output: {"TEAMS_APP_ID":"****","TEAMS_APP_TENANT_ID":"XXXXXX","BOT_ID":"XXXX","BOT_OBJECT_ID":"XXXX","SECRET_BOT_PASSWORD":"******"}
Execution summary:

Summary:
(×) Error: Lifecycle stage provision failed.
  (√) Done: teamsApp/create was executed successfully.
    (√) Done: Teams app 2f70d93f-9dde-452d-999f-8c6c44e977dc created successfully
  (√) Done: aadApp/create was executed successfully.
    (√) Done: Created Microsoft Entra application with object id XXX
    (√) Done: Generated client secret for Microsoft Entra application with object idXXXXX
  (√) Done: file/createOrUpdateJsonFile was executed successfully.
    (√) Done: Json file has been successfully generated to ../MyAIBot/appsettings.Development.json.
  (×) Error: botFramework/create failed.
    (×) Error: Unresolved placeholders: BOT_ENDPOINT
  (!) Warning: teamsApp/validateManifest was not executed.
  (!) Warning: teamsApp/zipAppPackage was not executed.
  (!) Warning: teamsApp/validateAppPackage was not executed.
  (!) Warning: teamsApp/update was not executed.

{
  "errorType": "UserError",
  "source": "botFrameworkCreate",
  "name": "MissingEnvironmentVariablesError",
  "message": "Missing environment variables 'BOT_ENDPOINT' for file: D:\\source\\ttk_apps\\MyAIBot\\TeamsApp\\teamsapp.local.yml. Please edit the .env file 'D:\\source\\ttk_apps\\MyAIBot\\TeamsApp\\env\\.env.local' or 'D:\\source\\ttk_apps\\MyAIBot\\TeamsApp\\env\\.env.local.user', or adjust system environment variables. For new Teams Toolkit projects, make sure you've run provision or debug to set these variables correctly.",
  "stack": "MissingEnvironmentVariablesError: Missing environment variables 'BOT_ENDPOINT' for file: D:\\source\\ttk_apps\\MyAIBot\\TeamsApp\\teamsapp.local.yml. Please edit the .env file 'D:\\source\\ttk_apps\\MyAIBot\\TeamsApp\\env\\.env.local' or 'D:\\source\\ttk_apps\\MyAIBot\\TeamsApp\\env\\.env.local.user', or adjust system environment variables. For new Teams Toolkit projects, make sure you've run provision or debug to set these variables correctly.\n    at Coordinator.convertExecuteResult (C:\\snaps...
  "innerError": null,
  "userData": null,
  "timestamp": "2025-02-26T15:14:22.796Z",
  "displayMessage": "Missing environment variables 'BOT_ENDPOINT' for file: D:\\source\\ttk_apps\\MyAIBot\\TeamsApp\\teamsapp.local.yml. Please edit the .env file 'D:\\source\\ttk_apps\\MyAIBot\\TeamsApp\\env\\.env.local' or 'D:\\source\\ttk_apps\\MyAIBot\\TeamsApp\\env\\.env.local.user', or adjust system environment variables. For new Teams Toolkit projects, make sure you've run provision or debug to set these variables correctly.",
  "helpLink": "https://aka.ms/teamsfx-v5.0-guide#environments",
  "issueLink": null
}

@microsoft-github-policy-service microsoft-github-policy-service bot added the needs attention This issue needs the attention of a contributor. label Feb 26, 2025
@ridomin
Copy link
Author

ridomin commented Feb 26, 2025

When I tried to follow the instructions in the error message, I could not find the variable BOT_ENDPOINT in .env.local. Should I update BOT_DOMAIN instead? Where should I get the value from?

Copy link

👋 Hi @ridomin,

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 the error you are encountering, it seems that the BOT_ENDPOINT environment variable is missing or not properly set in your project. This variable is crucial for the botFramework/create action during the provisioning process.

Here's a step-by-step guide to resolve the issue:

  1. Check and Set Environment Variables:

    • Open the .env file located at D:\source\ttk_apps\MyAIBot\TeamsApp\env\.env.local or D:\source\ttk_apps\MyAIBot\TeamsApp\env\.env.local.user.
    • Ensure that the BOT_ENDPOINT variable is set correctly in one of these files.
    • The BOT_ENDPOINT typically points to the URL where your bot is hosted. If you are running the bot locally, you might need to use a tunneling service like ngrok to expose your local bot to the internet.

    Example of setting BOT_ENDPOINT:

    BOT_ENDPOINT=https://your-bot-url.com/api/messages
    
  2. Using a Local Tunnel:

    • If you are running the bot locally, you can use a tunneling service like ngrok.
    • Start ngrok on the port your bot is running (e.g., port 3978).
      ngrok http 3978
    • Ngrok will provide you a forwarding URL. Use this URL as the BOT_ENDPOINT.
    • Update your .env file with the ngrok URL.
      BOT_ENDPOINT=https://<your-ngrok-subdomain>.ngrok.io/api/messages
      
  3. Update teamsapp.local.yml File:

    • Ensure that the teamsapp.local.yml file in your project refers to the correct environment variables.
    • You might need to manually set or update the BOT_ENDPOINT placeholder in this file if it still refers to an unresolved placeholder.
  4. Re-run Provision Task:

    • After setting the environment variables, re-run the "Prepare Dependencies" task again to ensure the variables are picked up correctly.
  5. References and Documentation:

If you follow these steps and correctly set the BOT_ENDPOINT, the provisioning process should complete successfully, and your bot should be created without any unresolved placeholders.

If the issue persists, please provide additional details about your setup and any other errors you encounter.


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!

@sayali-MSFT
Copy link

@ridomin , Thank you for your inquiry about your Teams app development issue!

We are checking the issue. We will get back to you shortly.

@adashen adashen added investigating TA:Infra Team Area: Infra labels Feb 27, 2025
@adashen adashen assigned xzf0587 and unassigned kuojianlu Feb 27, 2025
@adashen adashen added TA:Auth Team Area: Auth and removed TA:Infra Team Area: Infra labels Feb 27, 2025
@xzf0587
Copy link
Contributor

xzf0587 commented Feb 27, 2025

Hi @ridomin,
Thanks for reaching out.
Based on the description, the BOT_ENDPOINT will be prepared by the dev tunnel as following shows.
If the dev tunnel is created successfully, the BOT_ENDPOINT will be set in env.local file.
Image

@xzf0587 xzf0587 added needs more info Need user to provide more info and removed investigating needs attention This issue needs the attention of a contributor. labels Feb 27, 2025
@ridomin
Copy link
Author

ridomin commented Feb 27, 2025

I dont see the Dev Tunnels option. Do I need to install any additional extension/feature?

@microsoft-github-policy-service microsoft-github-policy-service bot added needs attention This issue needs the attention of a contributor. and removed needs more info Need user to provide more info labels Feb 27, 2025
@xzf0587
Copy link
Contributor

xzf0587 commented Mar 3, 2025

If there is no dev tunnels option in debug, please update the extension to update-to-date version and retry.
Image

@xzf0587 xzf0587 added needs more info Need user to provide more info and removed needs attention This issue needs the attention of a contributor. labels Mar 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs more info Need user to provide more info TA:Auth Team Area: Auth
Projects
None yet
Development

No branches or pull requests

5 participants