def execute_code(loop, timeout=None): with BytesIO() as file_stream: service_principal = DefaultAzureCredential(exclude_cli_credential=True) future = asyncio.run_coroutine_threadsafe( download_blob_using_blobclient(account_name,service_principal, container_name, blob_to_read, file_stream), loop=loop) future.result(timeout) file_stream.flush() file_stream.seek(0) bw=TextIOWrapper(file_stream).read() print(bw) return