Import a Logic App as an API
This article shows how to import a Logic App as an API and test the imported API.
In this article, you learn how to:
- Import a Logic App as an API
- Test the API in the Azure portal
- Test the API in the Developer portal
- Complete the following quickstart: Create an Azure API Management instance
- Make sure there is a Logic App in your subscription that exposes an HTTP endpoint. For more information, Trigger workflows with HTTP endpoints
Go to your API Management instance
Sign in to the Azure portal.
Select All services.
In the search box, enter
In the search results, select API Management services.
Select your API Management service instance.
To add API Management to your favorites in the Azure portal, select the star.
The API Management icon () now appears in the left menu in the portal.
Select APIs from under API MANAGEMENT.
Select Logic App from the Add a new API list.
Press Browse to see the list of Logic Apps with HTTP trigger in your subscription. (Note that Logic Apps without HTTP trigger will not appear in the list.)
Select the app. API Management finds the swagger associated with the selected app, fetches it, and imports it.
Add an API URL suffix. The suffix is a name that identifies this specific API in this API Management instance. It has to be unique in this API Management instance.
Publish the API by associating the API with a product. In this case, the "Unlimited" product is used. If you want for the API to be published and be available to developers, add it to a product. You can do it during API creation or set it later.
Products are associations of one or more APIs. You can include a number of APIs and offer them to developers through the developer portal. Developers must first subscribe to a product to get access to the API. When they subscribe, they get a subscription key that is good for any API in that product. If you created the API Management instance, you are an administrator already, so you are subscribed to every product by default.
By default, each API Management instance comes with two sample products:
Test the imported API in the Azure portal
Operations can be called directly from the Azure portal, which provides a convenient way to view and test the operations of an API.
Select the API you created in the previous step.
Press the Test tab.
Select some operation.
The page displays fields for query parameters and fields for the headers. One of the headers is "Ocp-Apim-Subscription-Key", for the subscription key of the product that is associated with this API. If you created the API Management instance, you are an administrator already, so the key is filled in automatically.
Backend responds with 200 OK and some data.
Operations can also be called Developer portal to test APIs.
Select the API you created in the "Import and publish a back-end API" step.
Press Developer portal.
The "Developer portal" site opens up.
Select the API that you created.
Click the operation you want to test.
Press Try it.
After an operation is invoked, the developer portal displays the Response status, the Response headers, and any Response content.
Append other APIs
An API can be composed of APIs exposed by different services, including the OpenAPI Specification, a SOAP API, the API Apps feature of Azure App Service, Azure Function App, Azure Logic Apps, and Azure Service Fabric.
To append a different API to your existing API, complete the following steps. When you import another API, the operations are appended to your current API.
- Go to your Azure API Management instance in the Azure portal.
- Select APIs from the menu on the left.
- Click ... next to the API that you want to append another API to.
- Select Import from the drop-down menu.
- Select a service from which to import an API.
Every Logic App has manual-invoke operation. If you want to comprise your API of multiple logic apps, in order not to have collision, you need to rename the function.
- API import limitations
- Import an OpenAPI Specification
- Import a SOAP API
- Import a SOAP API and convert to REST
- Import an Azure API app
- Import an Azure Function App
- Import an Azure Logic App
- Import a Service Fabric service
- Edit an API