skip to Main Content

I have created azure logic app to restore database from one prod to dev and for multiple envs

Now I want to automate my logic app workflow to run using any script or command line eg: using bash, PowerShell or AZ cli with my input parameters Actual value in screenshot should change using powershell (dev, int, qa)

enter image description here

I tried with powershell using -parameter option but it doesn’t work.

2

Answers


  1. To run with powershell, regardless of having an http trigger, you can use :

    Start-AzLogicApp -ResourceGroupName "ResourceGroup11" -Name "LogicApp03" -TriggerName "Trigger22"

    With an Http Triger you have the extra option to invoke through http

    Login or Signup to reply.
  2. I do agree with @Skin and @BrunoLucasAzure, if you are using http trigger you can follow below process:

    Thanks, @shelladmin

    I have followed Micrsosoft-Document and ShellGeek Blog, and have reproduced in my environment and got expected results as below:

    Connect-AzAccount -subscriptionid "b82b8374c23f"
    $params = @{
        dev = "RITHWIK"
        int = "BOJJA"
        qa = "CHOTU"
    }
    
    
    $uri = "https://prod-80.eastus.logic.azure.com:443/workflows/6433d8adb2a94a5ba7311/triggers/manual/paths/invoke?api-version=2016-10-01&sp=%2ual%2Frun&sv=1.0&sig=heG1IPRsFx_VUtgA_cOGttk"
    foreach ($param in $params.GetEnumerator()) {
        $uri += "&" + $param.Key + "=" + $param.Value
    }
    
    Invoke-RestMethod -Uri $uri -Method POST
    

    enter image description here

    enter image description here

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search