Skip to content

Commit 5c8f301

Browse files
authored
Merge pull request #113036 from dksimpson/release-functions-ux-update-dks-11
Functions update for portal UX refresh - batch 11
2 parents 41ff68f + 1bbfbd6 commit 5c8f301

File tree

3 files changed

+16
-15
lines changed

3 files changed

+16
-15
lines changed

articles/azure-functions/functions-twitter-email.md

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ author: craigshoemaker
55

66
ms.assetid: 60495cc5-1638-4bf0-8174-52786d227734
77
ms.topic: tutorial
8-
ms.date: 11/06/2018
8+
ms.date: 04/27/2020
99
ms.author: cshoe
1010
ms.custom: mvc, cc996988-fb4f-47
1111
---
@@ -14,7 +14,7 @@ ms.custom: mvc, cc996988-fb4f-47
1414

1515
Azure Functions integrates with Azure Logic Apps in the Logic Apps Designer. This integration lets you use the computing power of Functions in orchestrations with other Azure and third-party services.
1616

17-
This tutorial shows you how to use Functions with Logic Apps and Cognitive Services on Azure to run sentiment analysis from Twitter posts. An HTTP triggered function categorizes tweets as green, yellow, or red based on the sentiment score. An email is sent when poor sentiment is detected.
17+
This tutorial shows you how to use Azure Functions with Logic Apps and Cognitive Services on Azure to run sentiment analysis from Twitter posts. An HTTP trigger function categorizes tweets as green, yellow, or red based on the sentiment score. An email is sent when poor sentiment is detected.
1818

1919
![image first two steps of app in Logic App Designer](media/functions-twitter-email/00-logic-app-overview.png)
2020

@@ -63,7 +63,7 @@ The Cognitive Services APIs are available in Azure as individual resources. Use
6363

6464
4. Click **Create** to create your resource.
6565

66-
5. Click on **Overview** and copy the value of the **Endpoint** to a text editor. This value is used when creating a connection to the Cognitive Services API.
66+
5. Click **Overview** and copy the value of the **Endpoint** to a text editor. This value is used when creating a connection to the Cognitive Services API.
6767

6868
![Cognitive Services Settings](media/functions-twitter-email/02-cognitive-services.png)
6969

@@ -73,21 +73,21 @@ The Cognitive Services APIs are available in Azure as individual resources. Use
7373

7474
## Create the function app
7575

76-
Functions provides a great way to offload processing tasks in a logic apps workflow. This tutorial uses an HTTP triggered function to process tweet sentiment scores from Cognitive Services and return a category value.
76+
Azure Functions provides a great way to offload processing tasks in a logic apps workflow. This tutorial uses an HTTP trigger function to process tweet sentiment scores from Cognitive Services and return a category value.
7777

7878
[!INCLUDE [Create function app Azure portal](../../includes/functions-create-function-app-portal.md)]
7979

80-
## Create an HTTP triggered function
80+
## Create an HTTP trigger function
8181

82-
1. Expand your function app and click the **+** button next to **Functions**. If this is the first function in your function app, select **In-portal**.
82+
1. From the left menu of the **Functions** window, select **Functions**, then select **Add** from the top menu.
8383

84-
![Functions quickstart page in the Azure portal](media/functions-twitter-email/05-function-app-create-portal.png)
84+
2. From the **New Function** window, select **HTTP trigger**.
8585

86-
2. Next, select **Webhook + API** and click **Create**.
86+
![Choose HTTP trigger function](./media/functions-twitter-email/06-function-http-trigger.png)
8787

88-
![Choose the HTTP trigger](./media/functions-twitter-email/06-function-webhook.png)
88+
3. From the **New Function** page, select **Create Function**.
8989

90-
3. Replace the contents of the `run.csx` file with the following code, then click **Save**:
90+
4. In your new HTTP trigger function, select **Code + Test** from the left menu, replace the contents of the `run.csx` file with the following code, and then select **Save**:
9191

9292
```csharp
9393
#r "Newtonsoft.Json"
@@ -122,11 +122,12 @@ Functions provides a great way to offload processing tasks in a logic apps workf
122122
: new BadRequestObjectResult("Please pass a value on the query string or in the request body");
123123
}
124124
```
125+
125126
This function code returns a color category based on the sentiment score received in the request.
126127

127-
4. To test the function, click **Test** at the far right to expand the Test tab. Type a value of `0.2` for the **Request body**, and then click **Run**. A value of **RED** is returned in the body of the response.
128+
5. To test the function, select **Test** from the top menu. On the **Input** tab, enter a value of `0.2` in the **Body**, and then select **Run**. A value of **RED** is returned in the **HTTP response content** on the **Output** tab.
128129

129-
![Test the function in the Azure portal](./media/functions-twitter-email/07-function-test.png)
130+
:::image type="content" source="./media/functions-twitter-email/07-function-test.png" alt-text="Define the proxy settings":::
130131

131132
Now you have a function that categorizes sentiment scores. Next, you create a logic app that integrates your function with your Twitter and Cognitive Services API.
132133

@@ -186,7 +187,7 @@ Now your app is connected to Twitter. Next, you connect to text analytics to det
186187

187188
![New Step, and then Add an action](media/functions-twitter-email/12-connection-settings.png)
188189

189-
4. Next, enter **Tweet Text** in the text box and then click on **New Step**.
190+
4. Next, enter **Tweet text** in the text box and then click **New Step**.
190191

191192
![Define text to analyze](media/functions-twitter-email/13-analyze-tweet-text.png)
192193

@@ -214,7 +215,7 @@ Now, your function is triggered when a sentiment score is sent from the logic ap
214215

215216
## Add email notifications
216217

217-
The last part of the workflow is to trigger an email when the sentiment is scored as _RED_. This topic uses an Outlook.com connector. You can perform similar steps to use a Gmail or Office 365 Outlook connector.
218+
The last part of the workflow is to trigger an email when the sentiment is scored as _RED_. This article uses an Outlook.com connector. You can perform similar steps to use a Gmail or Office 365 Outlook connector.
218219

219220
1. In the Logic Apps Designer, click **New step** > **Add a condition**.
220221

@@ -276,7 +277,7 @@ Now that the workflow is complete, you can enable the logic app and see the func
276277
> [!IMPORTANT]
277278
> After you have completed this tutorial, you should disable the logic app. By disabling the app, you avoid being charged for executions and using up the transactions in your Cognitive Services API.
278279

279-
Now you have seen how easy it is to integrate Functions into a Logic Apps workflow.
280+
Now you've seen how easy it is to integrate Functions into a Logic Apps workflow.
280281

281282
## Disable the logic app
282283

66.7 KB
Loading
-155 KB
Loading

0 commit comments

Comments
 (0)