0

I'm trying to work through an error with getting the callback URL for a trigger in a Standard Azure Logic App. I'm using the az rest command to reproduce the problem that I see when I try to running a deployment via a Bicep template. Sure enough, I see the exact same results in the REST API that I do via my Bicep deployment.

Via the REST API, I can see my logic app workflow and its triggers:

az rest --method get --uri https://management.azure.com/subscriptions/<mysubscription>/resourceGroups/<myrg>/providers/Microsoft.Web/sites/<my-std-logicapp>/hostruntime/runtime/webhooks/workflow/api/management/workflows/<my-wf>?api-version=2024-04-01

This gives me results I would expect:

{
  "definition_href": "https://my-std-logicapp.azurewebsites.net/admin/vfs/site/wwwroot/my-wf/workflow.json",
  "health": {
    "state": "Healthy"
  },
  "href": "https://my-std-logicapp.azurewebsites.net/runtime/webhooks/workflow/api/management/workflows/my-wf",
  "isDisabled": false,
  "kind": "Stateful",
  "name": "my-wf",
  "triggers": {
    "When_event_is_received": {
      "kind": "",
      "type": "ApiConnectionWebhook"
    }
  }
}

But when I try to extend this REST call to get to the callback URL for the trigger, it gives me errors. For example:

az rest --method post --uri https://management.azure.com/subscriptions/<mysubscription>/resourceGroups/<myrg>/providers/Microsoft.Web/sites/<my-std-logicapp>/hostruntime/runtime/webhooks/workflow/api/management/workflows/<my-wf>/triggers/When_event_is_received/listCallbackUrl?api-version=2024-04-01

I get this error:

Not Found({"error":{"code":"WorkflowNotFound","message":"The workflow 'my-wf' could not be found."}})

To further isolate the problem, I tried to use the REST API to just list the triggers as described in the MS Documentation:

az rest --method get --uri https://management.azure.com/subscriptions/<mysubscription>/resourceGroups/<myrg>/providers/Microsoft.Web/sites/<my-std-logicapp>/hostruntime/runtime/webhooks/workflow/api/management/workflows/<my-wf>/triggers?api-version=2024-04-01

This gives me the exact same error as before: The workflow name cannot be found.

I have checked multiple times to ensure that the workflow name in my az rest commands matches exactly what is shown in the successful call that returns the workflow resource. But for some reason it fails only when I get down to the triggers.

Any ideas on what might cause this to fail?

Clarification - This appears to be an issue with one specific standard logic app, as I have another standard logic app in the same RG where this works just fine. Both logic apps were created in the same way using nearly identical Bicep templates. Comparing the properties of the LA that works and the LA that fails has not yielded any explanation. Any ideas of what could be wrong with a specific standard logic app that would cause this API to fail would be greatly appreciated.

Additional clarification: I am attempting to do this via the API as part of debugging the issue when using the listCallbackUrl function for a standard logic app, as suggested in this answer to another SO post:

listCallbackUrl(resourceId('Microsoft.Web/sites/hostruntime/webhooks/api/workflows/triggers', logicAppName, 'runtime', 'workflow', 'management', consumerWorkflowName, consumerWorkflowTriggerName), '2021-03-01').value

The above listCallbackUrl function call returns the exact same WorkflowNotFound error as the API calls.

4
  • Did you try any other command? Commented Feb 14 at 3:30
  • This question is similar to: Not able to retrieve Logic app (standard) Workflow URL from ARM template. If you believe it’s different, please edit the question, make it clear how it’s different and/or how the answers on that question are not helpful for your problem. Commented Feb 14 at 5:22
  • @RithwikBojja As I mentioned in the problem description, I tried the command to get the workflow itself, and that works as expected. It only fails when I try to go deeper and address one of the triggers within the workflow. Is there any other command you recommend trying? Commented Feb 14 at 14:46
  • @Skin My attempt to use the API here was done in the process of debugging the issue when using the exact solutions suggested by the SO post you referenced. Same error there. I've added that clarification to the original post. Commented Feb 14 at 14:47

1 Answer 1

0

It worked for me using rest api's. I followed Microsoft Document and below are my observations:

enter image description here

Firstly testing for Logic Name with name rit65y and workflow name is rithwiktest.

Listing Trigger:

az rest --method get --uri "https://management.azure.com/subscriptions/13f2rithwik616/resourceGroups/rithwik/providers/Microsoft.Web/sites/rit65y/hostruntime/runtime/webhooks/workflow/api/management/workflows/rithwiktest/triggers?api-version=2024-04-01"

enter image description here

Callback URL for the trigger:

az rest --method post --uri "https://management.azure.com/subscriptions/13frithwik616/resourceGroups/rithwik/providers/Microsoft.Web/sites/rit65y/hostruntime/runtime/webhooks/workflow/api/management/workflows/rithwiktest/triggers/When_a_resource_event_occurs/listCallbackUrl?api-version=2024-04-01"

enter image description here

So, for rit65y Logic App and test is workflow name :

enter image description here

Sign up to request clarification or add additional context in comments.

1 Comment

This is exactly what I have been trying but I get an error when listing the trigger. Strangely enough, I have found that another Standard Logic app in the same resource group, created in exactly the same way via a Bicep template deployment, works just fine. I have been going through all of the settings and configuration details for both standard logic apps to see if there is a difference that might cause one to work and the other to fail. I haven't found anything yet. Any ideas on what could be different between standard logic apps to cause this discrepancy?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.