ServiceBusAdministrationClient class

All operations return promises that resolve to an object that has the relevant output. These objects also have a property called _response that you can use if you want to access the direct response from the service.

Extends

Constructors

ServiceBusAdministrationClient(string, ServiceBusAdministrationClientOptions)

Initializes a new instance of the ServiceBusAdministrationClient class.

ServiceBusAdministrationClient(string, TokenCredential | NamedKeyCredential, ServiceBusAdministrationClientOptions)

Inherited Properties

pipeline

The pipeline used by this client to make requests

Methods

createQueue(string, CreateQueueOptions)

Creates a queue with given name, configured using the given options

createRule(string, string, string, CorrelationRuleFilter | SqlRuleFilter, OperationOptions)

Creates a rule with given name, configured using the given options.

createRule(string, string, string, CorrelationRuleFilter | SqlRuleFilter, SqlRuleAction, OperationOptions)

Creates a rule with given name, configured using the given options.

createSubscription(string, string, CreateSubscriptionOptions)

Creates a subscription with given name, configured using the given options

createTopic(string, CreateTopicOptions)

Creates a topic with given name, configured using the given options

deleteQueue(string, OperationOptions)

Deletes a queue.

deleteRule(string, string, string, OperationOptions)

Deletes a rule.

deleteSubscription(string, string, OperationOptions)

Deletes a subscription.

deleteTopic(string, OperationOptions)

Deletes a topic.

getNamespaceProperties(OperationOptions)

Returns an object representing the metadata related to a service bus namespace.

getQueue(string, OperationOptions)

Returns an object representing the Queue and its properties. If you want to get the Queue runtime info like message count details, use getQueueRuntimeProperties API.

getQueueRuntimeProperties(string, OperationOptions)

Returns an object representing the Queue runtime info like message count details.

getRule(string, string, string, OperationOptions)

Returns an object representing the Rule with the given name along with all its properties.

getSubscription(string, string, OperationOptions)

Returns an object representing the Subscription and its properties. If you want to get the Subscription runtime info like message count details, use getSubscriptionRuntimeProperties API.

getSubscriptionRuntimeProperties(string, string, OperationOptions)

Returns an object representing the Subscription runtime info like message count details.

getTopic(string, OperationOptions)

Returns an object representing the Topic and its properties. If you want to get the Topic runtime info like subscription count details, use getTopicRuntimeProperties API.

getTopicRuntimeProperties(string, OperationOptions)

Returns an object representing the Topic runtime info like subscription count.

listQueues(OperationOptions)

Returns an async iterable iterator to list all the queues.

.byPage() returns an async iterable iterator to list the queues in pages.

listQueuesRuntimeProperties(OperationOptions)

Returns an async iterable iterator to list runtime info of the queues.

.byPage() returns an async iterable iterator to list runtime info of the queues in pages.

listRules(string, string, OperationOptions)

Returns an async iterable iterator to list all the rules under the specified subscription.

.byPage() returns an async iterable iterator to list the rules in pages.

listSubscriptions(string, OperationOptions)

Returns an async iterable iterator to list all the subscriptions under the specified topic.

.byPage() returns an async iterable iterator to list the subscriptions in pages.

listSubscriptionsRuntimeProperties(string, OperationOptions)

Returns an async iterable iterator to list runtime info of the subscriptions under the specified topic.

.byPage() returns an async iterable iterator to list runtime info of subscriptions in pages.

listTopics(OperationOptions)

Returns an async iterable iterator to list all the topics.

.byPage() returns an async iterable iterator to list the topics in pages.

listTopicsRuntimeProperties(OperationOptions)

Returns an async iterable iterator to list runtime info of the topics.

.byPage() returns an async iterable iterator to list runtime info of the topics in pages.

queueExists(string, OperationOptions)

Checks whether a given queue exists or not.

ruleExists(string, string, string, OperationOptions)

Checks whether a given rule exists or not.

subscriptionExists(string, string, OperationOptions)

Checks whether a given subscription exists in the topic or not.

topicExists(string, OperationOptions)

Checks whether a given topic exists or not.

updateQueue(WithResponse<QueueProperties>, OperationOptions)

Updates the queue based on the queue properties provided. All queue properties must be set even though only a subset of them are actually updatable. Therefore, the suggested flow is to use the output from getQueue(), update the desired properties in it, and then pass the modified object to updateQueue().

The properties that cannot be updated are marked as readonly in the QueueProperties interface.

updateRule(string, string, WithResponse<RuleProperties>, OperationOptions)

Updates properties on the Rule by the given name based on the given options. All rule properties must be set even if one of them is being updated. Therefore, the suggested flow is to use the output from getRule(), update the desired properties in it, and then pass the modified object to updateRule().

updateSubscription(WithResponse<SubscriptionProperties>, OperationOptions)

Updates the subscription based on the subscription properties provided. All subscription properties must be set even though only a subset of them are actually updatable. Therefore, the suggested flow is to use the output from getSubscription(), update the desired properties in it, and then pass the modified object to updateSubscription().

The properties that cannot be updated are marked as readonly in the SubscriptionProperties interface.

updateTopic(WithResponse<TopicProperties>, OperationOptions)

Updates the topic based on the topic properties provided. All topic properties must be set even though only a subset of them are actually updatable. Therefore, the suggested flow is to use the output from getTopic(), update the desired properties in it, and then pass the modified object to updateTopic().

The properties that cannot be updated are marked as readonly in the TopicProperties interface.

Inherited Methods

sendOperationRequest<T>(OperationArguments, OperationSpec)

Send an HTTP request that is populated using the provided OperationSpec.

sendRequest(PipelineRequest)

Send the provided httpRequest.

Constructor Details

ServiceBusAdministrationClient(string, ServiceBusAdministrationClientOptions)

Initializes a new instance of the ServiceBusAdministrationClient class.

new ServiceBusAdministrationClient(connectionString: string, options?: ServiceBusAdministrationClientOptions)

Parameters

connectionString

string

The connection string needed for the client to connect to Azure.

options
ServiceBusAdministrationClientOptions

PipelineOptions

ServiceBusAdministrationClient(string, TokenCredential | NamedKeyCredential, ServiceBusAdministrationClientOptions)

new ServiceBusAdministrationClient(fullyQualifiedNamespace: string, credential: TokenCredential | NamedKeyCredential, options?: ServiceBusAdministrationClientOptions)

Parameters

fullyQualifiedNamespace

string

The fully qualified namespace of your Service Bus instance which is likely to be similar to .servicebus.windows.net.

credential

TokenCredential | NamedKeyCredential

A credential object used by the client to get the token to authenticate the connection with the Azure Service Bus. See @azure/identity for creating the credentials. If you're using your own implementation of the TokenCredential interface against AAD, then set the "scopes" for service-bus to be ["https://servicebus.azure.net//user_impersonation"] to get the appropriate token. Use the AzureNamedKeyCredential from @azure/core-auth if you want to pass in a SharedAccessKeyName and SharedAccessKey without using a connection string. These fields map to the name and key field respectively in AzureNamedKeyCredential.

options
ServiceBusAdministrationClientOptions

PipelineOptions

Inherited Property Details

pipeline

The pipeline used by this client to make requests

pipeline: Pipeline

Property Value

Inherited From ServiceClient.pipeline

Method Details

createQueue(string, CreateQueueOptions)

Creates a queue with given name, configured using the given options

function createQueue(queueName: string, options?: CreateQueueOptions): Promise<WithResponse<QueueProperties>>

Parameters

queueName

string

options
CreateQueueOptions

Options to configure the Queue being created(For example, you can configure a queue to support partitions or sessions) and the operation options that can be used to abort, trace and control other configurations on the HTTP request.

Following are errors that can be expected from this operation

Returns

createRule(string, string, string, CorrelationRuleFilter | SqlRuleFilter, OperationOptions)

Creates a rule with given name, configured using the given options.

function createRule(topicName: string, subscriptionName: string, ruleName: string, ruleFilter: CorrelationRuleFilter | SqlRuleFilter, operationOptions?: OperationOptions): Promise<WithResponse<RuleProperties>>

Parameters

topicName

string

subscriptionName

string

ruleName

string

ruleFilter

CorrelationRuleFilter | SqlRuleFilter

Defines the filter expression that the rule evaluates.

operationOptions
OperationOptions

The options that can be used to abort, trace and control other configurations on the HTTP request.

Following are errors that can be expected from this operation

Returns

createRule(string, string, string, CorrelationRuleFilter | SqlRuleFilter, SqlRuleAction, OperationOptions)

Creates a rule with given name, configured using the given options.

function createRule(topicName: string, subscriptionName: string, ruleName: string, ruleFilter: CorrelationRuleFilter | SqlRuleFilter, ruleAction: SqlRuleAction, operationOptions?: OperationOptions): Promise<WithResponse<RuleProperties>>

Parameters

topicName

string

subscriptionName

string

ruleName

string

ruleFilter

CorrelationRuleFilter | SqlRuleFilter

Defines the filter expression that the rule evaluates.

ruleAction
SqlRuleAction

The SQL like expression that can be executed on the message should the associated filter apply.

operationOptions
OperationOptions

The options that can be used to abort, trace and control other configurations on the HTTP request.

Following are errors that can be expected from this operation

Returns

createSubscription(string, string, CreateSubscriptionOptions)

Creates a subscription with given name, configured using the given options

function createSubscription(topicName: string, subscriptionName: string, options?: CreateSubscriptionOptions): Promise<WithResponse<SubscriptionProperties>>

Parameters

topicName

string

subscriptionName

string

options
CreateSubscriptionOptions

Options to configure the Subscription being created(For example, you can configure a Subscription to support partitions or sessions) and the operation options that can be used to abort, trace and control other configurations on the HTTP request.

Following are errors that can be expected from this operation

Returns

createTopic(string, CreateTopicOptions)

Creates a topic with given name, configured using the given options

function createTopic(topicName: string, options?: CreateTopicOptions): Promise<WithResponse<TopicProperties>>

Parameters

topicName

string

options
CreateTopicOptions

Options to configure the Topic being created(For example, you can configure a topic to support partitions) and the operation options that can be used to abort, trace and control other configurations on the HTTP request.

Following are errors that can be expected from this operation

Returns

deleteQueue(string, OperationOptions)

Deletes a queue.

function deleteQueue(queueName: string, operationOptions?: OperationOptions): Promise<{ _response: HttpResponse }>

Parameters

queueName

string

operationOptions
OperationOptions

The options that can be used to abort, trace and control other configurations on the HTTP request.

Following are errors that can be expected from this operation

Returns

Promise<{ _response: HttpResponse }>

deleteRule(string, string, string, OperationOptions)

Deletes a rule.

function deleteRule(topicName: string, subscriptionName: string, ruleName: string, operationOptions?: OperationOptions): Promise<{ _response: HttpResponse }>

Parameters

topicName

string

subscriptionName

string

ruleName

string

operationOptions
OperationOptions

The options that can be used to abort, trace and control other configurations on the HTTP request.

Following are errors that can be expected from this operation

Returns

Promise<{ _response: HttpResponse }>

deleteSubscription(string, string, OperationOptions)

Deletes a subscription.

function deleteSubscription(topicName: string, subscriptionName: string, operationOptions?: OperationOptions): Promise<{ _response: HttpResponse }>

Parameters

topicName

string

subscriptionName

string

operationOptions
OperationOptions

The options that can be used to abort, trace and control other configurations on the HTTP request.

Following are errors that can be expected from this operation

Returns

Promise<{ _response: HttpResponse }>

deleteTopic(string, OperationOptions)

Deletes a topic.

function deleteTopic(topicName: string, operationOptions?: OperationOptions): Promise<{ _response: HttpResponse }>

Parameters

topicName

string

operationOptions
OperationOptions

The options that can be used to abort, trace and control other configurations on the HTTP request.

Following are errors that can be expected from this operation

Returns

Promise<{ _response: HttpResponse }>

getNamespaceProperties(OperationOptions)

Returns an object representing the metadata related to a service bus namespace.

function getNamespaceProperties(operationOptions?: OperationOptions): Promise<WithResponse<NamespaceProperties>>

Parameters

operationOptions
OperationOptions

The options that can be used to abort, trace and control other configurations on the HTTP request.

Returns

getQueue(string, OperationOptions)

Returns an object representing the Queue and its properties. If you want to get the Queue runtime info like message count details, use getQueueRuntimeProperties API.

function getQueue(queueName: string, operationOptions?: OperationOptions): Promise<WithResponse<QueueProperties>>

Parameters

queueName

string

operationOptions
OperationOptions

The options that can be used to abort, trace and control other configurations on the HTTP request.

Following are errors that can be expected from this operation

Returns

getQueueRuntimeProperties(string, OperationOptions)

Returns an object representing the Queue runtime info like message count details.

function getQueueRuntimeProperties(queueName: string, operationOptions?: OperationOptions): Promise<WithResponse<QueueRuntimeProperties>>

Parameters

queueName

string

operationOptions
OperationOptions

The options that can be used to abort, trace and control other configurations on the HTTP request.

Following are errors that can be expected from this operation

Returns

getRule(string, string, string, OperationOptions)

Returns an object representing the Rule with the given name along with all its properties.

function getRule(topicName: string, subscriptionName: string, ruleName: string, operationOptions?: OperationOptions): Promise<WithResponse<RuleProperties>>

Parameters

topicName

string

subscriptionName

string

ruleName

string

operationOptions
OperationOptions

The options that can be used to abort, trace and control other configurations on the HTTP request.

Following are errors that can be expected from this operation

Returns

getSubscription(string, string, OperationOptions)

Returns an object representing the Subscription and its properties. If you want to get the Subscription runtime info like message count details, use getSubscriptionRuntimeProperties API.

function getSubscription(topicName: string, subscriptionName: string, operationOptions?: OperationOptions): Promise<WithResponse<SubscriptionProperties>>

Parameters

topicName

string

subscriptionName

string

operationOptions
OperationOptions

The options that can be used to abort, trace and control other configurations on the HTTP request.

Following are errors that can be expected from this operation

Returns

getSubscriptionRuntimeProperties(string, string, OperationOptions)

Returns an object representing the Subscription runtime info like message count details.

function getSubscriptionRuntimeProperties(topicName: string, subscriptionName: string, operationOptions?: OperationOptions): Promise<WithResponse<SubscriptionRuntimeProperties>>

Parameters

topicName

string

subscriptionName

string

operationOptions
OperationOptions

The options that can be used to abort, trace and control other configurations on the HTTP request.

Following are errors that can be expected from this operation

Returns

getTopic(string, OperationOptions)

Returns an object representing the Topic and its properties. If you want to get the Topic runtime info like subscription count details, use getTopicRuntimeProperties API.

function getTopic(topicName: string, operationOptions?: OperationOptions): Promise<WithResponse<TopicProperties>>

Parameters

topicName

string

operationOptions
OperationOptions

The options that can be used to abort, trace and control other configurations on the HTTP request.

Following are errors that can be expected from this operation

Returns

getTopicRuntimeProperties(string, OperationOptions)

Returns an object representing the Topic runtime info like subscription count.

function getTopicRuntimeProperties(topicName: string, operationOptions?: OperationOptions): Promise<WithResponse<TopicRuntimeProperties>>

Parameters

topicName

string

operationOptions
OperationOptions

The options that can be used to abort, trace and control other configurations on the HTTP request.

Following are errors that can be expected from this operation

Returns

listQueues(OperationOptions)

Returns an async iterable iterator to list all the queues.

.byPage() returns an async iterable iterator to list the queues in pages.

function listQueues(options?: OperationOptions): PagedAsyncIterableIterator<QueueProperties, EntitiesResponse<QueueProperties>, PageSettings>

Parameters

Returns

An asyncIterableIterator that supports paging.

listQueuesRuntimeProperties(OperationOptions)

Returns an async iterable iterator to list runtime info of the queues.

.byPage() returns an async iterable iterator to list runtime info of the queues in pages.

function listQueuesRuntimeProperties(options?: OperationOptions): PagedAsyncIterableIterator<QueueRuntimeProperties, EntitiesResponse<QueueRuntimeProperties>, PageSettings>

Parameters

Returns

An asyncIterableIterator that supports paging.

listRules(string, string, OperationOptions)

Returns an async iterable iterator to list all the rules under the specified subscription.

.byPage() returns an async iterable iterator to list the rules in pages.

function listRules(topicName: string, subscriptionName: string, options?: OperationOptions): PagedAsyncIterableIterator<RuleProperties, EntitiesResponse<RuleProperties>, PageSettings>

Parameters

topicName

string

subscriptionName

string

Returns

An asyncIterableIterator that supports paging.

listSubscriptions(string, OperationOptions)

Returns an async iterable iterator to list all the subscriptions under the specified topic.

.byPage() returns an async iterable iterator to list the subscriptions in pages.

function listSubscriptions(topicName: string, options?: OperationOptions): PagedAsyncIterableIterator<SubscriptionProperties, EntitiesResponse<SubscriptionProperties>, PageSettings>

Parameters

topicName

string

Returns

An asyncIterableIterator that supports paging.

listSubscriptionsRuntimeProperties(string, OperationOptions)

Returns an async iterable iterator to list runtime info of the subscriptions under the specified topic.

.byPage() returns an async iterable iterator to list runtime info of subscriptions in pages.

function listSubscriptionsRuntimeProperties(topicName: string, options?: OperationOptions): PagedAsyncIterableIterator<SubscriptionRuntimeProperties, EntitiesResponse<SubscriptionRuntimeProperties>, PageSettings>

Parameters

topicName

string

Returns

An asyncIterableIterator that supports paging.

listTopics(OperationOptions)

Returns an async iterable iterator to list all the topics.

.byPage() returns an async iterable iterator to list the topics in pages.

function listTopics(options?: OperationOptions): PagedAsyncIterableIterator<TopicProperties, EntitiesResponse<TopicProperties>, PageSettings>

Parameters

Returns

An asyncIterableIterator that supports paging.

listTopicsRuntimeProperties(OperationOptions)

Returns an async iterable iterator to list runtime info of the topics.

.byPage() returns an async iterable iterator to list runtime info of the topics in pages.

function listTopicsRuntimeProperties(options?: OperationOptions): PagedAsyncIterableIterator<TopicRuntimeProperties, EntitiesResponse<TopicRuntimeProperties>, PageSettings>

Parameters

Returns

An asyncIterableIterator that supports paging.

queueExists(string, OperationOptions)

Checks whether a given queue exists or not.

function queueExists(queueName: string, operationOptions?: OperationOptions): Promise<boolean>

Parameters

queueName

string

operationOptions
OperationOptions

The options that can be used to abort, trace and control other configurations on the HTTP request.

Returns

Promise<boolean>

ruleExists(string, string, string, OperationOptions)

Checks whether a given rule exists or not.

function ruleExists(topicName: string, subscriptionName: string, ruleName: string, operationOptions?: OperationOptions): Promise<boolean>

Parameters

topicName

string

subscriptionName

string

ruleName

string

operationOptions
OperationOptions

Returns

Promise<boolean>

subscriptionExists(string, string, OperationOptions)

Checks whether a given subscription exists in the topic or not.

function subscriptionExists(topicName: string, subscriptionName: string, operationOptions?: OperationOptions): Promise<boolean>

Parameters

topicName

string

subscriptionName

string

operationOptions
OperationOptions

The options that can be used to abort, trace and control other configurations on the HTTP request.

Returns

Promise<boolean>

topicExists(string, OperationOptions)

Checks whether a given topic exists or not.

function topicExists(topicName: string, operationOptions?: OperationOptions): Promise<boolean>

Parameters

topicName

string

operationOptions
OperationOptions

The options that can be used to abort, trace and control other configurations on the HTTP request.

Returns

Promise<boolean>

updateQueue(WithResponse<QueueProperties>, OperationOptions)

Updates the queue based on the queue properties provided. All queue properties must be set even though only a subset of them are actually updatable. Therefore, the suggested flow is to use the output from getQueue(), update the desired properties in it, and then pass the modified object to updateQueue().

The properties that cannot be updated are marked as readonly in the QueueProperties interface.

function updateQueue(queue: WithResponse<QueueProperties>, operationOptions?: OperationOptions): Promise<WithResponse<QueueProperties>>

Parameters

queue

WithResponse<QueueProperties>

Object representing the properties of the queue and the raw response. requiresSession, requiresDuplicateDetection, enablePartitioning, and name can't be updated after creating the queue.

operationOptions
OperationOptions

The options that can be used to abort, trace and control other configurations on the HTTP request.

Following are errors that can be expected from this operation

Returns

updateRule(string, string, WithResponse<RuleProperties>, OperationOptions)

Updates properties on the Rule by the given name based on the given options. All rule properties must be set even if one of them is being updated. Therefore, the suggested flow is to use the output from getRule(), update the desired properties in it, and then pass the modified object to updateRule().

function updateRule(topicName: string, subscriptionName: string, rule: WithResponse<RuleProperties>, operationOptions?: OperationOptions): Promise<WithResponse<RuleProperties>>

Parameters

topicName

string

subscriptionName

string

rule

WithResponse<RuleProperties>

Options to configure the Rule being updated and the raw response. For example, you can configure the filter to apply on associated Topic/Subscription.

operationOptions
OperationOptions

The options that can be used to abort, trace and control other configurations on the HTTP request.

Following are errors that can be expected from this operation

Returns

updateSubscription(WithResponse<SubscriptionProperties>, OperationOptions)

Updates the subscription based on the subscription properties provided. All subscription properties must be set even though only a subset of them are actually updatable. Therefore, the suggested flow is to use the output from getSubscription(), update the desired properties in it, and then pass the modified object to updateSubscription().

The properties that cannot be updated are marked as readonly in the SubscriptionProperties interface.

function updateSubscription(subscription: WithResponse<SubscriptionProperties>, operationOptions?: OperationOptions): Promise<WithResponse<SubscriptionProperties>>

Parameters

subscription

WithResponse<SubscriptionProperties>

Object representing the properties of the subscription and the raw response. subscriptionName, topicName, and requiresSession can't be updated after creating the subscription.

operationOptions
OperationOptions

The options that can be used to abort, trace and control other configurations on the HTTP request.

Following are errors that can be expected from this operation

Returns

updateTopic(WithResponse<TopicProperties>, OperationOptions)

Updates the topic based on the topic properties provided. All topic properties must be set even though only a subset of them are actually updatable. Therefore, the suggested flow is to use the output from getTopic(), update the desired properties in it, and then pass the modified object to updateTopic().

The properties that cannot be updated are marked as readonly in the TopicProperties interface.

function updateTopic(topic: WithResponse<TopicProperties>, operationOptions?: OperationOptions): Promise<WithResponse<TopicProperties>>

Parameters

topic

WithResponse<TopicProperties>

Object representing the properties of the topic and the raw response. requiresDuplicateDetection, enablePartitioning, and name can't be updated after creating the topic.

operationOptions
OperationOptions

The options that can be used to abort, trace and control other configurations on the HTTP request.

Following are errors that can be expected from this operation

Returns

Inherited Method Details

sendOperationRequest<T>(OperationArguments, OperationSpec)

Send an HTTP request that is populated using the provided OperationSpec.

function sendOperationRequest<T>(operationArguments: OperationArguments, operationSpec: OperationSpec): Promise<T>

Parameters

operationArguments
OperationArguments

The arguments that the HTTP request's templated values will be populated from.

operationSpec
OperationSpec

The OperationSpec to use to populate the httpRequest.

Returns

Promise<T>

Inherited From ServiceClient.sendOperationRequest

sendRequest(PipelineRequest)

Send the provided httpRequest.

function sendRequest(request: PipelineRequest): Promise<PipelineResponse>

Parameters

request
PipelineRequest

Returns

Promise<PipelineResponse>

Inherited From ServiceClient.sendRequest