# AzureServiceBusResource Properties

- Package: [Aspire.Hosting.Azure.ServiceBus](/reference/api/csharp/aspire.hosting.azure.servicebus.md)
- Type: [AzureServiceBusResource](/reference/api/csharp/aspire.hosting.azure.servicebus/azureservicebusresource.md)
- Kind: `Properties`
- Members: `8`

Represents an Azure Service Bus resource.

## ConnectionStringExpression

- Name: `ConnectionStringExpression`
- Modifiers: `get`
- Returns: `ReferenceExpression`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/cbc352350f1a9bafbaff10d14a2c8de4ac186a48/src/Aspire.Hosting.Azure.ServiceBus/AzureServiceBusResource.cs#L86-L88)

Gets the connection string template for the manifest for the Azure Service Bus endpoint.

```csharp
public ReferenceExpression ConnectionStringExpression { get; }
```

## HostName

- Name: `HostName`
- Modifiers: `get`
- Returns: `ReferenceExpression`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/cbc352350f1a9bafbaff10d14a2c8de4ac186a48/src/Aspire.Hosting.Azure.ServiceBus/AzureServiceBusResource.cs#L55-L57)

Gets the host name for the Service Bus namespace.

```csharp
public ReferenceExpression HostName { get; }
```

## Id

- Name: `Id`
- Modifiers: `get`
- Returns: `BicepOutputReference`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/cbc352350f1a9bafbaff10d14a2c8de4ac186a48/src/Aspire.Hosting.Azure.ServiceBus/AzureServiceBusResource.cs#L42)

Gets the "id" output reference for the resource.

```csharp
public BicepOutputReference Id { get; }
```

## IsEmulator

- Name: `IsEmulator`
- Modifiers: `get`
- Returns: `bool`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/cbc352350f1a9bafbaff10d14a2c8de4ac186a48/src/Aspire.Hosting.Azure.ServiceBus/AzureServiceBusResource.cs#L49)

Gets a value indicating whether the Azure Service Bus resource is running in the local emulator.

```csharp
public bool IsEmulator { get; }
```

## NameOutputReference

- Name: `NameOutputReference`
- Modifiers: `get`
- Returns: `BicepOutputReference`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/cbc352350f1a9bafbaff10d14a2c8de4ac186a48/src/Aspire.Hosting.Azure.ServiceBus/AzureServiceBusResource.cs#L37)

Gets the "name" output reference for the resource.

```csharp
public BicepOutputReference NameOutputReference { get; }
```

## Port

- Name: `Port`
- Modifiers: `nullable` `get`
- Returns: `ReferenceExpression?`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/cbc352350f1a9bafbaff10d14a2c8de4ac186a48/src/Aspire.Hosting.Azure.ServiceBus/AzureServiceBusResource.cs#L67-L69)

Gets the port for the Service Bus namespace.

```csharp
public ReferenceExpression? Port { get; }
```

## Remarks

In container mode, resolves to the container's primary endpoint port. In Azure mode, return null.

## ServiceBusEndpoint

- Name: `ServiceBusEndpoint`
- Modifiers: `get`
- Returns: `BicepOutputReference`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/cbc352350f1a9bafbaff10d14a2c8de4ac186a48/src/Aspire.Hosting.Azure.ServiceBus/AzureServiceBusResource.cs#L27)

Gets the "serviceBusEndpoint" output reference from the bicep template for the Azure Storage resource.

```csharp
public BicepOutputReference ServiceBusEndpoint { get; }
```

## UriExpression

- Name: `UriExpression`
- Modifiers: `get`
- Returns: `ReferenceExpression`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/cbc352350f1a9bafbaff10d14a2c8de4ac186a48/src/Aspire.Hosting.Azure.ServiceBus/AzureServiceBusResource.cs#L78-L80)

Gets the connection URI expression for the Service Bus namespace.

```csharp
public ReferenceExpression UriExpression { get; }
```

## Remarks

Format: `sb://{host}`.
