# AddBingGroundingConnection

- Module: [Aspire.Hosting.Foundry](/reference/api/go/aspire.hosting.foundry.md)
- Version: `17.0.0-preview.1.26567.5`
- Kind: `method`
- Defined on: [`AzureCognitiveServicesProjectResource`](/reference/api/go/aspire.hosting.foundry/azurecognitiveservicesprojectresource.md)
- Source: [GitHub](https://github.com/microsoft/aspire/tree/2d325b13709752ba6d9a943635c5e2940a2530c0)

Adds a Grounding with Bing Search connection to a Microsoft Foundry project.

## Remarks

The Bing Search resource (`Microsoft.Bing/accounts`) cannot be provisioned through Aspire
or Bicep. It must be created manually in the
Azure portal.
Once the Bing resource exists, pass its resource ID to this method. The connection is
created in the Foundry project using API key authentication with
`category: "ApiKey"` and `metadata.Type: "bing_grounding"`.

## Definition

```go
func (AzureCognitiveServicesProjectResource) AddBingGroundingConnection(
    name string,
    bingResourceId string,
) BingGroundingConnectionResource
```

## Parameters

- `name` (`string`) -- The name of the connection resource.
- `bingResourceId` (`string`) -- The full Azure resource ID of the Bing Search resource (e.g., `/subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.Bing/accounts/{name}`).

## Returns

[`BingGroundingConnectionResource`](/reference/api/go/aspire.hosting.foundry/binggroundingconnectionresource.md) -- The resource builder.

Returns a handle; failures surface later via `Err()`.

## Applies to

- [`AzureCognitiveServicesProjectResource`](/reference/api/go/aspire.hosting.foundry/azurecognitiveservicesprojectresource.md)
