title | description | services | documentationcenter | author | manager | editor | ms.service | ms.workload | ms.tgt_pltfrm | ms.topic | ms.date | ms.author |
---|---|---|---|---|---|---|---|---|---|---|---|---|
Import a Logic App as an API with the Azure portal | Microsoft Docs |
This article shows you how to use API Management to import a Logic App (Consumption) resource as an API. |
api-management |
dlepow |
cfowler |
api-management |
mobile |
na |
article |
04/16/2021 |
danlep |
This article shows how to import a Logic App as an API and test the imported API.
In this article, you learn how to:
[!div class="checklist"]
- Import a Logic App as an API
- Test the API in the Azure portal
Note
API Management supports automated import of a Logic App (Consumption) resource. which runs in the multi-tenant Logic Apps environment. Learn more about single-tenant versus muti-tenant Logic Apps.
- Complete the following quickstart: Create an Azure API Management instance
- Make sure there is a Consumption plan-based Logic App resource in your subscription that exposes an HTTP endpoint. For more information, Trigger workflows with HTTP endpoints
[!INCLUDE api-management-navigate-to-instance.md]
-
Navigate to your API Management service in the Azure portal and select APIs from the menu.
-
Select Logic App from the Add a new API list.
:::image type="content" source="./media/import-logic-app-as-api/logic-app-select.png" alt-text="Select logic app category":::
-
Press Browse to see the list of Logic Apps with HTTP trigger in your subscription.
- Logic apps without HTTP trigger will not appear in the list.
:::image type="content" source="./media/import-logic-app-as-api/browse-logic-apps.png" alt-text="Browse for existing logic apps with correct trigger":::
-
Select the logic app.
:::image type="content" source="./media/import-logic-app-as-api/select-logic-app-import-2.png" alt-text="Select logic app":::
-
API Management finds the swagger associated with the selected app, fetches it, and imports it.
-
Add an API URL suffix.
- The suffix uniquely identifies this specific API in this API Management instance.
:::image type="content" source="./media/import-logic-app-as-api/create-from-logic-app.png" alt-text="Finish up fields":::
-
If you want the API to be published and available to developers, Switch to the Full view and associate it with a Product. We use the "Unlimited" product in this example.
- You can add your API to a product either during creation or later via the Settings tab.
[!NOTE] Products are associations of one or more APIs offered to developers through the developer portal. First, developers must subscribe to a product to get access to the API. Once subscribed, they get a subscription key for any API in that product. As creator of the API Management instance, you are an administrator and are subscribed to every product by default.
Each API Management instance comes with two default sample products:
- Starter
- Unlimited
-
Enter other API settings.
- You can set these values during creation or later by going to the Settings tab. The settings are explained in the Import and publish your first API tutorial.
-
Select Create.
Operations can be called directly from the Azure portal, which provides a convenient way to view and test the operations of an API.
:::image type="content" source="./media/import-logic-app-as-api/test-logic-app-api.png" alt-text="Test the logic app":::
-
Select the API you created in the previous step.
-
Press the Test tab.
-
Select the operation you want to test.
- The page displays fields for query parameters and headers.
- One of the headers is "Ocp-Apim-Subscription-Key", for the product subscription key associated with this API.
- As creator of the API Management instance, you are an administrator already, so the key is filled in automatically.
-
Press Send.
- When the test succeeds, the backend responds with 200 OK and data.
[!INCLUDE api-management-navigate-to-instance.md]
Note
Every Logic App has manual-invoke operation. To comprise your API of multiple logic apps and avoid collision, you need to rename the function. In order to rename the function/API, please navigate to the OpenAPI Specification editor and change the title value.
[!INCLUDE api-management-define-api-topics.md]
[!div class="nextstepaction"]