How to dynamically pass the URL from http request to actions in Azure Logic App?

Smith 0 Reputation points
2024-04-28T04:28:23.65+00:00

Let say I have a swagger contract like

https://petstore3.swagger.io/

I want to implement GET and POST like

User's image

Question: How to dynamically pass the URL from http request to actions in Azure Logic App?

User's image

I tried concat(triggerOutputs()?['relativePathParameters'], '/pet/findByStatus') but it does not work!

To keep it simple, I am just printing the @triggerOutputs()?['relativePathParameters'] to check it's value. Here is the full json. It returns null.

{
    "definition": {
        "$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
        "actions": {
            "Response": {
                "type": "Response",
                "kind": "Http",
                "inputs": {
                    "statusCode": 200,
                    "body": {
                        "url": "@triggerOutputs()?['relativePathParameters']"
                    }
                },
                "runAfter": {}
            }
        },
        "contentVersion": "1.0.0.0",
        "outputs": {},
        "triggers": {
            "When_a_HTTP_request_is_received": {
                "type": "Request",
                "kind": "Http"
            }
        }
    },
    "kind": "Stateful"
}

User's image

Azure Logic Apps
Azure Logic Apps
An Azure service that automates the access and use of data across clouds without writing code.
2,873 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Sonny Gillissen 3,271 Reputation points
    2024-05-10T13:34:55.3166667+00:00

    Hi Smith,

    Thank you for reaching out on Microsoft Q&A!

    It's not possible natively in Azure Logic Apps, however you can use the Microsoft Graph API to retrieve the URL of a Logic App. Please find the documentation below:

    https://learn.microsoft.com/en-us/rest/api/logic/workflows/list-callback-url?view=rest-logic-2016-06-01&tabs=HTTP

    Please click “Accept answer” if you find this helpful. Feel free to drop additional queries in the comments below!

    Kind regards,

    Sonny

    0 comments No comments