|
| 1 | + |
| 2 | +# 🌐 Grounding with Bing Search — Quick Setup |
| 3 | + |
| 4 | +This guide walks you through setting up Grounding with Bing Search and connecting it to your Azure AI Foundry project. This tool enables your AI agents to retrieve real-time public web data, enhancing responses with up-to-date information. |
| 5 | + |
| 6 | +--- |
| 7 | + |
| 8 | +## ✅ Prerequisites |
| 9 | + |
| 10 | +- An active **Azure subscription** |
| 11 | +- **Azure CLI** installed and logged in (`az login`) |
| 12 | +- A **resource group** created |
| 13 | +- Register the Bing provider (one-time setup): |
| 14 | + |
| 15 | + ```bash |
| 16 | + az provider register --namespace Microsoft.Bing |
| 17 | + |
| 18 | +⚠️ **Important:** |
| 19 | +Bing Search Grounding only supports **API key authentication**. |
| 20 | +Ensure your **Azure AI Foundry account has Local Authentication enabled**. |
| 21 | +If local auth is disabled, you will not be able to connect Bing Search. |
| 22 | + |
| 23 | +--- |
| 24 | + |
| 25 | +## 🚀 Step 1: Create a Bing Search Grounding Resource |
| 26 | + |
| 27 | +### Option A — Azure Portal |
| 28 | + |
| 29 | +1. In the [Azure Portal](https://portal.azure.com), search for **Bing Search (Grounding)**. |
| 30 | +2. Click **Create**. |
| 31 | +3. Select your **Subscription** and **Resource Group**. |
| 32 | +4. Enter a **Resource Name** and choose a **Pricing Tier (SKU)**. |
| 33 | +5. At the bottom of the form, tick the required checkbox: |
| 34 | + ✅ *“I confirm I have read and understood the notice above.”* |
| 35 | + (You cannot proceed without this.) |
| 36 | +6. Click **Review + Create** → **Create**. |
| 37 | + |
| 38 | +--- |
| 39 | + |
| 40 | +### Option B — Azure CLI |
| 41 | + |
| 42 | +Set your variables (replace with your own values): |
| 43 | + |
| 44 | +```bash |
| 45 | +RESOURCE_GROUP="<your-resource-group>" |
| 46 | +ACCOUNT_NAME="<unique-bing-resource-name>" |
| 47 | +LOCATION="global" # must be 'global' |
| 48 | +SKU="G1" |
| 49 | +KIND="Bing.Grounding" |
| 50 | +
|
| 51 | +SUBSCRIPTION_ID=$(az account show --query id --output tsv) |
| 52 | +RESOURCE_ID="/subscriptions/$SUBSCRIPTION_ID/resourceGroups/$RESOURCE_GROUP/providers/microsoft.bing/accounts/$ACCOUNT_NAME" |
| 53 | +``` |
| 54 | + |
| 55 | +Create the resource: |
| 56 | + |
| 57 | +```bash |
| 58 | +az rest --method put \ |
| 59 | + --url "https://management.azure.com$RESOURCE_ID?api-version=2020-06-10" \ |
| 60 | + --body '{ |
| 61 | + "location": "'$LOCATION'", |
| 62 | + "kind": "'$KIND'", |
| 63 | + "sku": { "name": "'$SKU'" }, |
| 64 | + "properties": {} |
| 65 | + }' |
| 66 | +``` |
| 67 | + |
| 68 | +Verify creation: |
| 69 | + |
| 70 | +```bash |
| 71 | +az resource show --ids "$RESOURCE_ID" --api-version 2020-06-10 -o table |
| 72 | +``` |
| 73 | + |
| 74 | +--- |
| 75 | + |
| 76 | +## 🔗 Step 2: Connect Bing Search to Azure AI Foundry |
| 77 | + |
| 78 | +1. Open your **Azure AI Foundry project** in the [AI Studio portal](https://ai.azure.com). |
| 79 | +2. Go to **Management center** → **Connected resources**. |
| 80 | +3. Click **+ Add connection**. |
| 81 | +4. Select **Grounding with Bing Search**. |
| 82 | +5. Choose the Bing resource you created and click **Create**. |
| 83 | + |
| 84 | +--- |
| 85 | + |
| 86 | +## 💡 Why Use Bing Search Grounding? |
| 87 | + |
| 88 | +* Provides **real-time information** to enrich AI responses. |
| 89 | +* Helps LLMs give answers with **up-to-date knowledge** beyond training data. |
| 90 | +* Useful for scenarios like **news, research, or dynamic queries**. |
| 91 | + |
| 92 | +--- |
| 93 | + |
| 94 | +## 📚 Additional Resources |
| 95 | + |
| 96 | +* [Grounding with Bing Search (overview)](https://learn.microsoft.com/en-us/azure/ai-foundry/agents/how-to/tools/bing-grounding) — Learn how the tool works, pricing, privacy notes, and how real-time search is integrated. ([Microsoft Learn][1]) |
| 97 | +* [Grounding with Bing Search code samples](https://learn.microsoft.com/en-us/azure/ai-foundry/agents/how-to/tools/bing-code-samples?source=recommendations&pivots=portal) — SDK and REST examples for using Bing grounding. ([Microsoft Learn][2]) |
| 98 | + |
| 99 | +--- |
0 commit comments