Search code examples
power-automate

Reference an environmental variable into a cloud flow


I have a power flow that is triggered by a HTTP request. I have added a trigger condition by requiring a key to restrict unauthorized calls, like seen below: enter image description here

I want to store this key to an environmental variable and reference this value to trigger condition. How can this be done?


Solution

  • You can read the environment variable value in Power automate cloud flow trigger conditions using syntax like:

    parameters('MyEnvVariable (cr86e_MyEnvVariable)')
    

    Where MyEnvVariable is Display name and cr86e_MyEnvVariable is Name of environment variable.

    enter image description here


    Assuming your environment variable display name and name is as given in above example, you can use trigger condition like:

    @equals(triggerOutputs()['headers']?['runKey'],parameters('MyEnvVariable (cr86e_MyEnvVariable)'))