Set up a connector of type 'Service Bus queue'. Use this connector type to exchange information via an Azure Service bus queue or topic.

You can use the 'Service Bus queue' connector to:
  • Export data:
    Use a Connectivity studio export message to send messages to the applicable Service Bus queue or Service Bus topic. The export message must have the 'Service Bus queue' connector as target connector.
    On export, each message that is sent to a queue or topic is logged in the 'Data sent to queue' history table.
  • Import data:
    1. Run 'Receive queue data' to receive messages from a Service Bus queue or a Service Bus topic subscription. The received messages are added to the 'Received data from queue' table in Connectivity studio.
      These receive modes are supported: 'Receive and delete' and 'Peek lock'.
    2. Run import messages to read data from the 'Received data from queue' table and import this data into D365 FO. The import message must have the 'Service Bus queue' connector as source connector.

The related document defines which data is sent to or received from a queue or topic and in which format and structure. So, the document does not result in a file.

With the 'Service Bus queue' connector, you can use these external file-based documents: EDI, Fixed text, Text, XML, JSON. You can only use this connector in combination with a document for which the version 3 (V3) handler class is selected.


Standard procedure

1. Click Connectivity studio Integration Design.
2. Click the Connectors tab.
3. Click New.
4. In the Connector field, type a value.
 

Note: You are advised to not include, in the connector name, the name of the application to which you connect. Use the Application field to define the applicable application for the connector.

5. In the Project field, enter or select a value.
6. Define the applicable application for the connector. For a web service connector, for example, select a 'Service Bus' application.
  In the Application field, enter or select a value.
 

Note:
- You can only select an application that is defined for the applicable project. You can define project applications on the Projects page.
- You can type any existing application name, whether it is defined as project application or not. If the typed application is not defined as project application, it is automatically added to the project applications.

7. In the Connector type field, select 'Service bus queue'.
8. Sub-task: Set properties.
  8.1 You can export connectivity setup and import it in another D365 FO environment. For example, you first set up and test the connectivity setup in a development environment. When finished, you deploy the setup in your production environment.
To prevent messing up your production data, use different Service Bus queues or topics for your development or testing environment and for your production environment. To strictly distinguish between different environments, you can define unique connector properties for each of your environment types. Which properties apply to the current environment is defined in the Environment type field on the Connectivity studio parameters. Example: If set to Development, the connector properties as defined for environment type Development are applicable.
  In the Environment types field, select an option.
 

Note: The environment types only apply to connectors of type Database, Azure file storage, Blob storage, SharePoint, or Service Bus queue.

  8.2 Expand the Properties section.
  8.3 In the Service Bus namespace field, enter the name of the Service Bus namespace as created in the Azure portal.
  8.4 The 'Service Bus queue' connector supports these Service Bus entity types:
- Queue: Queues provide First In, First Out (FIFO) message delivery to one or more competing consumers. That is, receivers typically receive and process messages in the order in which they were added to the queue. And only one message consumer receives and processes each message.
- Topic and subscriptions: Topics and subscriptions provide a one-to-many form of communication in a publish and subscribe pattern. It's useful for scaling to large numbers of recipients. Each published message is made available to each subscription registered with the topic. Publisher sends a message to a topic and one or more subscribers receive a copy of the message, depending on filter rules set on these subscriptions.
  In the Service bus type field, select an option.
 

Note:
If you use a Service Bus:
- Queue, only fill in the Entity name field.
- Topic, fill in both the Entity name field and the Subscription field.

  8.5 In the Entity name field, enter the name of the Service Bus queue or Service Bus topic as created for the applicable Service Bus in the Azure portal.
  8.6 In the Subscription field, enter the name of the Service bus topic subscription as created in the Azure portal.
  8.7 In the Policy name field, enter the name of the Shared access signature (SAS) policy that is used to access the Service Bus queue or topic.
  8.8 Enter the policy key or policy key reference of the Shared access signature (SAS) policy that is used to access the Service Bus queue or topic.
Whether the policy key or policy key reference applies is defined by the Display secret field in the Connectivity studio parameters.
If the Display secret parameter is set to:
- Secret, fill in the Policy key field with the primary key of the Shared access signature (SAS) policy. The policy key is specific for the current connector.
- Secret reference, fill in the Policy key reference field with the desired secret reference. The policy key reference refers to the centrally stored primary key of the Shared access signature (SAS) policy which makes updating secrets easier.
- Both, fill in either the Policy key field or the Policy key reference field.
  In the Policy key field, or in the Policy key reference field, type a value.
9. Sub-task: Set write options.
  9.1 Expand the Write section.
  9.2 A Service Bus queue or topic message has a Content field. On write (creation of the message), you can fill this field to provide some extra information about the content of the message.
You can use one of these types of information as content of the message:
- Message ID: The name of the applicable message.
- Document ID: the name of the applicable document.
- Root record: the name of the root record as defined in the applicable document.
- Write filename: The Write filename as defined on the header of the applicable document.
- Read filename: The Read filename as defined on the header of the applicable document.
  In the Content info field, select an option.
  9.3 A Service Bus queue or topic message has a Subject field. On write (creation of the message), you can fill this field to provide some extra information about the subject of the message.
You can use one of these types of information as subject of the message:
- Message ID: The name of the applicable message.
- Document ID: the name of the applicable document.
- Root record: the name of the root record as defined in the applicable document.
- Write filename: The Write filename as defined on the header of the applicable document.
- Read filename: The Read filename as defined on the header of the applicable document.
  In the Subject info field, select an option.
10. Sub-task: Select custom handler.
  10.1 Expand the Custom section.
  10.2 For a 'Service Bus queue' type connector, the standard handler class is BisConnectorStreamSBQueue. This handler class exports data to or imports data from an Azure Service Bus queue or topic.
You can use a customized handler class. To do so, extend the standard handler class.
  In the Handler field, enter or select a value.
11. Sub-task: Set advanced options.
  11.1 Expand the Advanced options section.
  11.2 A document can have a query for which cross-company is enabled. If a user, with access to a restricted set of companies, runs a message that uses the document, the cross-company option does not work. If you have this scenario, make sure the cross-company option is enabled for the used connector. Otherwise, you can disable the cross-company option.
  Select Yes in the Cross company disabled field.
12. Close the page.

Notes

You can test the connection. To do so, on the Connectors page, in the Action Pane, on the Development tab, click Test connection.

See also

Provide feedback