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

RSKenzz 86 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.
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Q&A Assist
    2025-12-02T15:50:40.49+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    The error message you are encountering indicates that there is an issue with the access permissions for your bot service. Specifically, the 401 error suggests that the subscription key you are using may be invalid or that the API endpoint is incorrect. Here are some steps you can take to troubleshoot this issue:

    1. Check Subscription Key: Ensure that you are using a valid subscription key for your Azure Bot Service. You can find this key in the Azure portal under your Bot Service resource.
    2. Verify API Endpoint: Make sure that the API endpoint you are using is correct and corresponds to the region where your Azure resources are deployed. Each Azure region has its own endpoint, and using the wrong one can lead to access issues.
    3. Bot Service Configuration: Double-check the configuration settings in the Azure portal for your Bot Service. Ensure that the messaging endpoint is correctly set and that it matches the endpoint defined in your bot's code.
    4. Permissions: Ensure that your bot has the necessary permissions to access the resources it needs. This may involve checking settings in Azure Active Directory if your bot is integrated with it.
    5. Testing in Teams: When testing your bot in Microsoft Teams, ensure that you are logged in with an account that has the appropriate permissions to interact with the bot.

    If the problem persists after checking these items, consider reaching out to Azure support with the provided identifiers for further assistance.


    References:

    0 comments No comments

  2. Anshika Varshney 3,795 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!


  3. RSKenzz 86 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.

    0 comments No comments

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.