Azure Logic Apps - Get Workflows via API from Postman

Gianfranco Coppola (MSC Sorrento) 65 Reputation points
2024-11-11T17:10:07.4333333+00:00

Hello,

I am trying to retrieve the list of workflows created on Azure Logic Apps via API. On the Azure side, I have a single resource group within which a Logic App (Standard) resource has been created. Within this Logic App, we have defined several workflows. The goal is to determine via API (with Postman, for now) which workflows are defined within this resource group.

To achieve this, I first added our backend application with the Logic App Contributor role in the IAM settings of the resource group. Then, after having retrieved the access token to use in the Authorization header of the next APIs, I use it for the "Workflows - List By Resource Group" API via the following endpoint:

https://management.azure.com/subscriptions/{subscription_id}/resourceGroups/{resource_group_name}/providers/Microsoft.Logic/workflows?api-version=2019-05-01

(The API documentation is available at the following URL: https://learn.microsoft.com/en-us/rest/api/logic/workflows/list-by-resource-group?view=rest-logic-2016-06-01&tabs=HTTP).

This API returns an empty array, despite the fact that within the resource group, there is a Logic App with a total of 6 workflows.

Additionally, using the "Resources - List By Resource Group" API at the following endpoint:

https://management.azure.com/subscriptions/{subscription_id}/resourceGroups/{resource_group_name}/resources?api-version=2024-08-01

(documented at https://learn.microsoft.com/en-us/rest/api/resources/resources/list-by-resource-group?view=rest-resources-2021-04-01), the Logic App we created on the web portal is not mentioned among the resources returned in the API response.

Can you help us resolve this issue? Thank you.

Azure Logic Apps
Azure Logic Apps
An Azure service that automates the access and use of data across clouds without writing code.
3,249 questions
0 comments No comments
{count} votes

Accepted answer
  1. VenkateshDodda-MSFT 22,401 Reputation points Microsoft Employee
    2024-11-12T04:54:20.1866667+00:00

    @Gianfranco Coppola (MSC Sorrento) Thanks for posting your question in Microsoft Q&A, apologize for any inconvenience caused on this.

    Based on the shared information, I understand that you want to list the workflows which are present in the standard logic app.

    This Azure Management Rest API Workflows - List By Resource Group is for consumption logic apps not applicable for standard.

    Whenever, you provision a standard logic app & workflows it will be deployed inside an app service plan you need to use the Workflow Azure Management Rest API's under the app service rather than using Rest API under Logic Apps to query the standard logic app workflow.

    Here is the list of supported Rest API available to query run histories, actions in standard logic app workflows.

    User's image

    Unfortunately, there is no Rest API available to directly list the workflows within standard logic apps.

    However, after conducting further investigation using the f12 browser trace, we found the following REST API that can be used to list workflows, and you need to pass bearer token for Authorization header.

    https://management.azure.com/subscriptions/{{SubscriptionId}}/resourcegroups/{{ResourceGroup}}/providers/Microsoft.Web/sites/{{LogicAppName}}/hostruntime/runtime/webhooks/workflow/api/management/workflows?api-version=2018-11-01
    

    Here is the sample output for your reference:
    User's image

    Note:
    Make sure your service principal or user account from which you are generating the access token is assigned either with Website Contributor or Contributor RBAC role.

    Hope this helps, let me know if you have any further questions on this.
    Please accept as "Yes" if the answer is helpful so that it can help others in the community.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.