# ConnectionStringAvailableEvent

- Kind: `class`
- Package: [Aspire.Hosting](/reference/api/csharp/aspire.hosting.md)
- Version: `13.4.0`
- Namespace: `Aspire.Hosting.ApplicationModel`
- Target framework: `net8.0`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/a3766e994fd2cba86c8ac60b8a80268cab7e6383/src/Aspire.Hosting/ApplicationModel/ConnectionStringAvailableEvent.cs)
- Implements: [IDistributedApplicationEvent](/reference/api/csharp/aspire.hosting/idistributedapplicationevent.md), [IDistributedApplicationResourceEvent](/reference/api/csharp/aspire.hosting/idistributedapplicationresourceevent.md)

The [ConnectionStringAvailableEvent](/reference/api/csharp/aspire.hosting/connectionstringavailableevent.md) is raised when a connection string becomes available for a resource.

## Definition

```csharp
namespace Aspire.Hosting.ApplicationModel;

public class ConnectionStringAvailableEvent
    : Aspire.Hosting.Eventing.IDistributedApplicationEvent,
      Aspire.Hosting.Eventing.IDistributedApplicationResourceEvent
{
    // ...
}
```

## ATS metadata

### ATS export

- Type ID: `Aspire.Hosting/ConnectionStringAvailableEvent`
- Public instance properties are exported as ATS capabilities.

## Constructors

- [ConnectionStringAvailableEvent(IResource, IServiceProvider)](/reference/api/csharp/aspire.hosting/connectionstringavailableevent/constructors.md#constructor-iresource-iserviceprovider) -- The [ConnectionStringAvailableEvent](/reference/api/csharp/aspire.hosting/connectionstringavailableevent.md) is raised when a connection string becomes available for a resource.

## Properties

- [Resource](/reference/api/csharp/aspire.hosting/connectionstringavailableevent/properties.md#resource) : [IResource](/reference/api/csharp/aspire.hosting/iresource.md) `get` -- Resource associated with this event.
- [Services](/reference/api/csharp/aspire.hosting/connectionstringavailableevent/properties.md#services) : `IServiceProvider` `get` -- The `IServiceProvider` instance.
