How to get the current logic app's name from within Azure function.

Dzung La 26 Reputation points
2021-08-16T08:24:41.333+00:00

Hi all,

I have a logic app that calls an azure function as one of the actions. Is there any way for me to dynamically get the name of this logic app (and its url) from within this azure function?

I'm hoping that there's some libraries (dlls) from the Azure SDK for .Net that would allow us to get this kind of runtime information.

Thank you all for your help in advance.

Kind regards,

Dzung.

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,678 questions
Azure Logic Apps
Azure Logic Apps
An Azure service that automates the access and use of data across clouds without writing code.
2,996 questions
0 comments No comments
{count} votes

Accepted answer
  1. MayankBargali-MSFT 70,016 Reputation points
    2021-08-16T09:51:54.507+00:00

    @Dzung La I believe the logic app URL you are talking about is the Native HTTP Trigger URL that is automatically generated once you save it in your workflow.
    Unfortunately, there is no way to find who (which client) has called the HTTP trigger function until and unless your HTTP function have the required body/parameter that specifically calls out from which client the request was initiated.

    The possible solution would be your client (in this case azure logic app) passing the Native HTTP Trigger URL along with the logic app name in the request body. According to your logic you can parse these value at your HTTP function app to know which logic app URL and logic app name have called it.


2 additional answers

Sort by: Most helpful
  1. Narasimhan Bharatham Ramani 1 Reputation point
    2022-07-06T13:51:01.017+00:00

    It is possible to get the name using workflow() dynamic expression to a variable and parse it via JSON .

    218212-image.png

    Thanks
    Narasimhan


  2. Mridul Lahori 0 Reputation points
    2024-07-11T21:17:24.0266667+00:00

    Fetch the Logic App Name using Expression - appsetting('WEBSITE_SITE_NAME')

    Fetch the workflow name using Expression - workflow()['name']

    0 comments No comments