Skip to content

Commit

Permalink
Merge pull request #28277 from Ja-Dunn/connectors-create-api-servicebus
Browse files Browse the repository at this point in the history
edit pass: connectors-create-api-service-bus
  • Loading branch information
ShawnJackson authored Aug 9, 2016
2 parents b37db2a + e8f2cbb commit e293470
Show file tree
Hide file tree
Showing 4 changed files with 100 additions and 111 deletions.
166 changes: 79 additions & 87 deletions articles/connectors/connectors-create-api-servicebus.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<properties
pageTitle="Learn to use the Azure Service Bus connector in your logic apps.| Microsoft Azure"
description="Create logic apps with Azure App service. Connect to Azure Service Bus to send and receive messages. You can perform actions such as send to queue, send to topic, receive from queue, receive from subscription, etc."
services="logic-apps"
pageTitle="Learn to use the Azure Service Bus connector in your logic apps | Microsoft Azure"
description="Create logic apps with Azure App service. Connect to Azure Service Bus to send and receive messages. You can perform actions such as send to queue, send to topic, receive from queue, and receive from subscription."
services="logic-apps"
documentationCenter=".net,nodejs,java"
authors="msftman"
manager="erikre"
authors="msftman"
manager="erikre"
editor=""
tags="connectors" />

Expand All @@ -19,172 +19,164 @@ ms.author="deonhe"/>

# Get started with the Azure Service Bus connector

Connect to Azure Service Bus to send and receive messages. You can perform actions such as send to queue, send to topic, receive from queue, receive from subscription, etc.
Connect to Azure Service Bus to send and receive messages. You can perform actions such as send to queue, send to topic, receive from queue, and receive from subscription.

To use [any connector](./apis-list.md), you first need to create a logic app. You can get started by [creating a logic app now](../app-service-logic/app-service-logic-create-a-logic-app.md).

## Connect to Azure Service Bus
## Connect to Service Bus

Before your logic app can access any service, you first need to create a *connection* to the service. A [connection](./connectors-overview.md) provides connectivity between a logic app and another service.

### Create a connection to Azure Service Bus
Before your logic app can access any service, you first need to create a connection to the service. A [connection](./connectors-overview.md) provides connectivity between a logic app and another service.

>[AZURE.INCLUDE [Steps to create a connection to Azure Service Bus](../../includes/connectors-create-api-servicebus.md)]
## Use a Azure Service Bus trigger
## Use a Service Bus trigger

A trigger is an event that can be used to start the workflow defined in a logic app. [Learn more about triggers](../app-service-logic/app-service-logic-what-are-logic-apps.md#logic-app-concepts).

>[AZURE.INCLUDE [Steps to create a Service Bus trigger](../../includes/connectors-create-api-servicebus-trigger.md)]
## Use a Azure Service Bus action
## Use a Service Bus action

An action is an operation carried out by the workflow defined in a logic app. [Learn more about actions](../app-service-logic/app-service-logic-what-are-logic-apps.md#logic-app-concepts).

[AZURE.INCLUDE [Steps to create a Service Bus action](../../includes/connectors-create-api-servicebus-action.md)]

## Technical details

Here are the details about the triggers, actions and responses that this connection supports:
Here are the details about the triggers, actions, and responses that this connection supports.

## Azure Service Bus triggers
### Service Bus triggers

Azure Service Bus has the following trigger(s):
Service Bus has the following triggers:

|Trigger | Description|
|--- | ---|
|[When a message is received in a queue](connectors-create-api-servicebus.md#when-a-message-is-received-in-a-queue)|This operation triggers a flow when a message is received in a queue.|
|[When a message is received in a topic subscription](connectors-create-api-servicebus.md#when-a-message-is-received-in-a-topic-subscription)|This operation triggers a flow when a message is received in a topic subscription.|


## Azure Service Bus actions
### Service Bus actions

Azure Service Bus has the following actions:
Service Bus has the following actions:


|Action|Description|
|--- | ---|
|[Send message](connectors-create-api-servicebus.md#send-message)|This operation sends a message to a queue or topic.|
### Action details

Here are the details for the actions and triggers for this connector, along with their responses:
### Action and trigger details

Here are the details for the actions and triggers for this connector, along with their responses.


### Send message
This operation sends a message to a queue or topic.

#### Send message

|Property name| Display name|Description|
| ---|---|---|
|ContentData*|Content|Content of the message|
|ContentType|Content Type|Content type of the message content|
|Properties|Properties|Key-value pairs for each brokered property|
|entityName*|Queue/Topic name|Name of the queue or topic|
|ContentData*|Content|Content of the message.|
|ContentType|Content Type|Content type of the message content.|
|Properties|Properties|Key-value pairs for each brokered property.|
|entityName*|Queue/Topic name|Name of the queue or topic.|

These advanced parameters are also available:
These advanced parameters are also available:

|Property name| Display name|Description|
| ---|---|---|
|MessageId|Message Id|This is a user-defined value that Service Bus can use to identify duplicate messages, if enabled.|
|To|To|Send to address|
|ReplyTo|Reply To|Address of the queue to reply to|
|ReplyToSessionId|Reply To Session Id|Identifier of the session to reply to|
|Label|Label|Application specific label|
|ScheduledEnqueueTimeUtc|ScheduledEnqueueTimeUtc|Date and time, in UTC, when the message will be added to the queue|
|SessionId|Session Id|Identifier of the session|
|CorrelationId|Correlation Id|Identifier of the correlation|
|TimeToLive|Time To Live|This is the duration, in ticks, that a message is valid. The duration starts from when the message is sent to the Service Bus.|


|MessageId|Message Id|A user-defined value that Service Bus can use to identify duplicate messages, if enabled.|
|To|To|Address to send to.|
|ReplyTo|Reply To|Address of the queue to reply to.|
|ReplyToSessionId|Reply To Session Id|Identifier of the session to reply to.|
|Label|Label|Application-specific label.|
|ScheduledEnqueueTimeUtc|ScheduledEnqueueTimeUtc|Date and time, in UTC, when the message will be added to the queue.|
|SessionId|Session Id|Identifier of the session.|
|CorrelationId|Correlation Id|Identifier of the correlation.|
|TimeToLive|Time To Live|The duration, in ticks, that a message is valid. The duration starts from when the message is sent to Service Bus.|

An * indicates that a property is required


An * indicates that a property is required.


### When a message is received in a queue
This operation triggers a flow when a message is received in a queue.

#### When a message is received in a queue

|Property name| Display name|Description|
| ---|---|---|
|queueName*|Queue name|Name of the queue|
|queueName*|Queue name|Name of the queue.|


An * indicates that a property is required
An * indicates that a property is required.

#### Output details

ServiceBusMessage: This object has the content and properties of a Service Bus Message.
##### Output details

ServiceBusMessage: This object has the content and properties of a Service Bus message.

| Property Name | Data Type | Description |
|---|---|---|
|ContentData|string|Content of the message|
|ContentType|string|Content type of the message content|
|Properties|object|Key-value pairs for each brokered property|
|MessageId|string|This is a user-defined value that Service Bus can use to identify duplicate messages, if enabled.|
|To|string|Send to address|
|ReplyTo|string|Address of the queue to reply to|
|ReplyToSessionId|string|Identifier of the session to reply to|
|Label|string|Application specific label|
|ScheduledEnqueueTimeUtc|string|Date and time, in UTC, when the message will be added to the queue|
|SessionId|string|Identifier of the session|
|CorrelationId|string|Identifier of the correlation|
|TimeToLive|string|This is the duration, in ticks, that a message is valid. The duration starts from when the message is sent to the Service Bus.|

| Property name | Data type | Description |
|---|---|---|
|ContentData|string|Content of the message.|
|ContentType|string|Content type of the message content.|
|Properties|object|Key-value pairs for each brokered property.|
|MessageId|string|A user-defined value that Service Bus can use to identify duplicate messages, if enabled.|
|To|string|Send to address.|
|ReplyTo|string|Address of the queue to reply to.|
|ReplyToSessionId|string|Identifier of the session to reply to.|
|Label|string|Application-specific label.|
|ScheduledEnqueueTimeUtc|string|Date and time, in UTC, when the message will be added to the queue.|
|SessionId|string|Identifier of the session.|
|CorrelationId|string|Identifier of the correlation.|
|TimeToLive|string|The duration, in ticks, that a message is valid. The duration starts from when the message is sent to Service Bus.|



### When a message is received in a topic subscription
This operation triggers a flow when a message is received in a topic subscription.

#### When a message is received in a topic subscription

|Property name| Display name|Description|
| ---|---|---|
|topicName*|Topic name|Name of the topic|
|subscriptionName*|Topic subscription name|Name of the topic subscription|
|topicName*|Topic name|Name of the topic.|
|subscriptionName*|Topic subscription name|Name of the topic subscription.|


An * indicates that a property is required.

An * indicates that a property is required

#### Output details
##### Output details

ServiceBusMessage: This object has the content and properties of a Service Bus Message.
ServiceBusMessage: This object has the content and properties of a Service Bus message.


| Property Name | Data Type | Description |
| Property name | Data type | Description |
|---|---|---|
|ContentData|string|Content of the message|
|ContentType|string|Content type of the message content|
|Properties|object|Key-value pairs for each brokered property|
|MessageId|string|This is a user-defined value that Service Bus can use to identify duplicate messages, if enabled.|
|To|string|Send to address|
|ReplyTo|string|Address of the queue to reply to|
|ReplyToSessionId|string|Identifier of the session to reply to|
|Label|string|Application specific label|
|ScheduledEnqueueTimeUtc|string|Date and time, in UTC, when the message will be added to the queue|
|SessionId|string|Identifier of the session|
|CorrelationId|string|Identifier of the correlation|
|TimeToLive|string|This is the duration, in ticks, that a message is valid. The duration starts from when the message is sent to the Service Bus.|
|ContentData|string|Content of the message.|
|ContentType|string|Content type of the message content.|
|Properties|object|Key-value pairs for each brokered property.|
|MessageId|string|A user-defined value that Service Bus can use to identify duplicate messages, if enabled.|
|To|string|Send to address.|
|ReplyTo|string|Address of the queue to reply to.|
|ReplyToSessionId|string|Identifier of the session to reply to.|
|Label|string|Application-specific label.|
|ScheduledEnqueueTimeUtc|string|Date and time, in UTC, when the message will be added to the queue.|
|SessionId|string|Identifier of the session.|
|CorrelationId|string|Identifier of the correlation.|
|TimeToLive|string|The duration, in ticks, that a message is valid. The duration starts from when the message is sent to Service Bus.|



## HTTP responses
### HTTP responses

The actions and triggers above can return one or more of the following HTTP status codes:
The preceding actions and triggers can return one or more of the following HTTP status codes:

|Name|Description|
|---|---|
|200|OK|
|202|Accepted|
|400|Bad Request|
|400|Bad request|
|401|Unauthorized|
|403|Forbidden|
|404|Not Found|
|500|Internal Server Error. Unknown error occurred.|
|default|Operation Failed.|
|404|Not found|
|500|Internal server error. Unknown error occurred.|
|default|Operation failed.|

## Next steps
[Create a logic app](../app-service-logic/app-service-logic-create-a-logic-app.md)
[Create a logic app](../app-service-logic/app-service-logic-create-a-logic-app.md).
12 changes: 5 additions & 7 deletions includes/connectors-create-api-servicebus-action.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
Now that you have added a trigger, its time to do something interesting with the data that's generated by the trigger. Follow these steps to add a the **Service Bus - Send message** action. This action will send a message to Service Bus.
Now that you have added a trigger, it's time to do something interesting with the data that's generated by the trigger. Follow these steps to add the **Service Bus - Send message** action. This action sends a message to Service Bus.

Follow these steps to create the send message action:

1. Select **+ New step** to add the action.
- Select **Add an action** link. This opens the search box where you can search for any action you would like to take. For this example, Service Bus actions are of interest.
- Select **Add an action**. This opens a search box, where you can search for any action you would like to take. For this example, Service Bus actions are of interest.
![Service Bus action image 1](./media/connectors-create-api-servicebus/action-1.png)
- Enter *service bus* to search for actions related to Service Bus.
- Enter *service bus*.
- Select **Service Bus - Send message** as the action to take.
![Service Bus action image 2](./media/connectors-create-api-servicebus/action-2.png)
- Enter the content for the message. This is required.
- Enter the queue or topic name to which the message will be sent. This is also required.
- Optionally, you can provide other details about the message.
- Provide other details about the message. This is optional.
![Service Bus action image 3](./media/connectors-create-api-servicebus/action-3.png)
- Save the changes to your workflow
- Save the changes to your workflow.
![Service Bus action image 4](./media/connectors-create-api-servicebus/action-4.png)


10 changes: 5 additions & 5 deletions includes/connectors-create-api-servicebus-trigger.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
In this example, I will show you how to use the **Service Bus - When a message is received in a queue** trigger to initiate a logic app workflow when a new item is to a Service Bus queue.
Here's how to use the **Service Bus - When a message is received in a queue** trigger to initiate a logic app workflow when a new item is sent to a Service Bus queue.

>[AZURE.NOTE]You will get prompted to sign with your Service Bus connection string if you have not already created a *connection* to Service Bus.
>[AZURE.NOTE]You will be prompted to sign in with your Service Bus connection string if you have not already created a connection to Service Bus.
1. Enter *service bus* in the search box on the logic apps designer then select the **Service Bus - When a message is received in a queue** trigger.
1. In the search box on the logic apps designer, enter **service bus**. Then select the **Service Bus - When a message is received in a queue** trigger.
![Service Bus trigger image 1](./media/connectors-create-api-servicebus/trigger-1.png)
- The **When a message is received in a queue** control is displayed.
- The **When a message is received in a queue** dialog box is displayed.
![Service Bus trigger image 2](./media/connectors-create-api-servicebus/trigger-2.png)
- Enter the name of the Service Bus queue you would like the trigger to monitor.
![Service Bus trigger image 3](./media/connectors-create-api-servicebus/trigger-3.png)

At this point, your logic app has been configured with a trigger that will begin a run of the other triggers and actions in the workflow when a new item is received in the queue you selected.
At this point, your logic app has been configured with a trigger. When a new item is received in the queue you selected, the trigger will begin a run of the other triggers and actions in the workflow.
23 changes: 11 additions & 12 deletions includes/connectors-create-api-servicebus.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
### Prerequisites

- A [ServiceBus](https://azure.microsoft.com/services/service-bus/) account
You must have a [Service Bus](https://azure.microsoft.com/services/service-bus/) account.

Before you can use your Azure Service Bus account in a logic app, you must authorize the logic app to connect to your service bus account. Fortunately, you can do this easily from within your logic app on the Azure portal.

Before you can use your Azure Service Bus account in a logic app, you must authorize the logic app to connect to your service bus account. Fortunately, you can do this easily from within your logic app on the Azure Portal.
Here are the steps to authorize your logic app to connect to your Service Bus account:

Here are the steps to authorize your logic app to connect to your service bus account:
1. To create a connection to Service Bus, in the logic app designer, select **Show Microsoft managed APIs** in the drop-down list. Then enter **service bus** in the search box. Select the trigger or action you want to use.
![Service Bus connection image 1](./media/connectors-create-api-servicebus/servicebus-1.png)

1. To create a connection to service bus, in the logic app designer, select **Show Microsoft managed APIs** in the drop down list then enter *service bus* in the search box.Select the trigger or action you'll like to use:
![Service bus connection image 1](./media/connectors-create-api-servicebus/servicebus-1.png)

2. If you haven't created any connections to service bus before, you'll get prompted to provide your service bus credentials. These credentials will be used to authorize your logic app to connect to, and access your service bus account's data. The service bus connector needs the connection string for the service bus namespace - and it also requires **Manage** permissions. A good way to know if your connection string is for the namespace or a specific entity is if it contains the `EntityPath` parameter, it is not the right connection string for a logic app.
![Service bus connection string](./media/connectors-create-api-servicebus/connectionstring.png)
2. If you haven't created any connections to Service Bus before, you'll be prompted to provide your Service Bus credentials. These credentials are used to authorize your logic app to connect to and access your Service Bus account's data. The Service Bus connector needs the connection string for the Service Bus namespace. It also requires **Manage** permissions. A good way to know if your connection string is for the namespace or a specific entity is if it contains the `EntityPath` parameter. If it does, it is not the right connection string for a logic app.
![Service Bus connection string](./media/connectors-create-api-servicebus/connectionstring.png)

1. Once you have received the connection string for the namespace, you can use it for the API Connection in Logic Apps.
![Service bus connection image 2](./media/connectors-create-api-servicebus/servicebus-2.png)
1. After you have received the connection string for the namespace, you can use it for the API connection in Logic Apps.
![Service Bus connection image 2](./media/connectors-create-api-servicebus/servicebus-2.png)

3. Notice the connection has been created and you are now free to proceed with the other steps in your logic app:
![Service bus connection image 3](./media/connectors-create-api-servicebus/servicebus-3.png)
3. Notice the connection has been created, and you are now free to proceed with the other steps in your logic app.
![Service Bus connection image 3](./media/connectors-create-api-servicebus/servicebus-3.png)

0 comments on commit e293470

Please sign in to comment.