Skip to content
DocsTry Aspire
DocsTry

PythonAppResource

Handle
📦 Aspire.Hosting.Python v13.4.0
interface PythonAppResource
extends IComputeResource,
IContainerFilesDestinationResource,
IResource,
IResourceWithArgs,
IResourceWithEndpoints,
IResourceWithEnvironment,
IResourceWithProbes,
IResourceWithWaitSupport,
IResourceWithServiceDiscovery {
withDebugging(): PythonAppResource;
withEntrypoint(
entrypointType: EntrypointType,
entrypoint: string): PythonAppResource;
withPip(
install?: boolean,
installArgs?: string[]): PythonAppResource;
withUv(
install?: boolean,
args?: string[]): PythonAppResource;
withVirtualEnvironment(
virtualEnvironmentPath: string,
createIfNotExists?: boolean): PythonAppResource;
}

Methods

methodwithDebuggingbuilder
Enables debugging support for the Python application.
withDebugging(): PythonAppResource
PythonAppResource
methodwithEntrypointbuilder
Configures the entrypoint for the Python application.
withEntrypoint(
entrypointType: EntrypointType,
entrypoint: string): PythonAppResource
entrypointTypeEntrypointType
entrypointstring
PythonAppResource
methodwithPipbuilder
Configures the Python resource to use pip as the package manager and optionally installs packages before the application starts.
withPip(
install?: boolean,
installArgs?: string[]): PythonAppResource
installbooleanoptional= True
installArgsstring[]optional
PythonAppResource
methodwithUvbuilder
Adds a UV environment setup task to ensure the virtual environment exists before running the Python application.
withUv(
install?: boolean,
args?: string[]): PythonAppResource
installbooleanoptional= True
argsstring[]optional
PythonAppResource
Configures a custom virtual environment path for the Python application.
withVirtualEnvironment(
virtualEnvironmentPath: string,
createIfNotExists?: boolean): PythonAppResource
virtualEnvironmentPathstring
createIfNotExistsbooleanoptional= True
PythonAppResource