Skip to content

Commit 49cdae2

Browse files
authored
Merge pull request #187913 from ecfan/patch-1
Azure Logic Apps: Clarity edits around Swagger endpoint
2 parents ee8a657 + 952df9b commit 49cdae2

File tree

1 file changed

+33
-32
lines changed

1 file changed

+33
-32
lines changed

articles/connectors/connectors-native-http-swagger.md

Lines changed: 33 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,93 +1,94 @@
11
---
22
title: Connect to REST endpoints from Azure Logic Apps
3-
description: Monitor REST endpoints in automated tasks, processes, and workflows by using Azure Logic Apps
3+
description: Connect to REST endpoints from automated workflows in Azure Logic Apps.
44
services: logic-apps
55
ms.suite: integration
6-
ms.reviewer: klam, logicappspm
7-
ms.topic: conceptual
6+
ms.reviewer: estfan, azla
7+
ms.topic: how-to
88
ms.date: 11/01/2019
99
tags: connectors
1010
---
1111

1212
# Call REST endpoints by using Azure Logic Apps
1313

14-
With [Azure Logic Apps](../logic-apps/logic-apps-overview.md) and the built-in HTTP + Swagger connector, you can automate workflows that regularly call any REST endpoint through a [Swagger file](https://swagger.io) by building logic apps. The HTTP + Swagger trigger and action work the same as the [HTTP trigger and action](connectors-native-http.md) but provide a better experience in the Logic App Designer by exposing the API structure and outputs described by the Swagger file. To implement a polling trigger, follow the polling pattern that's described in [Create custom APIs to call other APIs, services, and systems from logic apps](../logic-apps/logic-apps-create-api-app.md#polling-triggers).
14+
With [Azure Logic Apps](../logic-apps/logic-apps-overview.md) and the built-in **HTTP + Swagger** operation, you can create automated integration workflows that regularly call any REST endpoint through a [Swagger file](https://swagger.io). The **HTTP + Swagger** trigger and action work the same as the [HTTP trigger and action](connectors-native-http.md) but provide a better experience in the workflow designer by exposing the API structure and outputs described by the Swagger file. To implement a polling trigger, follow the polling pattern that's described in [Create custom APIs to call other APIs, services, and systems from logic app workflows](../logic-apps/logic-apps-create-api-app.md#polling-triggers).
1515

1616
## Prerequisites
1717

18-
* An Azure subscription. If you don't have an Azure subscription, [sign up for a free Azure account](https://azure.microsoft.com/free/).
18+
* An account and Azure subscription. If you don't have an Azure subscription, [sign up for a free Azure account](https://azure.microsoft.com/free/?WT.mc_id=A261C142F).
1919

20-
* The URL for the Swagger (not OpenAPI) file that describes the target REST endpoint
20+
* The URL for the Swagger (not OpenAPI) file that describes the target REST endpoint that you want to call
2121

22-
Typically, the REST endpoint must meet this criteria for the connector to work:
22+
Typically, the REST endpoint has to meet the following criteria for the trigger or action to work:
2323

2424
* The Swagger file must be hosted on an HTTPS URL that's publicly accessible.
2525

26-
* The Swagger file must contain an `operationID` for each operation in the definition. If not, the connector only shows the last operation in the Swagger file.
26+
* The Swagger file must contain an **operationID** property for each operation in the definition. If not, the connector only shows the last operation in the Swagger file.
2727

2828
* The Swagger file must have [Cross-Origin Resource Sharing (CORS)](/rest/api/storageservices/cross-origin-resource-sharing--cors--support-for-the-azure-storage-services) enabled.
2929

30-
To reference a Swagger file that's not hosted or that doesn't meet the security and cross-origin requirements, you can [upload the Swagger file to a blob container in an Azure storage account](#host-swagger), and enable CORS on that storage account so that you can reference the file.
31-
3230
The examples in this topic use the [Cognitive Services Face API](../cognitive-services/face/overview.md), which requires a [Cognitive Services account and access key](../cognitive-services/cognitive-services-apis-create-account.md).
3331

34-
* Basic knowledge about [how to create logic apps](../logic-apps/quickstart-create-first-logic-app-workflow.md). If you're new to logic apps, review [What is Azure Logic Apps?](../logic-apps/logic-apps-overview.md)
32+
> [!NOTE]
33+
> To reference a Swagger file that's unhosted or that doesn't meet the security and cross-origin requirements, you can [upload the Swagger file to a blob container in an Azure storage account](#host-swagger), and enable CORS on that storage account so that you can reference the file.
34+
35+
* The logic app workflow from where you want to call the target endpoint. To start with the **HTTP + Swagger** trigger, create a blank logic app workflow. To use the HTTP + Swagger action, start your workflow with any trigger that you want. This example uses the **HTTP + Swagger** trigger as the first step.
3536

36-
* The logic app from where you want to call the target endpoint. To start with the HTTP + Swagger trigger, [create a blank logic app](../logic-apps/quickstart-create-first-logic-app-workflow.md). To use the HTTP + Swagger action, start your logic app with any trigger that you want. This example uses the HTTP + Swagger trigger as the first step.
37+
If you're new to logic app workflows, review [What is Azure Logic Apps?](../logic-apps/logic-apps-overview.md) and [how to create your first logic app workflow](../logic-apps/quickstart-create-first-logic-app-workflow.md).
3738

3839
## Add an HTTP + Swagger trigger
3940

40-
This built-in trigger sends an HTTP request to a URL for a Swagger file that describes a REST API and returns a response that contains that file's content.
41+
This built-in trigger sends an HTTP request to a URL for a Swagger file that describes a REST API. The trigger then returns a response that contains that file's content.
4142

42-
1. Sign in to the [Azure portal](https://portal.azure.com). Open your blank logic app in Logic App Designer.
43+
1. Sign in to the [Azure portal](https://portal.azure.com). Open your blank logic app workflow in the designer.
4344

44-
1. On the designer, in the search box, enter "swagger" as your filter. From the **Triggers** list, select the **HTTP + Swagger** trigger.
45+
1. On the designer, in the search box, enter **swagger**. From the **Triggers** list, select the **HTTP + Swagger** trigger.
4546

4647
![Select HTTP + Swagger trigger](./media/connectors-native-http-swagger/select-http-swagger-trigger.png)
4748

48-
1. In the **SWAGGER ENDPOINT URL** box, enter the URL for the Swagger file, and select **Next**.
49+
1. In the **SWAGGER ENDPOINT URL** box, enter the URL for the Swagger file that you want, and select **Next**.
4950

50-
This example uses the Swagger URL that is located in the West US region for the [Cognitive Services Face API](https://westus.dev.cognitive.microsoft.com/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395236):
51+
Make sure to use or create your own endpoint. As an example only, these steps use the following [Cognitive Services Face API](https://westus.dev.cognitive.microsoft.com/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395236) Swagger URL located in the West US region and might not work in your specific trigger:
5152

5253
`https://westus.dev.cognitive.microsoft.com/docs/services/563879b61984550e40cbbe8d/export?DocumentFormat=Swagger&ApiName=Face%20API%20-%20V1.0`
5354

54-
![Screenshot that shows the Logic App Designer with the "H T T P + Swagger" trigger and the "Swagger Endpoint U R L" property set to a U R L value.](./media/connectors-native-http-swagger/http-swagger-trigger-parameters.png)
55+
![Screenshot that shows the workflow designer with the "H T T P + Swagger" trigger and the "Swagger Endpoint U R L" property set to a U R L value.](./media/connectors-native-http-swagger/http-swagger-trigger-parameters.png)
5556

5657
1. When the designer shows the operations described by the Swagger file, select the operation that you want to use.
5758

58-
![Screenshot that shows the Logic App Designer with the "H T T P + Swagger" trigger and a list that displays Swagger operations.](./media/connectors-native-http-swagger/http-swagger-trigger-operations.png)
59+
![Screenshot that shows the workflow designer with the "H T T P + Swagger" trigger and a list that displays Swagger operations.](./media/connectors-native-http-swagger/http-swagger-trigger-operations.png)
5960

6061
1. Provide the values for the trigger parameters, which vary based on the selected operation, that you want to include in the endpoint call. Set up the recurrence for how often you want the trigger to call the endpoint.
6162

6263
This example renames the trigger to "HTTP + Swagger trigger: Face - Detect" so that the step has a more descriptive name.
6364

64-
![Screenshot that shows the Logic App Designer with the "H T T P + Swagger" trigger that displays the "Face - Detect" operation.](./media/connectors-native-http-swagger/http-swagger-trigger-operation-details.png)
65+
![Screenshot that shows the workflow designer with the "H T T P + Swagger" trigger that displays the "Face - Detect" operation.](./media/connectors-native-http-swagger/http-swagger-trigger-operation-details.png)
6566

6667
1. To add other available parameters, open the **Add new parameter** list, and select the parameters that you want.
6768

6869
For more information about authentication types available for HTTP + Swagger, see [Add authentication to outbound calls](../logic-apps/logic-apps-securing-a-logic-app.md#add-authentication-outbound).
6970

70-
1. Continue building your logic app's workflow with actions that run when the trigger fires.
71+
1. Continue building your workflow with actions that run when the trigger fires.
7172

72-
1. When you're finished, remember to save your logic app. On the designer toolbar, select **Save**.
73+
1. When you're finished, remember to save your workflow. On the designer toolbar, select **Save**.
7374

7475
## Add an HTTP + Swagger action
7576

76-
This built-in action makes an HTTP request to the URL for the Swagger file that describes a REST API and returns a response that contains that file's content.
77+
This built-in action sends an HTTP request to the URL for the Swagger file that describes a REST API. The action then returns a response that contains that file's content.
7778

78-
1. Sign in to the [Azure portal](https://portal.azure.com). Open your logic app in Logic App Designer.
79+
1. Sign in to the [Azure portal](https://portal.azure.com). Open your logic app workflow in designer.
7980

80-
1. Under the step where you want to add the HTTP + Swagger action, select **New step**.
81+
1. Under the step where you want to add the **HTTP + Swagger** action, select **New step**.
8182

8283
To add an action between steps, move your pointer over the arrow between steps. Select the plus sign (**+**) that appears, and then select **Add an action**.
8384

84-
1. On the designer, in the search box, enter "swagger" as your filter. From the **Actions** list, select the **HTTP + Swagger** action.
85+
1. On the designer, in the search box, enter **swagger**. From the **Actions** list, select the **HTTP + Swagger** action.
8586

8687
![Select HTTP + Swagger action](./media/connectors-native-http-swagger/select-http-swagger-action.png)
8788

88-
1. In the **SWAGGER ENDPOINT URL** box, enter the URL for the Swagger file, and select **Next**.
89+
1. In the **SWAGGER ENDPOINT URL** box, enter the URL for the Swagger file that you want, and select **Next**.
8990

90-
This example uses the Swagger URL that is located in the West US region for the [Cognitive Services Face API](https://westus.dev.cognitive.microsoft.com/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395236):
91+
Make sure to use or create your own endpoint. As an example only, these steps use the following [Cognitive Services Face API](https://westus.dev.cognitive.microsoft.com/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395236) Swagger URL located in the West US region and might not work in your specific action:
9192

9293
`https://westus.dev.cognitive.microsoft.com/docs/services/563879b61984550e40cbbe8d/export?DocumentFormat=Swagger&ApiName=Face%20API%20-%20V1.0`
9394

@@ -107,13 +108,13 @@ This built-in action makes an HTTP request to the URL for the Swagger file that
107108

108109
For more information about authentication types available for HTTP + Swagger, see [Add authentication to outbound calls](../logic-apps/logic-apps-securing-a-logic-app.md#add-authentication-outbound).
109110

110-
1. When you're finished, remember to save your logic app. On the designer toolbar, select **Save**.
111+
1. When you're finished, remember to save your logic app workflow. On the designer toolbar, select **Save**.
111112

112113
<a name="host-swagger"></a>
113114

114115
## Host Swagger in Azure Storage
115116

116-
You can reference a Swagger file that's not hosted or that doesn't meet the security and cross-origin requirements by uploading that file to blob container in an Azure storage account and enabling CORS on that storage account. To create, set up, and store Swagger files in Azure Storage, follow these steps:
117+
You can still reference a Swagger file that's not hosted or that doesn't meet the security and cross-origin requirements. Upload the Swagger file to blob container in an Azure storage account and enable CORS on that storage account. To create, set up, and store Swagger files in Azure Storage, follow these steps:
117118

118119
1. [Create an Azure storage account](../storage/common/storage-account-create.md).
119120

@@ -140,7 +141,7 @@ You can reference a Swagger file that's not hosted or that doesn't meet the secu
140141

141142
## Connector reference
142143

143-
Here is more information about the outputs from an HTTP + Swagger trigger or action. The HTTP + Swagger call returns this information:
144+
This section provides more information about the outputs from an **HTTP + Swagger** trigger or action. The **HTTP + Swagger** call returns this information:
144145

145146
| Property name | Type | Description |
146147
|---------------|------|-------------|
@@ -162,4 +163,4 @@ Here is more information about the outputs from an HTTP + Swagger trigger or act
162163

163164
## Next steps
164165

165-
* Learn about other [Logic Apps connectors](../connectors/apis-list.md)
166+
* Learn about other [connectors in Azure Logic Apps](../connectors/apis-list.md)

0 commit comments

Comments
 (0)