1. Packages
  2. Azure Classic
  3. API Docs
  4. servicebus
  5. getSubscription

We recommend using Azure Native.

Azure v6.22.0 published on Tuesday, Apr 1, 2025 by Pulumi

azure.servicebus.getSubscription

Explore with Pulumi AI

We recommend using Azure Native.

Azure v6.22.0 published on Tuesday, Apr 1, 2025 by Pulumi

Use this data source to access information about an existing ServiceBus Subscription.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";

const example = azure.servicebus.getSubscription({
    name: "examplesubscription",
    topicId: "exampletopic",
});
export const servicebusSubscription = exampleAzurermServicebusNamespace;
Copy
import pulumi
import pulumi_azure as azure

example = azure.servicebus.get_subscription(name="examplesubscription",
    topic_id="exampletopic")
pulumi.export("servicebusSubscription", example_azurerm_servicebus_namespace)
Copy
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 {
		_, err := servicebus.LookupSubscription(ctx, &servicebus.LookupSubscriptionArgs{
			Name:    "examplesubscription",
			TopicId: pulumi.StringRef("exampletopic"),
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("servicebusSubscription", exampleAzurermServicebusNamespace)
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Azure = Pulumi.Azure;

return await Deployment.RunAsync(() => 
{
    var example = Azure.ServiceBus.GetSubscription.Invoke(new()
    {
        Name = "examplesubscription",
        TopicId = "exampletopic",
    });

    return new Dictionary<string, object?>
    {
        ["servicebusSubscription"] = exampleAzurermServicebusNamespace,
    };
});
Copy
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.GetSubscriptionArgs;
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.getSubscription(GetSubscriptionArgs.builder()
            .name("examplesubscription")
            .topicId("exampletopic")
            .build());

        ctx.export("servicebusSubscription", exampleAzurermServicebusNamespace);
    }
}
Copy
variables:
  example:
    fn::invoke:
      function: azure:servicebus:getSubscription
      arguments:
        name: examplesubscription
        topicId: exampletopic
outputs:
  servicebusSubscription: ${exampleAzurermServicebusNamespace}
Copy

Using getSubscription

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 getSubscription(args: GetSubscriptionArgs, opts?: InvokeOptions): Promise<GetSubscriptionResult>
function getSubscriptionOutput(args: GetSubscriptionOutputArgs, opts?: InvokeOptions): Output<GetSubscriptionResult>
Copy
def get_subscription(name: Optional[str] = None,
                     namespace_name: Optional[str] = None,
                     resource_group_name: Optional[str] = None,
                     topic_id: Optional[str] = None,
                     topic_name: Optional[str] = None,
                     opts: Optional[InvokeOptions] = None) -> GetSubscriptionResult
def get_subscription_output(name: Optional[pulumi.Input[str]] = None,
                     namespace_name: Optional[pulumi.Input[str]] = None,
                     resource_group_name: Optional[pulumi.Input[str]] = None,
                     topic_id: Optional[pulumi.Input[str]] = None,
                     topic_name: Optional[pulumi.Input[str]] = None,
                     opts: Optional[InvokeOptions] = None) -> Output[GetSubscriptionResult]
Copy
func LookupSubscription(ctx *Context, args *LookupSubscriptionArgs, opts ...InvokeOption) (*LookupSubscriptionResult, error)
func LookupSubscriptionOutput(ctx *Context, args *LookupSubscriptionOutputArgs, opts ...InvokeOption) LookupSubscriptionResultOutput
Copy

> Note: This function is named LookupSubscription in the Go SDK.

public static class GetSubscription 
{
    public static Task<GetSubscriptionResult> InvokeAsync(GetSubscriptionArgs args, InvokeOptions? opts = null)
    public static Output<GetSubscriptionResult> Invoke(GetSubscriptionInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetSubscriptionResult> getSubscription(GetSubscriptionArgs args, InvokeOptions options)
public static Output<GetSubscriptionResult> getSubscription(GetSubscriptionArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: azure:servicebus/getSubscription:getSubscription
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

Name This property is required. string
Specifies the name of the ServiceBus Subscription.
NamespaceName string

Deprecated: namespace_name will be removed in favour of the property topic_id in version 5.0 of the AzureRM Provider.

ResourceGroupName string

Deprecated: resource_group_name will be removed in favour of the property topic_id in version 5.0 of the AzureRM Provider.

TopicId string
The ID of the ServiceBus Topic where the Service Bus Subscription exists.
TopicName string

Deprecated: topic_name will be removed in favour of the property topic_id in version 5.0 of the AzureRM Provider.

Name This property is required. string
Specifies the name of the ServiceBus Subscription.
NamespaceName string

Deprecated: namespace_name will be removed in favour of the property topic_id in version 5.0 of the AzureRM Provider.

ResourceGroupName string

Deprecated: resource_group_name will be removed in favour of the property topic_id in version 5.0 of the AzureRM Provider.

TopicId string
The ID of the ServiceBus Topic where the Service Bus Subscription exists.
TopicName string

Deprecated: topic_name will be removed in favour of the property topic_id in version 5.0 of the AzureRM Provider.

name This property is required. String
Specifies the name of the ServiceBus Subscription.
namespaceName String

Deprecated: namespace_name will be removed in favour of the property topic_id in version 5.0 of the AzureRM Provider.

resourceGroupName String

Deprecated: resource_group_name will be removed in favour of the property topic_id in version 5.0 of the AzureRM Provider.

topicId String
The ID of the ServiceBus Topic where the Service Bus Subscription exists.
topicName String

Deprecated: topic_name will be removed in favour of the property topic_id in version 5.0 of the AzureRM Provider.

name This property is required. string
Specifies the name of the ServiceBus Subscription.
namespaceName string

Deprecated: namespace_name will be removed in favour of the property topic_id in version 5.0 of the AzureRM Provider.

resourceGroupName string

Deprecated: resource_group_name will be removed in favour of the property topic_id in version 5.0 of the AzureRM Provider.

topicId string
The ID of the ServiceBus Topic where the Service Bus Subscription exists.
topicName string

Deprecated: topic_name will be removed in favour of the property topic_id in version 5.0 of the AzureRM Provider.

name This property is required. str
Specifies the name of the ServiceBus Subscription.
namespace_name str

Deprecated: namespace_name will be removed in favour of the property topic_id in version 5.0 of the AzureRM Provider.

resource_group_name str

Deprecated: resource_group_name will be removed in favour of the property topic_id in version 5.0 of the AzureRM Provider.

topic_id str
The ID of the ServiceBus Topic where the Service Bus Subscription exists.
topic_name str

Deprecated: topic_name will be removed in favour of the property topic_id in version 5.0 of the AzureRM Provider.

name This property is required. String
Specifies the name of the ServiceBus Subscription.
namespaceName String

Deprecated: namespace_name will be removed in favour of the property topic_id in version 5.0 of the AzureRM Provider.

resourceGroupName String

Deprecated: resource_group_name will be removed in favour of the property topic_id in version 5.0 of the AzureRM Provider.

topicId String
The ID of the ServiceBus Topic where the Service Bus Subscription exists.
topicName String

Deprecated: topic_name will be removed in favour of the property topic_id in version 5.0 of the AzureRM Provider.

getSubscription Result

The following output properties are available:

AutoDeleteOnIdle string
The idle interval after which the Subscription is automatically deleted.
BatchedOperationsEnabled bool
Whether batched operations are enabled.
DeadLetteringOnFilterEvaluationError bool
Does the ServiceBus Subscription have dead letter support on filter evaluation exceptions?
DeadLetteringOnMessageExpiration bool
Does the Service Bus Subscription have dead letter support when a message expires?
DefaultMessageTtl string
The Default message timespan to live. 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.
EnableBatchedOperations bool
ForwardDeadLetteredMessagesTo string
The name of a Queue or Topic to automatically forward Dead Letter messages to.
ForwardTo string
The name of a ServiceBus Queue or ServiceBus Topic where messages are automatically forwarded.
Id string
The provider-assigned unique ID for this managed resource.
LockDuration string
The lock duration for the subscription.
MaxDeliveryCount int
The maximum number of deliveries.
Name string
RequiresSession bool
Whether this ServiceBus Subscription supports session.
NamespaceName string

Deprecated: namespace_name will be removed in favour of the property topic_id in version 5.0 of the AzureRM Provider.

ResourceGroupName string

Deprecated: resource_group_name will be removed in favour of the property topic_id in version 5.0 of the AzureRM Provider.

TopicId string
TopicName string

Deprecated: topic_name will be removed in favour of the property topic_id in version 5.0 of the AzureRM Provider.

AutoDeleteOnIdle string
The idle interval after which the Subscription is automatically deleted.
BatchedOperationsEnabled bool
Whether batched operations are enabled.
DeadLetteringOnFilterEvaluationError bool
Does the ServiceBus Subscription have dead letter support on filter evaluation exceptions?
DeadLetteringOnMessageExpiration bool
Does the Service Bus Subscription have dead letter support when a message expires?
DefaultMessageTtl string
The Default message timespan to live. 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.
EnableBatchedOperations bool
ForwardDeadLetteredMessagesTo string
The name of a Queue or Topic to automatically forward Dead Letter messages to.
ForwardTo string
The name of a ServiceBus Queue or ServiceBus Topic where messages are automatically forwarded.
Id string
The provider-assigned unique ID for this managed resource.
LockDuration string
The lock duration for the subscription.
MaxDeliveryCount int
The maximum number of deliveries.
Name string
RequiresSession bool
Whether this ServiceBus Subscription supports session.
NamespaceName string

Deprecated: namespace_name will be removed in favour of the property topic_id in version 5.0 of the AzureRM Provider.

ResourceGroupName string

Deprecated: resource_group_name will be removed in favour of the property topic_id in version 5.0 of the AzureRM Provider.

TopicId string
TopicName string

Deprecated: topic_name will be removed in favour of the property topic_id in version 5.0 of the AzureRM Provider.

autoDeleteOnIdle String
The idle interval after which the Subscription is automatically deleted.
batchedOperationsEnabled Boolean
Whether batched operations are enabled.
deadLetteringOnFilterEvaluationError Boolean
Does the ServiceBus Subscription have dead letter support on filter evaluation exceptions?
deadLetteringOnMessageExpiration Boolean
Does the Service Bus Subscription have dead letter support when a message expires?
defaultMessageTtl String
The Default message timespan to live. 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.
enableBatchedOperations Boolean
forwardDeadLetteredMessagesTo String
The name of a Queue or Topic to automatically forward Dead Letter messages to.
forwardTo String
The name of a ServiceBus Queue or ServiceBus Topic where messages are automatically forwarded.
id String
The provider-assigned unique ID for this managed resource.
lockDuration String
The lock duration for the subscription.
maxDeliveryCount Integer
The maximum number of deliveries.
name String
requiresSession Boolean
Whether this ServiceBus Subscription supports session.
namespaceName String

Deprecated: namespace_name will be removed in favour of the property topic_id in version 5.0 of the AzureRM Provider.

resourceGroupName String

Deprecated: resource_group_name will be removed in favour of the property topic_id in version 5.0 of the AzureRM Provider.

topicId String
topicName String

Deprecated: topic_name will be removed in favour of the property topic_id in version 5.0 of the AzureRM Provider.

autoDeleteOnIdle string
The idle interval after which the Subscription is automatically deleted.
batchedOperationsEnabled boolean
Whether batched operations are enabled.
deadLetteringOnFilterEvaluationError boolean
Does the ServiceBus Subscription have dead letter support on filter evaluation exceptions?
deadLetteringOnMessageExpiration boolean
Does the Service Bus Subscription have dead letter support when a message expires?
defaultMessageTtl string
The Default message timespan to live. 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.
enableBatchedOperations boolean
forwardDeadLetteredMessagesTo string
The name of a Queue or Topic to automatically forward Dead Letter messages to.
forwardTo string
The name of a ServiceBus Queue or ServiceBus Topic where messages are automatically forwarded.
id string
The provider-assigned unique ID for this managed resource.
lockDuration string
The lock duration for the subscription.
maxDeliveryCount number
The maximum number of deliveries.
name string
requiresSession boolean
Whether this ServiceBus Subscription supports session.
namespaceName string

Deprecated: namespace_name will be removed in favour of the property topic_id in version 5.0 of the AzureRM Provider.

resourceGroupName string

Deprecated: resource_group_name will be removed in favour of the property topic_id in version 5.0 of the AzureRM Provider.

topicId string
topicName string

Deprecated: topic_name will be removed in favour of the property topic_id in version 5.0 of the AzureRM Provider.

auto_delete_on_idle str
The idle interval after which the Subscription is automatically deleted.
batched_operations_enabled bool
Whether batched operations are enabled.
dead_lettering_on_filter_evaluation_error bool
Does the ServiceBus Subscription have dead letter support on filter evaluation exceptions?
dead_lettering_on_message_expiration bool
Does the Service Bus Subscription have dead letter support when a message expires?
default_message_ttl str
The Default message timespan to live. 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.
enable_batched_operations bool
forward_dead_lettered_messages_to str
The name of a Queue or Topic to automatically forward Dead Letter messages to.
forward_to str
The name of a ServiceBus Queue or ServiceBus Topic where messages are automatically forwarded.
id str
The provider-assigned unique ID for this managed resource.
lock_duration str
The lock duration for the subscription.
max_delivery_count int
The maximum number of deliveries.
name str
requires_session bool
Whether this ServiceBus Subscription supports session.
namespace_name str

Deprecated: namespace_name will be removed in favour of the property topic_id in version 5.0 of the AzureRM Provider.

resource_group_name str

Deprecated: resource_group_name will be removed in favour of the property topic_id in version 5.0 of the AzureRM Provider.

topic_id str
topic_name str

Deprecated: topic_name will be removed in favour of the property topic_id in version 5.0 of the AzureRM Provider.

autoDeleteOnIdle String
The idle interval after which the Subscription is automatically deleted.
batchedOperationsEnabled Boolean
Whether batched operations are enabled.
deadLetteringOnFilterEvaluationError Boolean
Does the ServiceBus Subscription have dead letter support on filter evaluation exceptions?
deadLetteringOnMessageExpiration Boolean
Does the Service Bus Subscription have dead letter support when a message expires?
defaultMessageTtl String
The Default message timespan to live. 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.
enableBatchedOperations Boolean
forwardDeadLetteredMessagesTo String
The name of a Queue or Topic to automatically forward Dead Letter messages to.
forwardTo String
The name of a ServiceBus Queue or ServiceBus Topic where messages are automatically forwarded.
id String
The provider-assigned unique ID for this managed resource.
lockDuration String
The lock duration for the subscription.
maxDeliveryCount Number
The maximum number of deliveries.
name String
requiresSession Boolean
Whether this ServiceBus Subscription supports session.
namespaceName String

Deprecated: namespace_name will be removed in favour of the property topic_id in version 5.0 of the AzureRM Provider.

resourceGroupName String

Deprecated: resource_group_name will be removed in favour of the property topic_id in version 5.0 of the AzureRM Provider.

topicId String
topicName String

Deprecated: topic_name will be removed in favour of the property topic_id in version 5.0 of the AzureRM Provider.

Package Details

Repository
Azure Classic pulumi/pulumi-azure
License
Apache-2.0
Notes
This Pulumi package is based on the azurerm Terraform Provider.

We recommend using Azure Native.

Azure v6.22.0 published on Tuesday, Apr 1, 2025 by Pulumi