# IResourceWithConnectionString Properties

- Package: [Aspire.Hosting](/reference/api/csharp/aspire.hosting.md)
- Type: [IResourceWithConnectionString](/reference/api/csharp/aspire.hosting/iresourcewithconnectionstring.md)
- Kind: `Properties`
- Members: `2`

Represents a resource that has a connection string associated with it.

## ConnectionStringEnvironmentVariable

- Name: `ConnectionStringEnvironmentVariable`
- Modifiers: `virtual` `nullable` `get`
- Returns: `string?`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/ApplicationModel/IResourceWithConnectionString.cs#L34)

The environment variable name to use for the connection string.

```csharp
public virtual string? ConnectionStringEnvironmentVariable { get; }
```

## ConnectionStringExpression

- Name: `ConnectionStringExpression`
- Modifiers: `abstract` `get`
- Returns: [ReferenceExpression](/reference/api/csharp/aspire.hosting/referenceexpression.md)

Describes the connection string format string used for this resource.

```csharp
public abstract ReferenceExpression ConnectionStringExpression { get; }
```
