Azure Logic App SDK not working for non-consumption Logic Apps

Benedikt Schmitt 140 Reputation points
2025-10-10T13:24:28.46+00:00

I want to write code that can start workflows in a Logic App and monitor them. For that I am using the aio.LogicManagementClient from the Logic App SDK. So far I have tried using workflows.get() to get the status of one of my runs.

This only works for consumption-based Logic Apps however. Every time I try to get the status of a run in a non-consumption App, it tells me, that it can't find the declared workflow.

My first question is how does the Logic App SDK work for non-Consumption based Logic Apps.

My second question is, how do I start the run of a specific workflow, while getting the run-name as a return value? I want to start the run and get the run-name so I can use it to monitor the status.

Azure Logic Apps
Azure Logic Apps
An Azure service that automates the access and use of data across clouds without writing code.
{count} votes

1 answer

Sort by: Most helpful
  1. Pravallika KV 165 Reputation points Microsoft External Staff Moderator
    2025-10-16T13:50:12.5533333+00:00

    Hi Benedikt Schmitt,

    Thank you reaching out to Microsoft Q&A.

    I have tested the same by trying to run Standard Logic App workflow using LogicManagementClient, and got the same error:

    
    (env) PS C:\logic-app-test> py logic_app_test.py                                   
    
    Error: (ResourceNotFound) The Resource 'Microsoft.Logic/workflows/stateless1' under resource group 'testrg' was not found. For more details please go to https://aka.ms/ARMResourceNotFoundFix
    
    Code: ResourceNotFound
    
    Message: The Resource 'Microsoft.Logic/workflows/stateless1' under resource group 'testrg' was not found. For more details please go to https://aka.ms/ARMResourceNotFoundFix
    
    

    This error occurs when you try to use workflows.get() or workflowRuns.get() on a Standard Logic App, because the SDK only queries the Logic resource provider, not the Web App resource provider where Standard Logic Apps live.

    The SDK is calling the ARM API looking for a resource like:

    Microsoft.Logic/workflows/workflowname

    But Standard Logic Apps are deployed as App Service resources Microsoft.Web/sites/workflows instead of Microsoft.Logic/workflows which the SDK targets. Azure SDK LogicManagementClient doesn't support Standard Logic Apps

    
    /subscriptions/subscriptionid/resourceGroups/rg/providers/Microsoft.Web/sites/logicappname
    
    • SDK methods like get(), run(), or list() only work with Consumption Logic Apps.
    • For Standard Logic Apps, you need to use HTTP endpoints and monitor them through Application Insights or Runs History in the portal.

    Example:

    
    import aiohttp
    
    import asyncio
    
    trigger_url = "workflow_url"
    
    async def trigger_logic_app():
    
        async with aiohttp.ClientSession() as session:
    
            async with session.post(trigger_url, json={"input": "value"}) as resp:
    
                print(f"HTTP status: {resp.status}")
    
                content_type = resp.headers.get("Content-Type", "")
    
                if "application/json" in content_type:
    
                    data = await resp.json()
    
                    run_id = data.get("runId")
    
                    print(f"Workflow started with runId: {run_id}")
    
                    return run_id
    
                else:
    
                    text = await resp.text()
    
                    print("Non-JSON response received:")
    
                    print(text)
    
                    return None
    
    asyncio.run(trigger_logic_app())
    
    

    Hope it helps!


    Please do not forget to click "Accept the answer” and Yes, this can be beneficial to other community members.

    User's image

    If you have any other questions, let me know in the "comments" and I would be happy to help you.


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.