Share via


UvicornAppResource(String, String, String) Constructor

Definition

Represents a Uvicorn-based Python application resource that can be managed and executed within a Python environment.

public UvicornAppResource(string name, string executablePath, string appDirectory);
new Aspire.Hosting.Python.UvicornAppResource : string * string * string -> Aspire.Hosting.Python.UvicornAppResource
Public Sub New (name As String, executablePath As String, appDirectory As String)

Parameters

name
String

The unique name used to identify the Uvicorn application resource.

executablePath
String

The path to the Python executable. This is typically the Python executable within a virtual environment.

appDirectory
String

The working directory for the Uvicorn application. This is typically the root directory of your Python project containing your ASGI application module.

Remarks

This resource is specifically designed for Python web applications that use Uvicorn as their ASGI server, which is commonly used with frameworks like FastAPI, Starlette, and other ASGI applications.

The resource automatically configures HTTP endpoints and sets up appropriate Uvicorn-specific command-line arguments for host binding and port configuration.

Applies to