# ResourceWithConnectionString.GetConnectionProperty

- Module: [Aspire.Hosting](/reference/api/go/aspire.hosting.md)
- Defined on: [ResourceWithConnectionString](/reference/api/go/aspire.hosting/resourcewithconnectionstring.md)
- Version: `17.0.0`
- Kind: `method`

Retrieves the value of a specified connection property from the resource's connection properties.

## Remarks

Throws a KeyNotFoundException if the specified key does not exist in the resource's
connection properties.

## Definition

```go
type ResourceWithConnectionString interface {
    // ... omitted for brevity
    GetConnectionProperty(key string) *ReferenceExpression
}
```

## Signature

```go
GetConnectionProperty(key string) *ReferenceExpression
```

## Parameters

- `key` (`string`) -- The key of the connection property to retrieve. Cannot be null.

## Returns

`*ReferenceExpression` -- The value associated with the specified connection property key.

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

## Defined on

- [ResourceWithConnectionString](/reference/api/go/aspire.hosting/resourcewithconnectionstring.md) -- `interface`
