Skip to content

Commit 86d9080

Browse files
committed
Update metadata, SEO tweaks, and art updates
1 parent 781bb41 commit 86d9080

File tree

7 files changed

+155
-97
lines changed

7 files changed

+155
-97
lines changed

articles/logic-apps/logic-apps-scenario-function-sb-trigger.md

Lines changed: 88 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,92 @@
11
---
22
title: Scenario - Trigger logic apps with Azure Functions and Azure Service Bus | Microsoft Docs
3-
description: Create a function to trigger a logic app by using Azure Functions and Azure Service Bus
4-
services: logic-apps,functions
5-
documentationcenter: .net,nodejs,java
6-
author: jeffhollan
7-
manager: jeconnoc
8-
editor: ''
9-
10-
ms.assetid: 19cbd921-7071-4221-ab86-b44d0fc0ecef
3+
description: Create functions that trigger logic apps by using Azure Functions and Azure Service Bus
4+
services: logic-apps
115
ms.service: logic-apps
12-
ms.devlang: multiple
6+
ms.suite: integration
7+
author: ecfan
8+
ms.reviewer: jehollan, klam, LADocs
139
ms.topic: article
14-
ms.tgt_pltfrm: na
15-
ms.workload: integration
10+
ms.assetid: 19cbd921-7071-4221-ab86-b44d0fc0ecef
1611
ms.date: 05/23/2016
17-
ms.author: LADocs; jehollan
18-
1912
---
20-
# Scenario: Trigger a logic app with Azure Functions and Azure Service Bus
2113

22-
You can use Azure Functions to create a trigger for a logic app when you need to deploy a long-running listener or task. For example, you can create a function that listens in on a queue and then immediately fire a logic app as a push trigger.
14+
# Scenario: Trigger logic apps with Azure Functions and Azure Service Bus
15+
16+
You can use Azure Functions to create a trigger for a logic app
17+
when you need to deploy a long-running listener or task. For example,
18+
you can create a function that listens in on a queue and then
19+
immediately fire a logic app as a push trigger.
20+
21+
## Prerequisites
22+
23+
* An Azure subscription. If you don't have an Azure subscription,
24+
<a href="https://azure.microsoft.com/free/" target="_blank">sign up for a free Azure account</a>.
25+
26+
* Basic knowledge about [how to create logic apps](../logic-apps/quickstart-create-first-logic-app-workflow.md)
27+
28+
* Before you can create an Azure function,
29+
[create a function app](../azure-functions/functions-create-function-app-portal.md).
30+
31+
## Create logic app
32+
33+
In this example, you have a function running for
34+
each logic app that needs to be triggered.
35+
First, create a logic app that has an HTTP request trigger.
36+
The function calls that endpoint whenever a queue message is received.
37+
38+
1. Sign in to the [Azure portal](https://portal.azure.com),
39+
and create blank logic app.
40+
41+
If you're new to logic apps, review
42+
[Quickstart: Create your first logic app](../logic-apps/quickstart-create-first-logic-app-workflow.md).
43+
44+
1. In the search box, enter "http request".
45+
Under the triggers list, select this trigger:
46+
**When a HTTP request is received**
47+
48+
![Select trigger](./media/logic-apps-scenario-function-sb-trigger/when-http-request-received-trigger.png)
2349

24-
## Build the logic app
25-
In this example, you have a function running for each logic app that needs to be triggered. First, create a logic app that has an HTTP request trigger. The function calls that endpoint whenever a queue message is received.
50+
You can optionally specify a JSON schema to use
51+
with the queue message by using a tool like
52+
[jsonschema.net](http://jsonschema.net).
53+
JSON schemas help the Logic App Designer understand
54+
the structure of the data and makes properties easier
55+
for you to select throughout the workflow.
56+
To specify a schema, paste the schema in
57+
the **Request Body JSON Schema** box, for example:
2658

27-
1. Create a logic app.
28-
2. Select the **Manual - When an HTTP Request is Received** trigger.
29-
Optionally, you can specify a JSON schema to use with the queue message by using a tool like [jsonschema.net](http://jsonschema.net). Paste the schema in the trigger. Schemas help the designer understand the shape of the data and flow properties more easily through the workflow.
30-
2. Add any additional steps that you want to occur after a queue message is received. For example, send an email via Office 365.
31-
3. Save the logic app to generate the callback URL for the trigger to this logic app. The URL appears on the trigger card.
59+
![Specify JSON schema](./media/logic-apps-scenario-function-sb-trigger/when-http-request-received-trigger-schema.png)
3260

33-
![The callback URL appears on the trigger card][1]
61+
1. Add any other actions you want to happen after receiving the queue message.
3462

35-
## Build the function
36-
Next, you must create a function that acts as the trigger and listens to the queue.
63+
For example, you can send an email with the Office 365 Outlook connector.
3764

38-
1. In the [Azure Functions portal](https://functions.azure.com/), select **New Function**, and then select the **ServiceBusQueueTrigger - C#** template.
65+
1. Save your logic app, which generates the
66+
callback URL for the trigger in this logic app.
67+
This URL appears in the **HTTP POST URL** property.
68+
69+
![Generated callback URL for trigger](./media/logic-apps-scenario-function-sb-trigger/callback-URL-for-trigger.png)
70+
71+
## Create Azure function
72+
73+
Next, create the function that acts as the trigger and listens to the queue.
74+
75+
1. In the Azure portal, open and expand your function app, if not already open.
76+
77+
1. Under your function app name, expand **Functions**.
78+
On the **Functions** pane, choose **New function**.
79+
Select this template: **Service Bus Queue trigger - C#**
3980

40-
![Azure Functions portal][2]
41-
2. Configure the connection to the Service Bus queue, which uses the Azure Service Bus SDK `OnMessageReceive()` listener.
42-
3. Write a basic function to call the logic app endpoint (created earlier) by using the queue message as a trigger. Here's a full example of a function. The example uses an `application/json` message content type, but you can change this type as necessary.
81+
![Select Azure Functions portal](./media/logic-apps-scenario-function-sb-trigger/newqueuetriggerfunction.png)
82+
83+
1. Provide a name for your trigger, and then configure the
84+
connection to the Service Bus queue, which uses the Azure
85+
Service Bus SDK `OnMessageReceive()` listener.
86+
87+
1. Write a basic function to call the previously created logic app endpoint by using the queue message as a trigger, for example:
4388

44-
```
89+
```CSharp
4590
using System;
4691
using System.Threading.Tasks;
4792
using System.Net.Http;
@@ -51,17 +96,25 @@ Next, you must create a function that acts as the trigger and listens to the que
5196

5297
public static void Run(string myQueueItem, TraceWriter log)
5398
{
54-
5599
log.Info($"C# ServiceBus queue trigger function processed message: {myQueueItem}");
100+
56101
using (var client = new HttpClient())
57102
{
58103
var response = client.PostAsync(logicAppUri, new StringContent(myQueueItem, Encoding.UTF8, "application/json")).Result;
59104
}
60105
}
61106
```
62107

63-
To test, add a queue message via a tool like [Service Bus Explorer](https://github.com/paolosalvatori/ServiceBusExplorer). See the logic app fire immediately after the function receives the message.
108+
This example uses the `application/json` message content type,
109+
but you can change this type as necessary.
110+
111+
1. To test the function, add a queue message by using a tool such as the [Service Bus Explorer](https://github.com/paolosalvatori/ServiceBusExplorer).
112+
113+
The logic app triggers immediately after the
114+
function receives the message.
115+
116+
## Get support
117+
118+
* For questions, visit the [Azure Logic Apps forum](https://social.msdn.microsoft.com/Forums/en-US/home?forum=azurelogicapps).
119+
* To submit or vote on feature ideas, visit the [Logic Apps user feedback site](http://aka.ms/logicapps-wish).
64120

65-
<!-- Image References -->
66-
[1]: ./media/logic-apps-scenario-function-sb-trigger/manualtrigger.png
67-
[2]: ./media/logic-apps-scenario-function-sb-trigger/newqueuetriggerfunction.png
Lines changed: 67 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,77 @@
11
---
22
title: Connect to file systems on premises - Azure Logic Apps | Microsoft Docs
3-
description: Connect to on-premises file systems from logic app workflows through the on-premises data gateway and File System connector
4-
keywords: file systems, on premises
3+
description: Automate tasks and workflows that connect to on-premises file systems with the File System connector through the on-premises data gateway in Azure Logic Apps
54
services: logic-apps
6-
author: derek1ee
7-
manager: jeconnoc
8-
documentationcenter: ''
9-
10-
ms.assetid:
115
ms.service: logic-apps
12-
ms.devlang: na
6+
ms.suite: integration
7+
author: derek1ee
8+
ms.author: deli
9+
ms.reviewer: klam, estfan, LADocs
1310
ms.topic: article
14-
ms.tgt_pltfrm: na
15-
ms.workload: na
1611
ms.date: 09/18/2017
17-
ms.author: LADocs; deli
1812
---
1913

20-
# Connect to on-premises file systems from logic apps with the File System connector
14+
# Connect to on-premises file systems with Azure Logic Apps
15+
16+
With the File System connector and Azure Logic Apps,
17+
you can create automated tasks and workflows that
18+
create and manage files on an on-premises file share,
19+
for example:
20+
21+
- Create, get, append, update, and delete files
22+
- List files in folders or root folders.
23+
- Get file content and metadata.
2124

22-
To manage data and securely access on-premises resources,
23-
your logic apps can use the on-premises data gateway.
24-
This article shows how you can connect to a file system on premises
25-
through this basic example scenario: copy a file that's uploaded to Dropbox to a file share,
26-
then send an email.
25+
This article shows how you can connect to an on-premises
26+
file system as described by this example scenario:
27+
copy a file that's uploaded to Dropbox to a file share,
28+
and then send an email. To securely connect and access on-premises systems,
29+
logic apps use the [on-premises data gateway](../logic-apps/logic-apps-gateway-connection.md).
30+
If you're new to logic apps, review [What is Azure Logic Apps?](../logic-apps/logic-apps-overview.md)
2731

2832
## Prerequisites
2933

30-
* Download the latest [on-premises data gateway](https://www.microsoft.com/download/details.aspx?id=53127).
34+
* An Azure subscription. If you don't have an Azure subscription,
35+
<a href="https://azure.microsoft.com/free/" target="_blank">sign up for a free Azure account</a>.
3136

32-
* Install and set up the latest on-premises data gateway, version 1.15.6150.1 or above.
33-
For the steps, see [Connect to data sources on premises](http://aka.ms/logicapps-gateway).
34-
You must install the gateway on an on-premises machine
35-
before you can continue with these steps.
37+
* Before you can connect logic apps to on-premises
38+
systems such as your file system server, you need to
39+
[install and set up an on-premises data gateway](../logic-apps/logic-apps-gateway-install.md).
40+
That way, you can specify to use your gateway installation when
41+
you create the file system connection from your logic app.
3642

37-
* Basic knowledge about [how to create logic apps](../logic-apps/quickstart-create-first-logic-app-workflow.md)
43+
* A [Drobox account](https://www.dropbox.com/) and your user credentials
3844

39-
## Add trigger and actions for connecting to your file system
45+
Your credentials authorize your logic app to create
46+
a connection and access your Drobox account.
4047

41-
1. Create a blank logic app. Add this trigger as the first step: **Dropbox - When a file is created**
48+
* Basic knowledge about [how to create logic apps](../logic-apps/quickstart-create-first-logic-app-workflow.md).
49+
For this example, you need a blank logic app.
4250

43-
2. Under the trigger, choose **+ Next step** > **Add an action**.
51+
## Add trigger and actions
4452

45-
3. In the search box, enter "file system" as your filter.
46-
When you see all the actions for the File System connector,
47-
choose the **File System - Create file** action.
53+
[!INCLUDE [Create connection general intro](../../includes/connectors-create-connection-general-intro.md)]
4854

49-
![Search for file connector](media/logic-apps-using-file-connector/search-file-connector.png)
55+
1. Sign in to the [Azure portal](https://portal.azure.com),
56+
and open your logic app in Logic App Designer, if not open already.
5057

51-
4. If you don't already have a connection to your file system,
58+
1. In the search box, enter "dropbox" as your filter.
59+
From the triggers list, select this trigger:
60+
**When a file is created**
61+
62+
1. Under the trigger, choose **Next step**.
63+
In the search box, enter "file system" as your filter.
64+
From the actions list, select this action:
65+
**Create file - File System**
66+
67+
![Find File System connector](media/logic-apps-using-file-connector/search-file-connector.png)
68+
69+
1. If you don't already have a connection to your file system,
5270
you're prompted to create a connection.
5371

54-
5. Select **Connect via on-premises data gateway**.
55-
When the connection properties appear,
56-
set up your connection as specified in the table.
72+
1. When you're prompted to sign in,
73+
select **Connect via on-premise data gateway**
74+
and provide the necessary connection information.
5775

5876
![Configure connection](media/logic-apps-using-file-connector/create-file.png)
5977

@@ -66,52 +84,39 @@ set up your connection as specified in the table.
6684
| **Gateway** | Select your previously installed gateway. |
6785
|||
6886

69-
6. After you provide all the connection details, choose **Create**.
87+
1. When you're done, choose **Create**.
7088

7189
Logic Apps configures and tests your connection,
7290
making sure that the connection works properly.
7391
If the connection is set up correctly,
7492
options appear for the action that you previously selected.
7593
The file system connector is now ready for use.
7694

77-
7. Set up the **Create file** action for copying files from Dropbox
78-
to the root folder for your on-premises file share.
95+
1. In the **Create file** action, provide the necessary details
96+
for copying files from Dropbox to the root folder in your
97+
on-premises file share.
7998

8099
![Create file action](media/logic-apps-using-file-connector/create-file-filled.png)
81100

82-
8. After this action for copying the file,
83-
add an Outlook action that sends an email
84-
so that relevant users know about the new file.
101+
1. Now, add an Outlook action that sends an email
102+
so that the appropriate users know about the new file.
85103
Enter the recipients, title, and body of the email.
86104

87-
In the **Dynamic content** list, you can choose data outputs
105+
From the dynamic content list, you can choose data outputs
88106
from the file connector so you can add more details to the email.
89107

90108
![Send email action](media/logic-apps-using-file-connector/send-email.png)
91109

92-
9. Save your logic app. Test your app by uploading a file to Dropbox.
93-
The file should get copied to the on-premises file share,
94-
and you should receive an email about the operation.
95-
96-
Congratulations, you now have a working logic app that
97-
can connect to your on-premises file system.
98-
99-
Try exploring other functionalities that the connector offers, for example:
110+
1. Save your logic app. Test your app by uploading a file to Dropbox.
100111

101-
- Create file
102-
- List files in folder
103-
- Append file
104-
- Delete file
105-
- Get file content
106-
- Get file content using path
107-
- Get file metadata
108-
- Get file metadata using path
109-
- List files in root folder
110-
- Update file
112+
The file should get copied to the on-premises file share,
113+
and you should receive an email about the operation.
111114

112-
## View the swagger
115+
## Connector reference
113116

114-
See the [swagger details](/connectors/fileconnector/).
117+
For technical details about triggers, actions, and limits, which are
118+
described by the connector's OpenAPI (formerly Swagger) description,
119+
review the connector's [reference page](/connectors/fileconnector/).
115120

116121
## Get support
117122

@@ -124,5 +129,5 @@ See the [swagger details](/connectors/fileconnector/).
124129
## Next steps
125130

126131
* [Connect to on-premises data](../logic-apps/logic-apps-gateway-connection.md)
127-
* [Monitor your logic apps](../logic-apps/logic-apps-monitor-your-logic-apps.md)
132+
* Learn about other [Logic Apps connectors](../connectors/apis-list.md)
128133
* [Enterprise integration for B2B scenarios](../logic-apps/logic-apps-enterprise-integration-overview.md)
20.5 KB
Loading
-21.7 KB
Loading
17.6 KB
Loading
18.4 KB
Loading

0 commit comments

Comments
 (0)