Grounding with bing in Azure AI agents has constant authentication issues

Christian Schmitt 10 Reputation points
2025-06-17T11:59:46.5433333+00:00

We have setup a "Grounding with Bing search" resource in azure and connected it to an Agent in Azure AI Foundry like described here:
https://learn.microsoft.com/en-us/azure/ai-foundry/agents/how-to/tools/bing-code-samples?pivots=portal
The authentication has been setup using an API Key of the Bing resource.

Unfortunately this does not work reliably. Only about 6 of 10 requests are successful. For the remaining one getting the following error.

{

role: "assistant"

content: "tool_user_error: Error: bing_search_user_error; [bing_search] Failed to call Get Custom Search Instance with status 401: { "statusCode": 401, "message": "Unauthorized. Invalid or expired token." } RunId: <redacted>"

}

P.S. I could not find a way to open a ticket in Azure Support portal for this. I wonder if "Grounding with Bing search" is not a supported service?! I mean we have been told, that the Bing APIs will be shutdown in August 2025 and that "Grounding with Bing search" is the replacement for it...

Bing | Bing Search APIs | Bing Web Search API
{count} vote

2 answers

Sort by: Most helpful
  1. Deepanshu katara 17,960 Reputation points MVP Moderator
    2025-06-17T12:29:46.79+00:00

    Hello Christian, Welcome to MS Q&A

    1. The "Grounding with Bing Search" tool in Azure AI Foundry is currently in public preview, as outlined in the official Microsoft documentation.
    2. Since it is a preview feature, it may not offer full SLA guarantees and could exhibit intermittent reliability issues, which may explain the 401 Unauthorized errors you're encountering.
    3. The error indicating an "Invalid or expired token" typically points to issues with the API key—such as expiration, rotation, or incorrect configuration. Please verify that your key is active, valid, and properly set up in your agent.
    4. If the issue persists, you can submit feedback directly through the “Feedback” button available at the bottom of the documentation page. Note that preview features often do not support standard Azure Support ticketing.
    5. With the Bing Search APIs scheduled for deprecation in August 2025, "Grounding with Bing Search" is intended as their successor. However, given its preview status, it may not be suitable for production workloads at this time.
    6. For additional information and troubleshooting, refer to:

    Pleas let me know if further ques

    Kindly accept answer if it helps

    Thanks
    Deepanshu

    1 person found this answer helpful.
    0 comments No comments

  2. Saideep Anchuri 9,530 Reputation points Moderator
    2025-06-23T01:08:49.7633333+00:00

    Hi Christian Schmitt

    According to the documentation, "Grounding with Bing Search" is not explicitly marked as a preview feature, while "Grounding with Bing Custom Search" is. This could lead to some confusion regarding support and restrictions for ticket creation.

    The documentation does indicate that when using Grounding with Bing Search, your customer data is transferred outside of the Azure compliance boundary, and it is your responsibility to assess whether this service meets your needs and requirements. If you are encountering sporadic issues with the API key, it might be worth checking if there are any specific limitations or configurations that could be affecting its performance.

    Microsoft often limits direct support for preview services and instead routes feedback through forums or the “Share your Ideas” portal.

    Kindly refer below link: bing-custom-search

    bing-grounding

    Thank You.


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.