Skip to content

Commit 261f7b6

Browse files
authored
Merge pull request #5 from ecfan/patch-1
[Azure Logic Apps] HTTP + Swagger operations: Refresh updates
2 parents b79d963 + f825169 commit 261f7b6

1 file changed

Lines changed: 104 additions & 76 deletions

File tree

Lines changed: 104 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -1,140 +1,129 @@
11
---
2-
title: Call endpoints for REST APIs from workflows in Azure Logic Apps
3-
description: Learn how to call a REST API endpoint URL from an Azure Logic App workflow by using HTTP Swagger operations.
4-
services: logic-apps
2+
title: Call REST APIs from Workflows with HTTP Swagger
3+
description: Call REST API endpoints from workflows in Azure Logic Apps by using HTTP Swagger operations.
4+
services: azure-logic-apps
55
ms.suite: integration
66
ms.reviewers: estfan, azla
77
ms.topic: how-to
88
ms.update-cycle: 365-days
9-
ms.date: 03/19/2026
10-
# Customer intent: As an integration developer who works with Azure Logic Apps, I want to call a REST API endpoint from my workflow by using HTTP Swagger operations.
9+
ai-usage: ai-assisted
10+
ms.date: 03/23/2026
11+
# Customer intent: As an integration developer who works with Azure Logic Apps, I want to call a REST API endpoint URL from my workflow by using HTTP Swagger operations.
1112
---
1213

13-
# Call endpoints for REST APIs from workflows in Azure Logic Apps
14+
# Call REST API endpoints from workflows in Azure Logic Apps by using HTTP Swagger
1415

1516
[!INCLUDE [logic-apps-sku-consumption-standard](../../includes/logic-apps-sku-consumption-standard.md)]
1617

17-
To call a REST API endpoint from a logic app workflow in Azure Logic Apps, you can use the built-in **HTTP + Swagger** operations to call any REST API endpoint through a [Swagger file](https://swagger.io). The **HTTP + Swagger** trigger and action work the same as the [HTTP trigger and action](/azure/connectors/connectors-native-http) 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 trigger pattern](/azure/logic-apps/logic-apps-create-api-app#polling-triggers).
18+
To call a REST API from your workflow in Azure Logic Apps without manually building a request, add the native, built-in **HTTP + Swagger** trigger or action to your workflow. These operations call any REST API endpoint by using a [Swagger file](https://swagger.io) to discover callable operations and get structured inputs and outputs.
19+
20+
The **HTTP + Swagger** trigger and action work the same as the [HTTP trigger and action](/azure/connectors/connectors-native-http), but they provide a better experience in the workflow designer by exposing the API structure and outputs described by the Swagger file.
21+
22+
This article shows how to add and use the **HTTP + Swagger** trigger and action in your workflow.
1823

1924
## Limitations
2025

2126
The **HTTP + Swagger** built-in operations support only OpenAPI 2.0, not OpenAPI 3.0.
2227

2328
## Prerequisites
2429

25-
* An Azure account and subscription. [Get a free Azure account](https://azure.microsoft.com/pricing/purchase-options/azure-account?cid=msft_learn).
30+
- An Azure account and subscription. [Get a free Azure account](https://azure.microsoft.com/pricing/purchase-options/azure-account?cid=msft_learn).
2631

27-
* The URL for the Swagger file that describes the target REST API endpoint that you want to call
32+
- The URL for the Swagger file that describes the target REST API endpoint to call.
2833

29-
Typically, the REST endpoint must meet the following criteria for the trigger or action to work:
34+
Typically, the REST endpoint needs to meet the following criteria for the trigger or action to work:
3035

31-
* The Swagger file must be hosted on an HTTPS URL that's publicly accessible.
36+
- The Swagger file is hosted on a publicly accessible HTTPS URL.
3237

33-
* The Swagger file must contain an **operationID** property for each operation in the definition. If not, the connector shows only the last operation in the Swagger file.
34-
35-
* 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.
36-
37-
> [!NOTE]
38-
>
39-
> To reference a Swagger file that's unhosted or doesn't meet 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.
40-
41-
* The Consumption or Standard logic app workflow from where you want to call the target endpoint. To start with the **HTTP + Swagger** trigger, create a logic app resource with a blank 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 operation.
42-
43-
## Add an HTTP + Swagger trigger
44-
45-
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.
38+
- The Swagger file contains an `operationID` property for each operation in the API definition. If not, the workflow designer shows only the last operation in the Swagger file.
4639

47-
1. In the [Azure portal](https://portal.azure.com), open your logic app resource and blank workflow in the designer.
40+
- The Swagger file needs to turn on [Cross-Origin Resource Sharing (CORS)](/rest/api/storageservices/cross-origin-resource-sharing--cors--support-for-the-azure-storage-services).
4841

49-
1. Based on whether you have a Consumption or Standard workflow, [follow these general steps to add the **HTTP** trigger named **HTTP + Swagger**](/azure/logic-apps/create-workflow-with-trigger-or-action#add-trigger).
42+
> [!NOTE]
43+
>
44+
> To reference a Swagger file that's unhosted or doesn't meet security and cross-origin requirements, [upload the Swagger file to a blob container in an Azure storage account](#host-swagger), and enable CORS on that storage account.
5045
51-
1. In the **Swagger endpoint** box, enter the URL for the Swagger file that you want, and select **Add action**.
46+
- A Consumption or Standard logic app workflow where you want to call the REST API endpoint.
5247

53-
The following example uses a non-functional Swagger URL. Your URL might use a different format.
48+
To start your workflow with the **HTTP + Swagger** trigger, create a logic app resource that has a blank workflow. To use the **HTTP + Swagger** action, start your workflow with any trigger that works best for your business scenario.
5449

55-
:::image type="content" source="media/connectors-native-http-swagger/http-swagger-trigger-parameters.png" alt-text="Screenshot shows workflow designer with an Add a trigger pane for an HTTP + Swagger trigger. The Swagger endpoint property is set to an example URL.":::
50+
## Add an HTTP + Swagger trigger
5651

57-
1. After the designer shows the operations described by the Swagger file, select the operation that you want to use.
52+
This trigger sends an HTTP request to the URL for a Swagger file that describes a REST API. The trigger returns a response that contains the Swagger file content to the workflow.
5853

59-
1. Provide the values for the trigger parameters, which vary based on the selected operation, that you want to include in the endpoint call.
54+
To implement a polling trigger, follow the [polling trigger pattern](/azure/logic-apps/logic-apps-create-api-app#polling-triggers).
6055

61-
1. If the trigger requires that you specify a firing schedule, specify the recurrence for how often you want the trigger to call the endpoint.
56+
1. In the [Azure portal](https://portal.azure.com), open your logic app resource.
6257

63-
1. To add other available parameters, open the **Advanced parameters** list, and select the parameters that you want.
58+
1. In the designer, open your blank workflow.
6459

65-
For more information about authentication types available for HTTP + Swagger, see [Add authentication to outbound calls](/azure/logic-apps/logic-apps-securing-a-logic-app#add-authentication-outbound).
60+
1. Based on whether your workflow is Consumption or Standard, follow the [general steps](/azure/logic-apps/add-trigger-action-workflow#add-trigger) to add the **HTTP** trigger named **HTTP + Swagger**.
6661

67-
1. Continue building your workflow with the actions that you want to run when the trigger fires.
62+
1. In the **Swagger endpoint** box, enter the URL for the Swagger file, and select **Add action**.
6863

69-
1. When you're done, save your workflow. On the designer toolbar, select **Save**.
64+
The following example shows an example Swagger URL format. Your URL might use a different format.
7065

71-
## Add an HTTP + Swagger action
66+
:::image type="content" source="media/connectors-native-http-swagger/http-swagger-trigger-parameters.png" alt-text="Screenshot that shows the Azure portal, workflow designer, and HTTP + Swagger trigger pane. An example URL is entered for the Swagger endpoint parameter.":::
7267

73-
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.
68+
The trigger information pane shows the operations in the Swagger file.
7469

75-
1. In the [Azure portal](https://portal.azure.com), open your logic app resource and workflow in the designer.
70+
1. Select the operation you want.
7671

77-
1. Based on whether you have a Consumption or Standard workflow, [follow these general steps to add the **HTTP** action named **HTTP + Swagger**](/azure/logic-apps/create-workflow-with-trigger-or-action#add-action).
72+
1. For the selected operation, enter the parameter values to use in the REST API call.
7873

79-
1. In the **Swagger endpoint** box, enter the URL for the Swagger file that you want, and select **Add action**.
74+
Parameters vary based on the selected operation.
8075

81-
The following example uses a non-functional Swagger URL. Your URL might use a different format.
76+
1. If the trigger runs on a schedule, set up the recurrence to specify when the trigger calls the REST API.
8277

83-
:::image type="content" source="media/connectors-native-http-swagger/http-swagger-action-parameters.png" alt-text="Screenshot shows workflow designer with a trigger named Fabrikam API - Check customer and an Add an action pane for an HTTP + Swagger action. The Swagger endpoint property is set to a URL.":::
78+
1. If other parameters exist, open the **Advanced parameters** list, and select the parameters you want.
8479

85-
1. After the designer shows the operations described by the Swagger file, select the operation that you want to use.
80+
For more information about authentication, see [Add authentication to outbound calls](/azure/logic-apps/logic-apps-securing-a-logic-app#add-authentication-outbound).
8681

87-
1. Provide the values for the action parameters, which vary based on the selected operation, that you want to include in the endpoint call.
82+
1. Continue building the workflow with actions to run when the trigger fires.
8883

89-
1. To add other available parameters, open the **Advanced parameters** list, and select the parameters that you want.
84+
1. When you finish, save your workflow. On the designer toolbar, select **Save**.
9085

91-
For more information about authentication types available for HTTP + Swagger, see [Add authentication to outbound calls](/azure/logic-apps/logic-apps-securing-a-logic-app#add-authentication-outbound).
86+
## Add an HTTP + Swagger action
9287

93-
1. Continue building your workflow with any other actions that you want to run.
88+
This action sends an HTTP request to the URL for a Swagger file that describes a REST API. The action returns a response that contains the Swagger file content to the workflow.
9489

95-
1. When you're done, save your workflow. On the designer toolbar, select **Save**.
90+
1. In the [Azure portal](https://portal.azure.com), open your logic app resource.
9691

97-
<a name="host-swagger"></a>
92+
1. In the designer, open your blank workflow.
9893

99-
## Host Swagger in Azure Storage
94+
1. Based on whether your workflow is Consumption or Standard, follow the [general steps](/azure/logic-apps/add-trigger-action-workflow#add-action) to add the **HTTP** action named **HTTP + Swagger**.
10095

101-
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 a 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:
96+
1. In the **Swagger endpoint** box, enter the URL for the Swagger file, and select **Add action**.
10297

103-
1. [Create an Azure storage account](/azure/storage/common/storage-account-create).
98+
The following example shows an example Swagger URL format. Your URL might use a different format.
10499

105-
1. Enable CORS for the blob. On your storage account's **Settings** section, select **CORS**. On the **Blob service** tab, specify these values, and select **Save**.
100+
:::image type="content" source="media/connectors-native-http-swagger/http-swagger-action-parameters.png" alt-text="Screenshot that shows the Azure portal, workflow designer, and HTTP + Swagger action pane. An example URL is entered for the Swagger endpoint parameter.":::
106101

107-
| Property | Value |
108-
|----------|-------|
109-
| **Allowed origins** | `*` |
110-
| **Allowed methods** | `GET`, `HEAD`, `PUT` |
111-
| **Allowed headers** | `*` |
112-
| **Exposed headers** | `*` |
113-
| **Max age** (in seconds) | `200` |
102+
The action information pane shows the operations in the Swagger file.
114103

115-
Although this example uses the [Azure portal](https://portal.azure.com), you can also use a tool such as [Azure Storage Explorer](https://storageexplorer.com/), or automatically configure this setting by using this sample [PowerShell script](https://github.com/logicappsio/EnableCORSAzureBlob/blob/master/EnableCORSAzureBlob.ps1).
104+
1. Select the operation you want.
116105

117-
1. [Create a blob container](/azure/storage/blobs/storage-quickstart-blobs-portal). On the container's **Overview** pane, select **Change access level**. From the **Public access level** list, select **Blob (anonymous read access for blobs only)**, and select **OK**.
106+
1. For the selected operation, enter the parameter values to use in the REST API call.
118107

119-
1. [Upload the Swagger file to the blob container](/azure/storage/blobs/storage-quickstart-blobs-portal#upload-a-block-blob), either through the [Azure portal](https://portal.azure.com) or [Azure Storage Explorer](https://storageexplorer.com/).
108+
Parameters vary based on the selected operation.
120109

121-
1. To reference the file in the blob container, get the HTTPS URL that follows this format, which is case-sensitive, from Azure Storage Explorer:
110+
1. If other parameters exist, open the **Advanced parameters** list, and select the parameters you want.
122111

123-
`https://<storage-account-name>.blob.core.windows.net/<blob-container-name>/<complete-swagger-file-name>?<query-parameters>`
112+
For more information about authentication, see [Add authentication to outbound calls](/azure/logic-apps/logic-apps-securing-a-logic-app#add-authentication-outbound).
124113

125-
## Connector technical reference
114+
1. Continue building the workflow with actions to run when the trigger fires.
126115

127-
This section provides more information about the outputs from an **HTTP + Swagger** trigger and action.
116+
1. When you finish, save your workflow. On the designer toolbar, select **Save**.
128117

129-
### Outputs
118+
## Outputs from HTTP + Swagger operations
130119

131-
The **HTTP + Swagger** call returns the following information:
120+
This section provides more information about the outputs from the **HTTP + Swagger** trigger and action. The **HTTP + Swagger** operation returns the following information:
132121

133122
| Property name | Type | Description |
134123
|---------------|------|-------------|
135-
| **headers** | Object | The headers from the request |
136-
| **body** | Object | The object with the body content from the request |
137-
| **status code** | Integer | The status code from the request |
124+
| **headers** | Object | The headers from the request. |
125+
| **body** | Object | The object with the body content from the request. |
126+
| **status code** | Integer | The status code from the request. |
138127

139128
| Status code | Description |
140129
|-------------|-------------|
@@ -146,8 +135,47 @@ The **HTTP + Swagger** call returns the following information:
146135
| 404 | Not Found |
147136
| 500 | Internal server error. Unknown error occurred. |
148137

149-
## Related content
138+
<a name="host-swagger"></a>
139+
140+
## Host the Swagger in Azure Storage
150141

151-
* [Managed connectors for Azure Logic Apps](/connectors/connector-reference/connector-reference-logicapps-connectors)
152-
* [Built-in connectors for Azure Logic Apps](/azure/connectors/built-in)
142+
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 a blob container in an Azure storage account and turn on CORS on the storage account.
143+
144+
To create, set up, and store Swagger files in Azure Storage, follow these steps:
145+
146+
1. In the Azure portal, [create an Azure storage account](/azure/storage/common/storage-account-create).
147+
148+
1. Turn on CORS for the blob by following these steps:
149+
150+
1. On the storage account sidebar, under **Settings**, select **CORS**.
151+
152+
1. On the **Blob service** tab, enter the following values, and select **Save**.
153+
154+
| Parameter | Value |
155+
|-----------|-------|
156+
| **Allowed origins** | `*` |
157+
| **Allowed methods** | `GET`, `HEAD`, `PUT` |
158+
| **Allowed headers** | `*` |
159+
| **Exposed headers** | `*` |
160+
| **Max age** in seconds | `200` |
161+
162+
This example uses the Azure portal, but you can use a tool like [Azure Storage Explorer](https://storageexplorer.com/) to configure this setting. To automate configuration, see the [sample PowerShell script](https://github.com/logicappsio/EnableCORSAzureBlob/blob/master/EnableCORSAzureBlob.ps1).
163+
164+
1. [Create a blob container](/azure/storage/blobs/storage-quickstart-blobs-portal) and follow these steps:
165+
166+
1. On the container sidebar, select **Overview**.
167+
168+
1. On the **Overview** page, select **Change access level**.
169+
170+
1. From the **Public access level** list, select **Blob (anonymous read access for blobs only)**, and then select **OK**.
171+
172+
1. In the Azure portal or Azure Storage Explorer, [upload the Swagger file to the blob container](/azure/storage/blobs/storage-quickstart-blobs-portal#upload-a-block-blob).
173+
174+
1. To reference the file in the blob container, from Azure Storage Explorer, get the HTTPS URL that uses the following case-sensitive format:
175+
176+
`https://<storage-account-name>.blob.core.windows.net/<blob-container-name>/<complete-swagger-file-name>?<query-parameters>`
177+
178+
## Related content
153179

180+
- [Managed connectors for Azure Logic Apps](/connectors/connector-reference/connector-reference-logicapps-connectors)
181+
- [Built-in connectors for Azure Logic Apps](/azure/connectors/built-in)

0 commit comments

Comments
 (0)