Azure Function RuntimeError: There is no current event loop in thread 'ThreadPoolExecutor-0_0'. while creating Graphql API

Vinod Kumar Pottupalli 21 Reputation points
2022-03-23T12:29:03.363+00:00

While creating a GraphQl API on Azure function getting above error.
Executed 'Functions.GraphQLAPI' (Failed, Id=71aea584-4b07-49ae-933c-5571a8d83b4d, Duration=38ms)
[2022-03-23T12:07:04.997Z] System.Private.CoreLib: Exception while executing function: Functions.GraphQLAPI. System.Private.CoreLib: Result: Failure
Exception: RuntimeError: There is no current event loop in thread 'ThreadPoolExecutor-0_0'.

I tried changing the Python version 3.8.10 to 3.9.11 and changing the azure function/extension bundle version and ariadne not usefull.

current packages version.

Package Version


anyio 3.5.0
ariadne 0.14.1
azure-functions 1.10.1
graphql-core 3.1.7
idna 3.3
pip 21.1.1
setuptools 56.0.0
sniffio 1.2.0
starlette 0.13.8
typing-extensions 4.1.1

trying to implement GRaphQl on Azure function with below link https://www.vizeit.com/serverless-graphql-api-on-azure-using-python/

Could you please help me to resolve this issue

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,261 questions
{count} votes

Accepted answer
  1. MughundhanRaveendran-MSFT 12,421 Reputation points
    2022-03-30T14:52:11.177+00:00

    @Vinod Kumar Pottupalli ,

    Please help me with the below queries

    1. Are you getting this error while running the functions locally?
    2. How frequently do you see this issue? Did this ever work?
    3. Please provide complete stack of the error message

0 additional answers

Sort by: Most helpful