Aspirerelease/17.0
Watch Aspire live streamsDocsTry Aspire

AddUvicornApp

Method
📦 Aspire.Hosting.Python v17.0.0
func (DistributedApplicationBuilder) AddUvicornApp(
name string,
appDirectory string,
app string,
) UvicornAppResource

Signature

methodAddUvicornAppbuilder
Adds a Uvicorn-based Python application to the distributed application builder with HTTP endpoint configuration.
AddUvicornApp(
name string,
appDirectory string,
app string,
) UvicornAppResource
namestringThe unique name of the Uvicorn application resource.
appDirectorystringThe directory containing the Python application files.
appstringThe ASGI app import path which informs Uvicorn which module and variable to load as your web application. For example, "main:app" means "main.py" file and variable named "app".
UvicornAppResource

A resource builder for further configuration of the Uvicorn Python application resource.

Returns a handle; failures surface later via Err().

Applies to

This method applies to the following types:

typeDistributedApplicationBuilder