AI Foundry Agent Publish to 365 and Teams as a Bot Service

RSKenzz 96 Reputation points
2025-12-02T15:50:28.07+00:00

We have an Azure AI agent in the new Foundry experience. Works all fine. Deployed it as a bot service to 365 and Teams via the Publish button and when testing it out in Teams or in the Bot web chat, I get the following -

Something went wrong, please retry. If issue persists, please use following identifiers in any support request: ConversationId = IwdimIyY03SIOXXKurZPY2-fr, activityId = IwdimIyY03SIOXXKurZPY2-fr|0000000

I have checked the messaging endpoint on the Bot service and I'm getting this -

{"error":{"code":"401","message":"Access denied due to invalid subscription key or wrong API endpoint. Make sure to provide a valid key for an active subscription and use a correct regional API endpoint for your resource."}}

Is anyone able to help please?

Azure AI Bot Service
Azure AI Bot Service

An Azure service that provides an integrated environment for bot development.


3 answers

Sort by: Most helpful
  1. Szymon Balinski 5 Reputation points
    2025-12-09T10:29:03.96+00:00

    I’m encountering exactly the same issue described in this thread.

    I have an agent built in AI Foundry, connected to a Knowledge Base. In the AI Foundry playground everything works perfectly, the agent responds as expected and retrieves information from the knowledgebase without any issues.

    The problem starts only after publishing.

    When interacting with the deployed bot, I receive the same error reported here.

    Something went wrong, please retry. If issue persists, please use following identifiers in any support request: ConversationId = 2GDclp5wMoqwzOUKl2ZT6-eu, activityId = 2GDclp5wMoqwzOUKl2ZT6-eu|0000000

    It’s not limited to the Teams or Copilot deployment either, the issue appears even earlier, when opening the bot instance in Azure and using the "Test in Web Chat" option. The bot was created using the "Publish to Teams and Microsoft 365 Copilot" wizard directly from the agent in AI Foundry.

    web-chat-problem

    I’ve also assigned all required roles, including Azure AI User for the AI Foundry project, exactly as documented.

    The suggested solution by Anshika Varshney "Removing it was a good approach" is not really a solution… considering that vector search is the whole point of RAG.

    Was this answer helpful?


  2. RSKenzz 96 Reputation points
    2025-12-03T09:52:20.6266667+00:00

    Nevermind found it, it's because I had a vector store attached to my agent. Deleting that fixed it.

    Was this answer helpful?

    0 comments No comments

  3. Anshika Varshney 15,625 Reputation points Microsoft External Staff Moderator
    2025-12-02T16:46:00.3533333+00:00

    Hi RSKenzz,

    Thank you for reaching out on the Microsoft Q&A.

    Publishing an AI Foundry agent as a bot in Microsoft 365 and Teams involves a few key steps:

    Create and configure the agent in AI Foundry Ensure your agent is fully tested in the Foundry playground and has the correct permissions for the intended use case.

    Register the bot in Azure Bot Service This gives you an App ID and secret that Teams will use for authentication.

    Enable Microsoft Teams channel In the Bot Service settings, add the Teams channel. This allows your bot to appear in Teams and interact with users.

    Connect to Microsoft 365 If your bot needs access to Microsoft 365 data (e.g., calendar, emails), configure Microsoft Graph permissions in Azure AD and grant admin consent.

    Deploy and test Package your agent logic behind the bot endpoint (via Azure Functions or App Service) and deploy. Then, test in Teams using the Bot Framework Emulator or by sideloading the app.

    Reference docs:

    Please let me know if there are any remaining questions or additional details, I can help with, I’ll be glad to provide further clarification or guidance.

    Thankyou!

    Was this answer helpful?


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.