# AzureServiceBusResource

- 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/AzureServiceBusResource.cs)
- Inherits: `AzureProvisioningResource`
- Implements: `IExpressionValue`, `IManifestExpressionProvider`, `IResource`, `IResourceWithConnectionString`, `IResourceWithEndpoints`, `IValueProvider`, `IValueWithReferences`, `IAzureNspAssociationTarget`, `IAzurePrivateEndpointTarget`, `IResourceWithAzureFunctionsConfig`

Represents an Azure Service Bus resource.

## Definition

```csharp
namespace Aspire.Hosting.Azure;

public class AzureServiceBusResource
    : Aspire.Hosting.Azure.AzureProvisioningResource,
      Aspire.Hosting.ApplicationModel.IExpressionValue,
      Aspire.Hosting.ApplicationModel.IManifestExpressionProvider,
      Aspire.Hosting.ApplicationModel.IResource,
      Aspire.Hosting.ApplicationModel.IResourceWithConnectionString,
      Aspire.Hosting.ApplicationModel.IResourceWithEndpoints,
      Aspire.Hosting.ApplicationModel.IValueProvider,
      Aspire.Hosting.ApplicationModel.IValueWithReferences,
      Aspire.Hosting.Azure.IAzureNspAssociationTarget,
      Aspire.Hosting.Azure.IAzurePrivateEndpointTarget,
      Aspire.Hosting.Azure.IResourceWithAzureFunctionsConfig
{
    // ...
}
```

## ATS metadata

### ATS export

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

## Constructors

- [AzureServiceBusResource(string, Action<AzureResourceInfrastructure>)](/reference/api/csharp/aspire.hosting.azure.servicebus/azureservicebusresource/constructors.md#constructor-string-action-azureresourceinfrastructure) -- Represents an Azure Service Bus resource.

## Properties

- [ConnectionStringExpression](/reference/api/csharp/aspire.hosting.azure.servicebus/azureservicebusresource/properties.md#connectionstringexpression) : `ReferenceExpression` `get` -- Gets the connection string template for the manifest for the Azure Service Bus endpoint.
- [HostName](/reference/api/csharp/aspire.hosting.azure.servicebus/azureservicebusresource/properties.md#hostname) : `ReferenceExpression` `get` -- Gets the host name for the Service Bus namespace.
- [Id](/reference/api/csharp/aspire.hosting.azure.servicebus/azureservicebusresource/properties.md#id) : `BicepOutputReference` `get` -- Gets the "id" output reference for the resource.
- [IsEmulator](/reference/api/csharp/aspire.hosting.azure.servicebus/azureservicebusresource/properties.md#isemulator) : `bool` `get` -- Gets a value indicating whether the Azure Service Bus resource is running in the local emulator.
- [NameOutputReference](/reference/api/csharp/aspire.hosting.azure.servicebus/azureservicebusresource/properties.md#nameoutputreference) : `BicepOutputReference` `get` -- Gets the "name" output reference for the resource.
- [Port](/reference/api/csharp/aspire.hosting.azure.servicebus/azureservicebusresource/properties.md#port) : `ReferenceExpression?` `get` -- Gets the port for the Service Bus namespace.
- [ServiceBusEndpoint](/reference/api/csharp/aspire.hosting.azure.servicebus/azureservicebusresource/properties.md#servicebusendpoint) : `BicepOutputReference` `get` -- Gets the "serviceBusEndpoint" output reference from the bicep template for the Azure Storage resource.
- [UriExpression](/reference/api/csharp/aspire.hosting.azure.servicebus/azureservicebusresource/properties.md#uriexpression) : `ReferenceExpression` `get` -- Gets the connection URI expression for the Service Bus namespace.

## Methods

- [AddAsExistingResource(AzureResourceInfrastructure)](/reference/api/csharp/aspire.hosting.azure.servicebus/azureservicebusresource/methods.md#addasexistingresource-azureresourceinfrastructure) : `ProvisionableResource`
