# AzureServiceBusSubscriptionResource

- Kind: `class`
- Package: [Aspire.Hosting.Azure.ServiceBus](/reference/api/csharp/aspire.hosting.azure.servicebus.md)
- Version: `13.4.0`
- Namespace: `Aspire.Hosting.Azure`
- Target framework: `net8.0`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/cbc352350f1a9bafbaff10d14a2c8de4ac186a48/src/Aspire.Hosting.Azure.ServiceBus/AzureServiceBusSubscriptionResource.cs)
- Inherits: `Resource`
- Implements: `IExpressionValue`, `IManifestExpressionProvider`, `IResource`, `IResourceWithConnectionString`, `IResourceWithParent`, `IResourceWithParent<AzureServiceBusTopicResource>`, `IValueProvider`, `IValueWithReferences`, `IResourceWithAzureFunctionsConfig`

Represents a Service Bus Subscription. Initializes a new instance of the [AzureServiceBusSubscriptionResource](/reference/api/csharp/aspire.hosting.azure.servicebus/azureservicebussubscriptionresource.md) class.

## Definition

```csharp
namespace Aspire.Hosting.Azure;

public class AzureServiceBusSubscriptionResource
    : Aspire.Hosting.ApplicationModel.Resource,
      Aspire.Hosting.ApplicationModel.IExpressionValue,
      Aspire.Hosting.ApplicationModel.IManifestExpressionProvider,
      Aspire.Hosting.ApplicationModel.IResource,
      Aspire.Hosting.ApplicationModel.IResourceWithConnectionString,
      Aspire.Hosting.ApplicationModel.IResourceWithParent,
      Aspire.Hosting.ApplicationModel.IResourceWithParent<Aspire.Hosting.Azure.AzureServiceBusTopicResource>,
      Aspire.Hosting.ApplicationModel.IValueProvider,
      Aspire.Hosting.ApplicationModel.IValueWithReferences,
      Aspire.Hosting.Azure.IResourceWithAzureFunctionsConfig
{
    // ...
}
```

## ATS metadata

### ATS export

- Type ID: `Aspire.Hosting.Azure.ServiceBus/AzureServiceBusSubscriptionResource`

## Remarks

Use `AzureProvisioningResourceExtensions.ConfigureInfrastructure` to configure specific `Azure.Provisioning` properties.

## Constructors

- [AzureServiceBusSubscriptionResource(string, string, AzureServiceBusTopicResource)](/reference/api/csharp/aspire.hosting.azure.servicebus/azureservicebussubscriptionresource/constructors.md#constructor-string-string-azureservicebustopicresource) -- Represents a Service Bus Subscription. Initializes a new instance of the [AzureServiceBusSubscriptionResource](/reference/api/csharp/aspire.hosting.azure.servicebus/azureservicebussubscriptionresource.md) class.

## Properties

- [ConnectionStringExpression](/reference/api/csharp/aspire.hosting.azure.servicebus/azureservicebussubscriptionresource/properties.md#connectionstringexpression) : `ReferenceExpression` `get` -- Gets the connection string expression for the Azure Service Bus Subscription.
- [DeadLetteringOnMessageExpiration](/reference/api/csharp/aspire.hosting.azure.servicebus/azureservicebussubscriptionresource/properties.md#deadletteringonmessageexpiration) : `bool?` `get; set` -- A value that indicates whether this queue has dead letter support when a message expires.
- [DefaultMessageTimeToLive](/reference/api/csharp/aspire.hosting.azure.servicebus/azureservicebussubscriptionresource/properties.md#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](/reference/api/csharp/aspire.hosting.azure.servicebus/azureservicebussubscriptionresource/properties.md#forwarddeadletteredmessagesto) : `string?` `get; set` -- Queue/Topic name to forward the Dead Letter message.
- [ForwardTo](/reference/api/csharp/aspire.hosting.azure.servicebus/azureservicebussubscriptionresource/properties.md#forwardto) : `string?` `get; set` -- Queue/Topic name to forward the messages.
- [LockDuration](/reference/api/csharp/aspire.hosting.azure.servicebus/azureservicebussubscriptionresource/properties.md#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](/reference/api/csharp/aspire.hosting.azure.servicebus/azureservicebussubscriptionresource/properties.md#maxdeliverycount) : `int?` `get; set` -- The maximum delivery count. A message is automatically deadlettered after this number of deliveries. default value is 10.
- [Parent](/reference/api/csharp/aspire.hosting.azure.servicebus/azureservicebussubscriptionresource/properties.md#parent) : [AzureServiceBusTopicResource](/reference/api/csharp/aspire.hosting.azure.servicebus/azureservicebustopicresource.md) `get` -- Gets the parent Azure Service Bus Topic resource.
- [RequiresSession](/reference/api/csharp/aspire.hosting.azure.servicebus/azureservicebussubscriptionresource/properties.md#requiressession) : `bool?` `get; set` -- A value that indicates whether the queue supports the concept of sessions.
- [Rules](/reference/api/csharp/aspire.hosting.azure.servicebus/azureservicebussubscriptionresource/properties.md#rules) : [List<AzureServiceBusRule>](/reference/api/csharp/aspire.hosting.azure.servicebus/azureservicebusrule.md) `get` -- The rules for this subscription.
- [SubscriptionName](/reference/api/csharp/aspire.hosting.azure.servicebus/azureservicebussubscriptionresource/properties.md#subscriptionname) : `string` `get; set` -- The subscription name.
