# AzureServiceBusTopicResource

- 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/AzureServiceBusTopicResource.cs)
- Inherits: `Resource`
- Implements: `IExpressionValue`, `IManifestExpressionProvider`, `IResource`, `IResourceWithConnectionString`, `IResourceWithParent`, `IResourceWithParent<AzureServiceBusResource>`, `IValueProvider`, `IValueWithReferences`, `IResourceWithAzureFunctionsConfig`

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

## Definition

```csharp
namespace Aspire.Hosting.Azure;

public class AzureServiceBusTopicResource
    : 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.AzureServiceBusResource>,
      Aspire.Hosting.ApplicationModel.IValueProvider,
      Aspire.Hosting.ApplicationModel.IValueWithReferences,
      Aspire.Hosting.Azure.IResourceWithAzureFunctionsConfig
{
    // ...
}
```

## ATS metadata

### ATS export

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

## Remarks

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

## Constructors

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

## Properties

- [ConnectionStringExpression](/reference/api/csharp/aspire.hosting.azure.servicebus/azureservicebustopicresource/properties.md#connectionstringexpression) : `ReferenceExpression` `get` -- Gets the connection string expression for the Azure Service Bus Topic.
- [DefaultMessageTimeToLive](/reference/api/csharp/aspire.hosting.azure.servicebus/azureservicebustopicresource/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.
- [DuplicateDetectionHistoryTimeWindow](/reference/api/csharp/aspire.hosting.azure.servicebus/azureservicebustopicresource/properties.md#duplicatedetectionhistorytimewindow) : `TimeSpan?` `get; set` -- ISO 8601 timeSpan structure that defines the duration of the duplicate detection history. The default value is 10 minutes.
- [Parent](/reference/api/csharp/aspire.hosting.azure.servicebus/azureservicebustopicresource/properties.md#parent) : [AzureServiceBusResource](/reference/api/csharp/aspire.hosting.azure.servicebus/azureservicebusresource.md) `get` -- Gets the parent Azure Service Bus resource.
- [RequiresDuplicateDetection](/reference/api/csharp/aspire.hosting.azure.servicebus/azureservicebustopicresource/properties.md#requiresduplicatedetection) : `bool?` `get; set` -- A value indicating if this topic requires duplicate detection.
- [TopicName](/reference/api/csharp/aspire.hosting.azure.servicebus/azureservicebustopicresource/properties.md#topicname) : `string` `get; set` -- The topic name.
