Share via


Subscriptions - Get

Returns a subscription description for the specified topic.

GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/subscriptions/{subscriptionName}?api-version=2024-01-01

URI Parameters

Name In Required Type Description
namespaceName
path True

string

minLength: 6
maxLength: 50

The namespace name

resourceGroupName
path True

string

minLength: 1
maxLength: 90

The name of the resource group. The name is case insensitive.

subscriptionId
path True

string

Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.

subscriptionName
path True

string

minLength: 1
maxLength: 50

The subscription name.

topicName
path True

string

minLength: 1

The topic name.

api-version
query True

string

minLength: 1

The API version to use for this operation.

Responses

Name Type Description
200 OK

SBSubscription

Successfully retrieved subscription description.

Other Status Codes

ErrorResponse

ServiceBus error response describing why the operation failed.

Security

azure_auth

Azure Active Directory OAuth2 Flow

Type: oauth2
Flow: implicit
Authorization URL: https://login.microsoftonline.com/common/oauth2/authorize

Scopes

Name Description
user_impersonation impersonate your user account

Examples

SubscriptionGet

Sample request

GET https://management.azure.com/subscriptions/Subscriptionid/resourceGroups/ResourceGroup/providers/Microsoft.ServiceBus/namespaces/sdk-Namespace-1349/topics/sdk-Topics-8740/subscriptions/sdk-Subscriptions-2178?api-version=2024-01-01

Sample response

{
  "id": "/subscriptions/Subscriptionid/resourceGroups/ResourceGroup/providers/Microsoft.ServiceBus/namespaces/sdk-Namespace-1349/topics/sdk-Topics-8740/subscriptions/sdk-Subscriptions-2178",
  "name": "sdk-Subscriptions-2178",
  "type": "Microsoft.ServiceBus/Namespaces/Topics/Subscriptions",
  "properties": {
    "lockDuration": "PT1M",
    "requiresSession": false,
    "defaultMessageTimeToLive": "P10675199DT2H48M5.4775807S",
    "deadLetteringOnMessageExpiration": true,
    "deadLetteringOnFilterEvaluationExceptions": true,
    "messageCount": 0,
    "maxDeliveryCount": 10,
    "status": "Active",
    "enableBatchedOperations": true,
    "createdAt": "2021-01-04T18:02:20.5992764Z",
    "updatedAt": "2021-01-04T18:02:20.5992764Z",
    "accessedAt": "2021-01-04T18:02:20.5992764Z",
    "countDetails": {
      "activeMessageCount": 0,
      "deadLetterMessageCount": 0,
      "scheduledMessageCount": 0,
      "transferMessageCount": 0,
      "transferDeadLetterMessageCount": 0
    },
    "autoDeleteOnIdle": "P10675199DT2H48M5.4775807S",
    "forwardTo": "sdk-Topics-3065",
    "forwardDeadLetteredMessagesTo": "sdk-Topics-3065"
  }
}

Definitions

Name Description
createdByType

The type of identity that created the resource.

EntityStatus

Entity status.

Error

The error object.

ErrorAdditionalInfo

The resource management error additional info.

ErrorResponse

The resource management error response.

MessageCountDetails

Message Count Details.

SBClientAffineProperties

Properties specific to client affine subscriptions.

SBSubscription

Description of subscription resource.

systemData

Metadata pertaining to creation and last modification of the resource.

createdByType

The type of identity that created the resource.

Value Description
User
Application
ManagedIdentity
Key

EntityStatus

Entity status.

Value Description
Active
Disabled
Restoring
SendDisabled
ReceiveDisabled
Creating
Deleting
Renaming
Unknown

Error

The error object.

Name Type Description
additionalInfo

ErrorAdditionalInfo[]

The error additional info.

code

string

The error code.

details

ErrorResponse[]

The error details.

message

string

The error message.

target

string

The error target.

ErrorAdditionalInfo

The resource management error additional info.

Name Type Description
info

object

The additional info.

type

string

The additional info type.

ErrorResponse

The resource management error response.

Name Type Description
error

Error

The error object.

MessageCountDetails

Message Count Details.

Name Type Description
activeMessageCount

integer (int64)

Number of active messages in the queue, topic, or subscription.

deadLetterMessageCount

integer (int64)

Number of messages that are dead lettered.

scheduledMessageCount

integer (int64)

Number of scheduled messages.

transferDeadLetterMessageCount

integer (int64)

Number of messages transferred into dead letters.

transferMessageCount

integer (int64)

Number of messages transferred to another queue, topic, or subscription.

SBClientAffineProperties

Properties specific to client affine subscriptions.

Name Type Description
clientId

string

Indicates the Client ID of the application that created the client-affine subscription.

isDurable

boolean

For client-affine subscriptions, this value indicates whether the subscription is durable or not.

isShared

boolean

For client-affine subscriptions, this value indicates whether the subscription is shared or not.

SBSubscription

Description of subscription resource.

Name Type Description
id

string

Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}

location

string

The geo-location where the resource lives

name

string

The name of the resource

properties.accessedAt

string (date-time)

Last time there was a receive request to this subscription.

properties.autoDeleteOnIdle

string (duration)

ISO 8061 timeSpan idle interval after which the topic is automatically deleted. The minimum duration is 5 minutes.

properties.clientAffineProperties

SBClientAffineProperties

Properties specific to client affine subscriptions.

properties.countDetails

MessageCountDetails

Message count details

properties.createdAt

string (date-time)

Exact time the message was created.

properties.deadLetteringOnFilterEvaluationExceptions

boolean

Value that indicates whether a subscription has dead letter support on filter evaluation exceptions.

properties.deadLetteringOnMessageExpiration

boolean

Value that indicates whether a subscription has dead letter support when a message expires.

properties.defaultMessageTimeToLive

string (duration)

ISO 8061 Default message timespan to live value. 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.

properties.duplicateDetectionHistoryTimeWindow

string (duration)

ISO 8601 timeSpan structure that defines the duration of the duplicate detection history. The default value is 10 minutes.

properties.enableBatchedOperations

boolean

Value that indicates whether server-side batched operations are enabled.

properties.forwardDeadLetteredMessagesTo

string

Queue/Topic name to forward the Dead Letter message

properties.forwardTo

string

Queue/Topic name to forward the messages

properties.isClientAffine

boolean

Value that indicates whether the subscription has an affinity to the client id.

properties.lockDuration

string (duration)

ISO 8061 lock duration timespan for the subscription. The default value is 1 minute.

properties.maxDeliveryCount

integer (int32)

Number of maximum deliveries.

properties.messageCount

integer (int64)

Number of messages.

properties.requiresSession

boolean

Value indicating if a subscription supports the concept of sessions.

properties.status

EntityStatus

Enumerates the possible values for the status of a messaging entity.

properties.updatedAt

string (date-time)

The exact time the message was updated.

systemData

systemData

The system meta data relating to this resource.

type

string

The type of the resource. E.g. "Microsoft.EventHub/Namespaces" or "Microsoft.EventHub/Namespaces/EventHubs"

systemData

Metadata pertaining to creation and last modification of the resource.

Name Type Description
createdAt

string (date-time)

The timestamp of resource creation (UTC).

createdBy

string

The identity that created the resource.

createdByType

createdByType

The type of identity that created the resource.

lastModifiedAt

string (date-time)

The type of identity that last modified the resource.

lastModifiedBy

string

The identity that last modified the resource.

lastModifiedByType

createdByType

The type of identity that last modified the resource.