Yes, you need a web framework like Flask or FastAPI to expose HTTP endpoints on the Azure VM, because the Azure VM will not automatically manage HTTP requests and routing for you as Azure Functions do.