Skip to content

Commit f825169

Browse files
committed
Revisions for refresh updates
1 parent e769ec7 commit f825169

1 file changed

Lines changed: 100 additions & 73 deletions

File tree

Lines changed: 100 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
2-
title: Call REST APIs from Workflows
3-
description: Call REST API endpoint URLs from workflows in Azure Logic Apps by using HTTP Swagger operations.
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.
44
services: azure-logic-apps
55
ms.suite: integration
66
ms.reviewers: estfan, azla
@@ -11,131 +11,119 @@ ms.date: 03/23/2026
1111
# 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.
1212
---
1313

14-
# Call REST API endpoint URLs from workflows in Azure Logic Apps
14+
# Call REST API endpoints from workflows in Azure Logic Apps by using HTTP Swagger
1515

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

18-
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.
1923

2024
## Limitations
2125

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

2428
## Prerequisites
2529

26-
* 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).
2731

28-
* 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.
2933

30-
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:
3135

32-
* 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.
3337

34-
* 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.
35-
36-
* 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.
37-
38-
> [!NOTE]
39-
>
40-
> 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.
41-
42-
* 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.
43-
44-
## Add an HTTP + Swagger trigger
45-
46-
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.
4739

48-
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).
4941

50-
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.
5145
52-
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.
5347

54-
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.
5549

56-
:::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
5751

58-
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.
5953

60-
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).
6155

62-
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.
6357

64-
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.
6559

66-
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**.
6761

68-
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**.
6963

70-
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.
7165

72-
## 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.":::
7367

74-
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.
7569

76-
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.
7771

78-
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.
7973

80-
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.
8175

82-
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.
8377

84-
:::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.
8579

86-
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).
8781

88-
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.
8983

90-
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**.
9185

92-
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
9387

94-
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.
9589

96-
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.
9791

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

100-
## 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**.
10195

102-
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**.
10397

104-
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.
10599

106-
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.":::
107101

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

116-
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.
117105

118-
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.
119107

120-
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.
121109

122-
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.
123111

124-
`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).
125113

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

128-
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**.
129117

130-
### Outputs
118+
## Outputs from HTTP + Swagger operations
131119

132-
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:
133121

134122
| Property name | Type | Description |
135123
|---------------|------|-------------|
136-
| **headers** | Object | The headers from the request |
137-
| **body** | Object | The object with the body content from the request |
138-
| **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. |
139127

140128
| Status code | Description |
141129
|-------------|-------------|
@@ -147,8 +135,47 @@ The **HTTP + Swagger** call returns the following information:
147135
| 404 | Not Found |
148136
| 500 | Internal server error. Unknown error occurred. |
149137

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

152-
* [Managed connectors for Azure Logic Apps](/connectors/connector-reference/connector-reference-logicapps-connectors)
153-
* [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
154179

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)