# AzureServiceBusSubscriptionResource

- Module: [Aspire.Hosting.Azure.ServiceBus](/reference/api/typescript/aspire.hosting.azure.servicebus.md)
- Version: `13.4.0`
- Kind: `handle`
- Source: [GitHub](https://github.com/microsoft/aspire)

Represents a Service Bus Subscription. Initializes a new instance of the {@ats-ref type:AzureServiceBusSubscriptionResource} class.

## Definition

```typescript
interface AzureServiceBusSubscriptionResource
  extends IExpressionValue,
    IManifestExpressionProvider,
    IResource,
    IResourceWithConnectionString,
    IResourceWithParent,
    AzureServiceBusTopicResource]],
    IValueProvider,
    IValueWithReferences,
    IResourceWithAzureFunctionsConfig {
  readonly connectionStringExpression: ReferenceExpression;
  deadLetteringOnMessageExpiration: boolean;
  defaultMessageTimeToLive: timespan;
  forwardDeadLetteredMessagesTo: string;
  forwardTo: string;
  lockDuration: timespan;
  maxDeliveryCount: number;
  readonly parent: AzureServiceBusTopicResource;
  requiresSession: boolean;
  readonly rules: List<Aspire.Hosting.Azure.ServiceBus/Aspire.Hosting.Azure.AzureServiceBusRule>;
  subscriptionName: string;
  withProperties(configure: (obj: AzureServiceBusSubscriptionResource) => Promise<void>): AzureServiceBusSubscriptionResource;
}
```

## Properties

- `connectionStringExpression`: `ReferenceExpression` `get` -- Gets the connection string expression for the Azure Service Bus Subscription.
- `deadLetteringOnMessageExpiration`: `boolean` `get - set` -- A value that indicates whether this queue has dead letter support when a message expires.
- `defaultMessageTimeToLive`: `timespan` `get - set` -- ISO 8601 default message timespan to live value. This is the duration after which the message expires, starting from when the message is sent to Service Bus. This is the default value used when TimeToLive is not set on a message itself.
- `forwardDeadLetteredMessagesTo`: `string` `get - set` -- Queue/Topic name to forward the Dead Letter message.
- `forwardTo`: `string` `get - set` -- Queue/Topic name to forward the messages.
- `lockDuration`: `timespan` `get - set` -- ISO 8601 timespan duration of a peek-lock; that is, the amount of time that the message is locked for other receivers. The maximum value for LockDuration is 5 minutes; the default value is 1 minute.
- `maxDeliveryCount`: `number` `get - set` -- The maximum delivery count. A message is automatically deadlettered after this number of deliveries. default value is 10.
- `parent`: [AzureServiceBusTopicResource](/reference/api/typescript/aspire.hosting.azure.servicebus/azureservicebustopicresource.md) `get` -- Gets the parent Azure Service Bus Topic resource.
- `requiresSession`: `boolean` `get - set` -- A value that indicates whether the queue supports the concept of sessions.
- `rules`: `AzureServiceBusRule>` `get` -- The rules for this subscription.
- `subscriptionName`: `string` `get - set` -- The subscription name.

## Methods

- [withProperties](/reference/api/typescript/aspire.hosting.azure.servicebus/azureservicebussubscriptionresource/withproperties.md) -- `method` -- Allows setting the properties of an Azure Service Bus Subscription resource.
    ```typescript
  withProperties(configure: (obj: AzureServiceBusSubscriptionResource) => Promise<void>): AzureServiceBusSubscriptionResource
  ```
