title | description | services | author | manager | editor | documentationcenter | tags | ms.assetid | ms.service | ms.devlang | ms.topic | ms.tgt_pltfrm | ms.workload | ms.date | ms.author |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Communicate with any endpoint over HTTP - Azure Logic Apps | Microsoft Docs |
Create logic apps that can communicate with any endpoint over HTTP |
logic-apps |
jeffhollan |
anneta |
connectors |
e11c6b4d-65a5-4d2d-8e13-38150db09c0b |
logic-apps |
na |
article |
na |
na |
07/15/2016 |
jehollan; LADocs |
With the HTTP action, you can extend workflows for your organization and communicate to any endpoint over HTTP.
You can:
- Create logic app workflows that activate (trigger) when a website that you manage goes down.
- Communicate to any endpoint over HTTP to extend your workflows into other services.
To get started using the HTTP action in a logic app, see Create a logic app.
A trigger is an event that can be used to start the workflow that is defined in a logic app. Learn more about triggers.
Here’s an example sequence of how to set up the HTTP trigger in the Logic App Designer.
-
Add the HTTP trigger in your logic app.
-
Fill in the parameters for the HTTP endpoint that you want to poll.
-
Modify the recurrence interval on how frequently it should poll.
The logic app now fires with any content that is returned during each check.
The HTTP trigger sends a call to HTTP endpoint on a recurring interval.
By default, any HTTP response code that is lower than 300 causes a logic app to run.
To specify whether the logic app should fire, you can edit the logic app in code view,
and add a condition that evaluates after the HTTP call. Here's an example of an HTTP trigger
that fires when the returned status code is greater than or equal to 400
.
"Http":
{
"conditions": [
{
"expression": "@greaterOrEquals(triggerOutputs()['statusCode'], 400)"
}
],
"inputs": {
"method": "GET",
"uri": "https://blogs.msdn.microsoft.com/logicapps/",
"headers": {
"accept-language": "en"
}
},
"recurrence": {
"frequency": "Second",
"interval": 15
},
"type": "Http"
}
Full details about the HTTP trigger parameters are available on MSDN.
An action is an operation that is carried out by the workflow that is defined in a logic app. Learn more about actions.
-
Choose New Step > Add an action.
-
In the action search box, type http to list the HTTP actions.
-
Add any required parameters for the HTTP call.
-
On the designer toolbar, click Save. Your logic app is saved and published (activated) at the same time.
Here are the details for the trigger that this connector supports. The HTTP connector has one trigger.
Trigger | Description |
---|---|
HTTP | Makes an HTTP call and returns the response content. |
Here are the details for the action that this connector supports. The HTTP connector has one possible action.
Action | Description |
---|---|
HTTP | Makes an HTTP call and returns the response content. |
The following tables describe the required and optional input fields for the action and the corresponding output details that are associated with using the action.
The following are input fields for the action, which makes an HTTP outbound request. A * means that it is a required field.
Display name | Property name | Description |
---|---|---|
Method* | method | The HTTP verb to use |
URI* | uri | The URI for the HTTP request |
Headers | headers | A JSON object of HTTP headers to include |
Body | body | The HTTP request body |
Authentication | authentication | Details in the Authentication section |
The following are output details for the HTTP response.
Property name | Data type | Description |
---|---|---|
Headers | object | Response headers |
Body | object | Response object |
Status Code | int | HTTP status code |
The Logic Apps feature allows you to use different types of authentication against HTTP endpoints. You can use this authentication with the HTTP, HTTP + Swagger, and HTTP Webhook connectors. The following types of authentication are configurable:
- Basic authentication
- Client certificate authentication
- Azure Active Directory (Azure AD) OAuth authentication
The following authentication object is needed for basic authentication. A * means that it is a required field.
Property name | Data type | Description |
---|---|---|
Type* | type | Type of authentication (must be Basic for basic authentication) |
Username* | username | User name to authenticate |
Password* | password | Password to authenticate |
Tip
If you want to use a password that cannot be retrieved from the definition,
use a securestring
parameter and the @parameters()
workflow definition function.
For example:
{
"type": "Basic",
"username": "user",
"password": "test"
}
The following authentication object is needed for client certificate authentication. A * means that it is a required field.
Property name | Data type | Description |
---|---|---|
Type* | type | The type of authentication (must be ClientCertificate for SSL client certificates) |
PFX* | pfx | The Base64-encoded contents of the Personal Information Exchange (PFX) file |
Password* | password | The password to access the PFX file |
Tip
To use a parameter that won't be readable in the definition after saving the logic app,
you can use a securestring
parameter and the @parameters()
workflow definition function.
For example:
{
"type": "ClientCertificate",
"pfx": "aGVsbG8g...d29ybGQ=",
"password": "@parameters('myPassword')"
}
The following authentication object is needed for Azure AD OAuth authentication. A * means that it is a required field.
Property name | Data type | Description |
---|---|---|
Type* | type | The type of authentication (must be ActiveDirectoryOAuth for Azure AD OAuth) |
Tenant* | tenant | The tenant identifier for the Azure AD tenant |
Audience* | audience | The resource you are requesting authorization to use. For example: https://management.core.windows.net/ |
Client ID* | clientId | The client identifier for the Azure AD application |
Secret* | secret | The secret of the client that is requesting the token |
Tip
You can use a securestring
parameter and the @parameters()
workflow definition function to use a parameter that won't be readable in the definition after saving.
For example:
{
"type": "ActiveDirectoryOAuth",
"tenant": "72f988bf-86f1-41af-91ab-2d7cd011db47",
"audience": "https://management.core.windows.net/",
"clientId": "34750e0b-72d1-4e4f-bbbe-664f6d04d411",
"secret": "hcqgkYc9ebgNLA5c+GDg7xl9ZJMD88TmTJiJBgZ8dFo="
}
Now, try out the platform and create a logic app. You can explore the other available connectors in Logic Apps by looking at our APIs list.