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

We recommend using Azure Native.

Azure Classic v5.70.0 published on Wednesday, Mar 27, 2024 by Pulumi

azure.servicebus.getSubscription

Explore with Pulumi AI

azure logo

We recommend using Azure Native.

Azure Classic v5.70.0 published on Wednesday, Mar 27, 2024 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;
    
    import pulumi
    import pulumi_azure as azure
    
    example = azure.servicebus.get_subscription(name="examplesubscription",
        topic_id="exampletopic")
    pulumi.export("servicebusSubscription", example_azurerm_servicebus_namespace)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-azure/sdk/v5/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
    	})
    }
    
    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,
        };
    });
    
    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);
        }
    }
    
    variables:
      example:
        fn::invoke:
          Function: azure:servicebus:getSubscription
          Arguments:
            name: examplesubscription
            topicId: exampletopic
    outputs:
      servicebusSubscription: ${exampleAzurermServicebusNamespace}
    

    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>
    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]
    func LookupSubscription(ctx *Context, args *LookupSubscriptionArgs, opts ...InvokeOption) (*LookupSubscriptionResult, error)
    func LookupSubscriptionOutput(ctx *Context, args *LookupSubscriptionOutputArgs, opts ...InvokeOption) LookupSubscriptionResultOutput

    > 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)
    }
    public static CompletableFuture<GetSubscriptionResult> getSubscription(GetSubscriptionArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: azure:servicebus/getSubscription:getSubscription
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Name string
    Specifies the name of the ServiceBus Subscription.
    NamespaceName string
    The name of the ServiceBus Namespace.

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

    ResourceGroupName string
    Specifies the name of the Resource Group where the ServiceBus Namespace exists.

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

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

    The name of the ServiceBus Topic.

    Note: namespace_nameresource_group_name and topic_name has been deprecated and will be removed in version 4.0 of the provider in favour of topic_id.

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

    Name string
    Specifies the name of the ServiceBus Subscription.
    NamespaceName string
    The name of the ServiceBus Namespace.

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

    ResourceGroupName string
    Specifies the name of the Resource Group where the ServiceBus Namespace exists.

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

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

    The name of the ServiceBus Topic.

    Note: namespace_nameresource_group_name and topic_name has been deprecated and will be removed in version 4.0 of the provider in favour of topic_id.

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

    name String
    Specifies the name of the ServiceBus Subscription.
    namespaceName String
    The name of the ServiceBus Namespace.

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

    resourceGroupName String
    Specifies the name of the Resource Group where the ServiceBus Namespace exists.

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

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

    The name of the ServiceBus Topic.

    Note: namespace_nameresource_group_name and topic_name has been deprecated and will be removed in version 4.0 of the provider in favour of topic_id.

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

    name string
    Specifies the name of the ServiceBus Subscription.
    namespaceName string
    The name of the ServiceBus Namespace.

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

    resourceGroupName string
    Specifies the name of the Resource Group where the ServiceBus Namespace exists.

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

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

    The name of the ServiceBus Topic.

    Note: namespace_nameresource_group_name and topic_name has been deprecated and will be removed in version 4.0 of the provider in favour of topic_id.

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

    name str
    Specifies the name of the ServiceBus Subscription.
    namespace_name str
    The name of the ServiceBus Namespace.

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

    resource_group_name str
    Specifies the name of the Resource Group where the ServiceBus Namespace exists.

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

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

    The name of the ServiceBus Topic.

    Note: namespace_nameresource_group_name and topic_name has been deprecated and will be removed in version 4.0 of the provider in favour of topic_id.

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

    name String
    Specifies the name of the ServiceBus Subscription.
    namespaceName String
    The name of the ServiceBus Namespace.

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

    resourceGroupName String
    Specifies the name of the Resource Group where the ServiceBus Namespace exists.

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

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

    The name of the ServiceBus Topic.

    Note: namespace_nameresource_group_name and topic_name has been deprecated and will be removed in version 4.0 of the provider in favour of topic_id.

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

    getSubscription Result

    The following output properties are available:

    AutoDeleteOnIdle string
    The idle interval after which the topic is automatically deleted.
    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
    Are batched operations enabled on this ServiceBus Subscription?
    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 or not this ServiceBus Subscription supports session.
    NamespaceName string

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

    ResourceGroupName string

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

    TopicId string
    TopicName string

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

    AutoDeleteOnIdle string
    The idle interval after which the topic is automatically deleted.
    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
    Are batched operations enabled on this ServiceBus Subscription?
    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 or not this ServiceBus Subscription supports session.
    NamespaceName string

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

    ResourceGroupName string

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

    TopicId string
    TopicName string

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

    autoDeleteOnIdle String
    The idle interval after which the topic is automatically deleted.
    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
    Are batched operations enabled on this ServiceBus Subscription?
    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 or not this ServiceBus Subscription supports session.
    namespaceName String

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

    resourceGroupName String

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

    topicId String
    topicName String

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

    autoDeleteOnIdle string
    The idle interval after which the topic is automatically deleted.
    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
    Are batched operations enabled on this ServiceBus Subscription?
    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 or not this ServiceBus Subscription supports session.
    namespaceName string

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

    resourceGroupName string

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

    topicId string
    topicName string

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

    auto_delete_on_idle str
    The idle interval after which the topic is automatically deleted.
    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
    Are batched operations enabled on this ServiceBus Subscription?
    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 or not this ServiceBus Subscription supports session.
    namespace_name str

    Deprecated:namespace_name will be removed in favour of the property topic_id in version 4.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 4.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 4.0 of the AzureRM Provider.

    autoDeleteOnIdle String
    The idle interval after which the topic is automatically deleted.
    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
    Are batched operations enabled on this ServiceBus Subscription?
    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 or not this ServiceBus Subscription supports session.
    namespaceName String

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

    resourceGroupName String

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

    topicId String
    topicName String

    Deprecated:topic_name will be removed in favour of the property topic_id in version 4.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.
    azure logo

    We recommend using Azure Native.

    Azure Classic v5.70.0 published on Wednesday, Mar 27, 2024 by Pulumi