# IResourceWithConnectionString.withConnectionProperty

- Module: [Aspire.Hosting](/reference/api/typescript/aspire.hosting.md)
- Defined on: [IResourceWithConnectionString](/reference/api/typescript/aspire.hosting/iresourcewithconnectionstring.md)
- Version: `13.4.0`
- Kind: `method`

Adds a connection property annotation to the resource being built.

## Definition

```typescript
interface IResourceWithConnectionString {
  // ... omitted for brevity
  withConnectionProperty(
      name: string,
      value: ReferenceExpression): IResourceWithConnectionString;
}
```

## Signature

```typescript
withConnectionProperty(
    name: string,
    value: ReferenceExpression): IResourceWithConnectionString
```

## Parameters

- `name` (`string`)
- `value` ([ReferenceExpression](/reference/api/typescript/aspire.hosting/referenceexpression.md))

## Returns

[IResourceWithConnectionString](/reference/api/typescript/aspire.hosting/iresourcewithconnectionstring.md) `builder`

## Defined on

- [IResourceWithConnectionString](/reference/api/typescript/aspire.hosting/iresourcewithconnectionstring.md) -- `interface`
