We recommend using Azure Native.
Azure v6.21.0 published on Friday, Mar 7, 2025 by Pulumi
azure.servicebus.getQueue
Explore with Pulumi AI
Use this data source to access information about an existing Service Bus Queue.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
const example = azure.servicebus.getQueue({
    name: "existing",
    namespaceId: "existing",
});
export const id = example.then(example => example.id);
import pulumi
import pulumi_azure as azure
example = azure.servicebus.get_queue(name="existing",
    namespace_id="existing")
pulumi.export("id", example.id)
package main
import (
	"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/servicebus"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		example, err := servicebus.LookupQueue(ctx, &servicebus.LookupQueueArgs{
			Name:        "existing",
			NamespaceId: pulumi.StringRef("existing"),
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("id", example.Id)
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Azure = Pulumi.Azure;
return await Deployment.RunAsync(() => 
{
    var example = Azure.ServiceBus.GetQueue.Invoke(new()
    {
        Name = "existing",
        NamespaceId = "existing",
    });
    return new Dictionary<string, object?>
    {
        ["id"] = example.Apply(getQueueResult => getQueueResult.Id),
    };
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azure.servicebus.ServicebusFunctions;
import com.pulumi.azure.servicebus.inputs.GetQueueArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }
    public static void stack(Context ctx) {
        final var example = ServicebusFunctions.getQueue(GetQueueArgs.builder()
            .name("existing")
            .namespaceId("existing")
            .build());
        ctx.export("id", example.applyValue(getQueueResult -> getQueueResult.id()));
    }
}
variables:
  example:
    fn::invoke:
      function: azure:servicebus:getQueue
      arguments:
        name: existing
        namespaceId: existing
outputs:
  id: ${example.id}
Using getQueue
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getQueue(args: GetQueueArgs, opts?: InvokeOptions): Promise<GetQueueResult>
function getQueueOutput(args: GetQueueOutputArgs, opts?: InvokeOptions): Output<GetQueueResult>def get_queue(name: Optional[str] = None,
              namespace_id: Optional[str] = None,
              namespace_name: Optional[str] = None,
              resource_group_name: Optional[str] = None,
              opts: Optional[InvokeOptions] = None) -> GetQueueResult
def get_queue_output(name: Optional[pulumi.Input[str]] = None,
              namespace_id: Optional[pulumi.Input[str]] = None,
              namespace_name: Optional[pulumi.Input[str]] = None,
              resource_group_name: Optional[pulumi.Input[str]] = None,
              opts: Optional[InvokeOptions] = None) -> Output[GetQueueResult]func LookupQueue(ctx *Context, args *LookupQueueArgs, opts ...InvokeOption) (*LookupQueueResult, error)
func LookupQueueOutput(ctx *Context, args *LookupQueueOutputArgs, opts ...InvokeOption) LookupQueueResultOutput> Note: This function is named LookupQueue in the Go SDK.
public static class GetQueue 
{
    public static Task<GetQueueResult> InvokeAsync(GetQueueArgs args, InvokeOptions? opts = null)
    public static Output<GetQueueResult> Invoke(GetQueueInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetQueueResult> getQueue(GetQueueArgs args, InvokeOptions options)
public static Output<GetQueueResult> getQueue(GetQueueArgs args, InvokeOptions options)
fn::invoke:
  function: azure:servicebus/getQueue:getQueue
  arguments:
    # arguments dictionaryThe following arguments are supported:
- Name string
- The name of this Service Bus Queue.
- NamespaceId string
- The ID of the ServiceBus Namespace where the Service Bus Queue exists.
- NamespaceName string
- ResourceGroup stringName 
- Name string
- The name of this Service Bus Queue.
- NamespaceId string
- The ID of the ServiceBus Namespace where the Service Bus Queue exists.
- NamespaceName string
- ResourceGroup stringName 
- name String
- The name of this Service Bus Queue.
- namespaceId String
- The ID of the ServiceBus Namespace where the Service Bus Queue exists.
- namespaceName String
- resourceGroup StringName 
- name string
- The name of this Service Bus Queue.
- namespaceId string
- The ID of the ServiceBus Namespace where the Service Bus Queue exists.
- namespaceName string
- resourceGroup stringName 
- name str
- The name of this Service Bus Queue.
- namespace_id str
- The ID of the ServiceBus Namespace where the Service Bus Queue exists.
- namespace_name str
- resource_group_ strname 
- name String
- The name of this Service Bus Queue.
- namespaceId String
- The ID of the ServiceBus Namespace where the Service Bus Queue exists.
- namespaceName String
- resourceGroup StringName 
getQueue Result
The following output properties are available:
- AutoDelete stringOn Idle 
- The ISO 8601 timespan duration of the idle interval after which the Queue is automatically deleted, minimum of 5 minutes.
- BatchedOperations boolEnabled 
- Boolean flag which controls whether server-side batched operations are enabled.
- DeadLettering boolOn Message Expiration 
- Boolean flag which controls whether the Queue has dead letter support when a message expires.
- DefaultMessage stringTtl 
- The ISO 8601 timespan duration of the TTL of messages sent to this queue. This is the default value used when TTL is not set on a message itself.
- DuplicateDetection stringHistory Time Window 
- The ISO 8601 timespan duration during which duplicates can be detected.
- EnableBatched boolOperations 
- EnableExpress bool
- EnablePartitioning bool
- ExpressEnabled bool
- Boolean flag which controls whether Express Entities are enabled. An express queue holds a message in memory temporarily before writing it to persistent storage.
- ForwardDead stringLettered Messages To 
- The name of a Queue or Topic to automatically forward dead lettered messages to.
- ForwardTo string
- The name of a Queue or Topic to automatically forward messages to. Please see the documentation for more information.
- Id string
- The provider-assigned unique ID for this managed resource.
- LockDuration string
- The ISO 8601 timespan duration of a peek-lock; that is, the amount of time that the message is locked for other receivers.
- MaxDelivery intCount 
- Integer value which controls when a message is automatically dead lettered.
- MaxSize intIn Megabytes 
- Integer value which controls the size of memory allocated for the queue. For supported values see the "Queue or topic size" section of Service Bus Quotas.
- Name string
- PartitioningEnabled bool
- Boolean flag which controls whether to enable the queue to be partitioned across multiple message brokers.
- RequiresDuplicate boolDetection 
- Boolean flag which controls whether the Queue requires duplicate detection.
- RequiresSession bool
- Boolean flag which controls whether the Queue requires sessions. This will allow ordered handling of unbounded sequences of related messages. With sessions enabled a queue can guarantee first-in-first-out delivery of messages.
- Status string
- The status of the Queue. Possible values are Active,Creating,Deleting,Disabled,ReceiveDisabled,Renaming,SendDisabled,Unknown.
- NamespaceId string
- NamespaceName string
- ResourceGroup stringName 
- AutoDelete stringOn Idle 
- The ISO 8601 timespan duration of the idle interval after which the Queue is automatically deleted, minimum of 5 minutes.
- BatchedOperations boolEnabled 
- Boolean flag which controls whether server-side batched operations are enabled.
- DeadLettering boolOn Message Expiration 
- Boolean flag which controls whether the Queue has dead letter support when a message expires.
- DefaultMessage stringTtl 
- The ISO 8601 timespan duration of the TTL of messages sent to this queue. This is the default value used when TTL is not set on a message itself.
- DuplicateDetection stringHistory Time Window 
- The ISO 8601 timespan duration during which duplicates can be detected.
- EnableBatched boolOperations 
- EnableExpress bool
- EnablePartitioning bool
- ExpressEnabled bool
- Boolean flag which controls whether Express Entities are enabled. An express queue holds a message in memory temporarily before writing it to persistent storage.
- ForwardDead stringLettered Messages To 
- The name of a Queue or Topic to automatically forward dead lettered messages to.
- ForwardTo string
- The name of a Queue or Topic to automatically forward messages to. Please see the documentation for more information.
- Id string
- The provider-assigned unique ID for this managed resource.
- LockDuration string
- The ISO 8601 timespan duration of a peek-lock; that is, the amount of time that the message is locked for other receivers.
- MaxDelivery intCount 
- Integer value which controls when a message is automatically dead lettered.
- MaxSize intIn Megabytes 
- Integer value which controls the size of memory allocated for the queue. For supported values see the "Queue or topic size" section of Service Bus Quotas.
- Name string
- PartitioningEnabled bool
- Boolean flag which controls whether to enable the queue to be partitioned across multiple message brokers.
- RequiresDuplicate boolDetection 
- Boolean flag which controls whether the Queue requires duplicate detection.
- RequiresSession bool
- Boolean flag which controls whether the Queue requires sessions. This will allow ordered handling of unbounded sequences of related messages. With sessions enabled a queue can guarantee first-in-first-out delivery of messages.
- Status string
- The status of the Queue. Possible values are Active,Creating,Deleting,Disabled,ReceiveDisabled,Renaming,SendDisabled,Unknown.
- NamespaceId string
- NamespaceName string
- ResourceGroup stringName 
- autoDelete StringOn Idle 
- The ISO 8601 timespan duration of the idle interval after which the Queue is automatically deleted, minimum of 5 minutes.
- batchedOperations BooleanEnabled 
- Boolean flag which controls whether server-side batched operations are enabled.
- deadLettering BooleanOn Message Expiration 
- Boolean flag which controls whether the Queue has dead letter support when a message expires.
- defaultMessage StringTtl 
- The ISO 8601 timespan duration of the TTL of messages sent to this queue. This is the default value used when TTL is not set on a message itself.
- duplicateDetection StringHistory Time Window 
- The ISO 8601 timespan duration during which duplicates can be detected.
- enableBatched BooleanOperations 
- enableExpress Boolean
- enablePartitioning Boolean
- expressEnabled Boolean
- Boolean flag which controls whether Express Entities are enabled. An express queue holds a message in memory temporarily before writing it to persistent storage.
- forwardDead StringLettered Messages To 
- The name of a Queue or Topic to automatically forward dead lettered messages to.
- forwardTo String
- The name of a Queue or Topic to automatically forward messages to. Please see the documentation for more information.
- id String
- The provider-assigned unique ID for this managed resource.
- lockDuration String
- The ISO 8601 timespan duration of a peek-lock; that is, the amount of time that the message is locked for other receivers.
- maxDelivery IntegerCount 
- Integer value which controls when a message is automatically dead lettered.
- maxSize IntegerIn Megabytes 
- Integer value which controls the size of memory allocated for the queue. For supported values see the "Queue or topic size" section of Service Bus Quotas.
- name String
- partitioningEnabled Boolean
- Boolean flag which controls whether to enable the queue to be partitioned across multiple message brokers.
- requiresDuplicate BooleanDetection 
- Boolean flag which controls whether the Queue requires duplicate detection.
- requiresSession Boolean
- Boolean flag which controls whether the Queue requires sessions. This will allow ordered handling of unbounded sequences of related messages. With sessions enabled a queue can guarantee first-in-first-out delivery of messages.
- status String
- The status of the Queue. Possible values are Active,Creating,Deleting,Disabled,ReceiveDisabled,Renaming,SendDisabled,Unknown.
- namespaceId String
- namespaceName String
- resourceGroup StringName 
- autoDelete stringOn Idle 
- The ISO 8601 timespan duration of the idle interval after which the Queue is automatically deleted, minimum of 5 minutes.
- batchedOperations booleanEnabled 
- Boolean flag which controls whether server-side batched operations are enabled.
- deadLettering booleanOn Message Expiration 
- Boolean flag which controls whether the Queue has dead letter support when a message expires.
- defaultMessage stringTtl 
- The ISO 8601 timespan duration of the TTL of messages sent to this queue. This is the default value used when TTL is not set on a message itself.
- duplicateDetection stringHistory Time Window 
- The ISO 8601 timespan duration during which duplicates can be detected.
- enableBatched booleanOperations 
- enableExpress boolean
- enablePartitioning boolean
- expressEnabled boolean
- Boolean flag which controls whether Express Entities are enabled. An express queue holds a message in memory temporarily before writing it to persistent storage.
- forwardDead stringLettered Messages To 
- The name of a Queue or Topic to automatically forward dead lettered messages to.
- forwardTo string
- The name of a Queue or Topic to automatically forward messages to. Please see the documentation for more information.
- id string
- The provider-assigned unique ID for this managed resource.
- lockDuration string
- The ISO 8601 timespan duration of a peek-lock; that is, the amount of time that the message is locked for other receivers.
- maxDelivery numberCount 
- Integer value which controls when a message is automatically dead lettered.
- maxSize numberIn Megabytes 
- Integer value which controls the size of memory allocated for the queue. For supported values see the "Queue or topic size" section of Service Bus Quotas.
- name string
- partitioningEnabled boolean
- Boolean flag which controls whether to enable the queue to be partitioned across multiple message brokers.
- requiresDuplicate booleanDetection 
- Boolean flag which controls whether the Queue requires duplicate detection.
- requiresSession boolean
- Boolean flag which controls whether the Queue requires sessions. This will allow ordered handling of unbounded sequences of related messages. With sessions enabled a queue can guarantee first-in-first-out delivery of messages.
- status string
- The status of the Queue. Possible values are Active,Creating,Deleting,Disabled,ReceiveDisabled,Renaming,SendDisabled,Unknown.
- namespaceId string
- namespaceName string
- resourceGroup stringName 
- auto_delete_ stron_ idle 
- The ISO 8601 timespan duration of the idle interval after which the Queue is automatically deleted, minimum of 5 minutes.
- batched_operations_ boolenabled 
- Boolean flag which controls whether server-side batched operations are enabled.
- dead_lettering_ boolon_ message_ expiration 
- Boolean flag which controls whether the Queue has dead letter support when a message expires.
- default_message_ strttl 
- The ISO 8601 timespan duration of the TTL of messages sent to this queue. This is the default value used when TTL is not set on a message itself.
- duplicate_detection_ strhistory_ time_ window 
- The ISO 8601 timespan duration during which duplicates can be detected.
- enable_batched_ booloperations 
- enable_express bool
- enable_partitioning bool
- express_enabled bool
- Boolean flag which controls whether Express Entities are enabled. An express queue holds a message in memory temporarily before writing it to persistent storage.
- forward_dead_ strlettered_ messages_ to 
- The name of a Queue or Topic to automatically forward dead lettered messages to.
- forward_to str
- The name of a Queue or Topic to automatically forward messages to. Please see the documentation for more information.
- id str
- The provider-assigned unique ID for this managed resource.
- lock_duration str
- The ISO 8601 timespan duration of a peek-lock; that is, the amount of time that the message is locked for other receivers.
- max_delivery_ intcount 
- Integer value which controls when a message is automatically dead lettered.
- max_size_ intin_ megabytes 
- Integer value which controls the size of memory allocated for the queue. For supported values see the "Queue or topic size" section of Service Bus Quotas.
- name str
- partitioning_enabled bool
- Boolean flag which controls whether to enable the queue to be partitioned across multiple message brokers.
- requires_duplicate_ booldetection 
- Boolean flag which controls whether the Queue requires duplicate detection.
- requires_session bool
- Boolean flag which controls whether the Queue requires sessions. This will allow ordered handling of unbounded sequences of related messages. With sessions enabled a queue can guarantee first-in-first-out delivery of messages.
- status str
- The status of the Queue. Possible values are Active,Creating,Deleting,Disabled,ReceiveDisabled,Renaming,SendDisabled,Unknown.
- namespace_id str
- namespace_name str
- resource_group_ strname 
- autoDelete StringOn Idle 
- The ISO 8601 timespan duration of the idle interval after which the Queue is automatically deleted, minimum of 5 minutes.
- batchedOperations BooleanEnabled 
- Boolean flag which controls whether server-side batched operations are enabled.
- deadLettering BooleanOn Message Expiration 
- Boolean flag which controls whether the Queue has dead letter support when a message expires.
- defaultMessage StringTtl 
- The ISO 8601 timespan duration of the TTL of messages sent to this queue. This is the default value used when TTL is not set on a message itself.
- duplicateDetection StringHistory Time Window 
- The ISO 8601 timespan duration during which duplicates can be detected.
- enableBatched BooleanOperations 
- enableExpress Boolean
- enablePartitioning Boolean
- expressEnabled Boolean
- Boolean flag which controls whether Express Entities are enabled. An express queue holds a message in memory temporarily before writing it to persistent storage.
- forwardDead StringLettered Messages To 
- The name of a Queue or Topic to automatically forward dead lettered messages to.
- forwardTo String
- The name of a Queue or Topic to automatically forward messages to. Please see the documentation for more information.
- id String
- The provider-assigned unique ID for this managed resource.
- lockDuration String
- The ISO 8601 timespan duration of a peek-lock; that is, the amount of time that the message is locked for other receivers.
- maxDelivery NumberCount 
- Integer value which controls when a message is automatically dead lettered.
- maxSize NumberIn Megabytes 
- Integer value which controls the size of memory allocated for the queue. For supported values see the "Queue or topic size" section of Service Bus Quotas.
- name String
- partitioningEnabled Boolean
- Boolean flag which controls whether to enable the queue to be partitioned across multiple message brokers.
- requiresDuplicate BooleanDetection 
- Boolean flag which controls whether the Queue requires duplicate detection.
- requiresSession Boolean
- Boolean flag which controls whether the Queue requires sessions. This will allow ordered handling of unbounded sequences of related messages. With sessions enabled a queue can guarantee first-in-first-out delivery of messages.
- status String
- The status of the Queue. Possible values are Active,Creating,Deleting,Disabled,ReceiveDisabled,Renaming,SendDisabled,Unknown.
- namespaceId String
- namespaceName String
- resourceGroup StringName 
Package Details
- Repository
- Azure Classic pulumi/pulumi-azure
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the azurermTerraform Provider.