Reputation: 8292
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.
Upvotes: 0
Views: 77
Reputation: 11393
It worked for me using rest api's. I followed Microsoft Document and below are my observations:
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"
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"
So, for rit65y Logic App and test is workflow name :
Upvotes: 0