title | description | keywords | services | author | manager | editor | documentationcenter | ms.assetid | ms.service | ms.workload | ms.tgt_pltfrm | ms.devlang | ms.topic | ms.date | ms.author |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Deploy and call web APIs & REST APIs from Azure Logic Apps | Microsoft Docs |
Deploy and call your web APIs & REST APIs for system integration workflows in Azure Logic Apps |
web APIs, REST APIs, connectors, workflows, system integrations, authenticate |
logic-apps |
stepsic-microsoft-com |
anneta |
f113005d-0ba6-496b-8230-c1eadbd6dbb9 |
logic-apps |
integration |
na |
na |
article |
05/26/2017 |
LADocs; stepsic |
After you create custom APIs for use in logic app workflows, you must deploy your APIs before you can call them. You can deploy your APIs as web apps, but consider deploying your APIs as API apps, which make your job easier when you build, host, and consume APIs in the cloud and on premises. You don't have to change any code in your APIs - just deploy your code to an API app. You can host your APIs on Azure App Service, a platform-as-a-service (PaaS) offering that provides highly scalable, easy API hosting.
Although you can call any API from a logic app, for the best experience, add OpenAPI (previously Swagger) metadata that describes your API's operations and parameters. This OpenAPI file helps your API integrate more easily and work better with logic apps.
Before you can call your custom API from a logic app, deploy your API as a web app or API app to Azure App Service. Also, to make your OpenAPI file readable by the Logic Apps Designer, set the API definition properties and turn on cross-origin resource sharing (CORS) for your web app or API app.
-
In the Azure portal, select your web app or API app.
-
In the app menu that opens, under API, choose API definition. Set the API definition location to the URL for your OpenAPI swagger.json file.
Usually, the URL appears in this format:
https://{name}.azurewebsites.net/swagger/docs/v1)
-
Under API, choose CORS. Set the CORS policy for Allowed origins to '*' (allow all).
This setting permits requests from Logic App Designer.
For more information, see Build a Node.js RESTful API.
After you set up the API definition properties and CORS, your custom API's triggers and actions should be available for you to include in your logic app workflow.
-
To view websites that have OpenAPI URLs, you can browse your subscription websites in the Logic Apps Designer.
-
To view available actions and inputs by pointing at an OpenAPI document, use the HTTP + Swagger action.
-
To call any API, including APIs that don't have or expose an OpenAPI document, you can always create a request with the HTTP action.