Topics - Create Or Update

Creates a topic in the specified namespace.

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

URI Parameters

Name In Required Type Description
namespaceName
path True

string

The namespace name

resourceGroupName
path True

string

Name of the Resource group within the Azure subscription.

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.

topicName
path True

string

The topic name.

api-version
query True

string

Client API version.

Request Body

Name Type Description
properties.autoDeleteOnIdle

string

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

properties.defaultMessageTimeToLive

string

ISO 8601 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

ISO8601 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.enableExpress

boolean

Value that indicates whether Express Entities are enabled. An express topic holds a message in memory temporarily before writing it to persistent storage.

properties.enablePartitioning

boolean

Value that indicates whether the topic to be partitioned across multiple message brokers is enabled.

properties.maxMessageSizeInKilobytes

integer

Maximum size (in KB) of the message payload that can be accepted by the topic. This property is only used in Premium today and default is 1024.

properties.maxSizeInMegabytes

integer

Maximum size of the topic in megabytes, which is the size of the memory allocated for the topic. Default is 1024.

properties.requiresDuplicateDetection

boolean

Value indicating if this topic requires duplicate detection.

properties.status

EntityStatus

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

properties.supportOrdering

boolean

Value that indicates whether the topic supports ordering.

Responses

Name Type Description
200 OK

SBTopic

Topic successfully created.

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

TopicCreate

Sample Request

PUT https://management.azure.com/subscriptions/5f750a97-50d9-4e36-8081-c9ee4c0210d4/resourceGroups/ArunMonocle/providers/Microsoft.ServiceBus/namespaces/sdk-Namespace-1617/topics/sdk-Topics-5488?api-version=2021-11-01

{
  "properties": {
    "enableExpress": true
  }
}

Sample Response

{
  "id": "/subscriptions/5f750a97-50d9-4e36-8081-c9ee4c0210d4/resourceGroups/ArunMonocle/providers/Microsoft.ServiceBus/namespaces/sdk-Namespace-1617/topics/sdk-Topics-5488",
  "name": "sdk-Topics-5488",
  "type": "Microsoft.ServiceBus/Namespaces/Topics",
  "properties": {
    "defaultMessageTimeToLive": "P10675199DT2H48M5.4775807S",
    "maxSizeInMegabytes": 10240,
    "maxMessageSizeInKilobytes": 10240,
    "requiresDuplicateDetection": false,
    "duplicateDetectionHistoryTimeWindow": "PT10M",
    "enableBatchedOperations": true,
    "sizeInBytes": 0,
    "status": "Active",
    "supportOrdering": true,
    "autoDeleteOnIdle": "P10675199DT2H48M5.4775807S",
    "enablePartitioning": false,
    "enableExpress": true,
    "createdAt": "2017-05-26T20:50:34.1Z",
    "updatedAt": "2017-05-26T20:50:34.32Z",
    "accessedAt": "2017-05-26T20:50:34.32Z",
    "subscriptionCount": 0
  }
}

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.

SBTopic

Description of topic resource.

systemData

Metadata pertaining to creation and last modification of the resource.

createdByType

The type of identity that created the resource.

Name Type Description
Application

string

Key

string

ManagedIdentity

string

User

string

EntityStatus

Entity status.

Name Type Description
Active

string

Creating

string

Deleting

string

Disabled

string

ReceiveDisabled

string

Renaming

string

Restoring

string

SendDisabled

string

Unknown

string

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

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

deadLetterMessageCount

integer

Number of messages that are dead lettered.

scheduledMessageCount

integer

Number of scheduled messages.

transferDeadLetterMessageCount

integer

Number of messages transferred into dead letters.

transferMessageCount

integer

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

SBTopic

Description of topic 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

Last time the message was sent, or a request was received, for this topic.

properties.autoDeleteOnIdle

string

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

properties.countDetails

MessageCountDetails

Message count details

properties.createdAt

string

Exact time the message was created.

properties.defaultMessageTimeToLive

string

ISO 8601 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

ISO8601 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.enableExpress

boolean

Value that indicates whether Express Entities are enabled. An express topic holds a message in memory temporarily before writing it to persistent storage.

properties.enablePartitioning

boolean

Value that indicates whether the topic to be partitioned across multiple message brokers is enabled.

properties.maxMessageSizeInKilobytes

integer

Maximum size (in KB) of the message payload that can be accepted by the topic. This property is only used in Premium today and default is 1024.

properties.maxSizeInMegabytes

integer

Maximum size of the topic in megabytes, which is the size of the memory allocated for the topic. Default is 1024.

properties.requiresDuplicateDetection

boolean

Value indicating if this topic requires duplicate detection.

properties.sizeInBytes

integer

Size of the topic, in bytes.

properties.status

EntityStatus

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

properties.subscriptionCount

integer

Number of subscriptions.

properties.supportOrdering

boolean

Value that indicates whether the topic supports ordering.

properties.updatedAt

string

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

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

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.