VolumeMountBindingAnnotation
namespace Aspire.Hosting.ApplicationModel;
public sealed class VolumeMountBindingAnnotation : Aspire.Hosting.ApplicationModel.IResourceAnnotation{ // ...}Remarks
Section titled RemarksThis annotation is the extensibility point compute environments use to participate in the portable volume path convention. It carries two independent facets, either of which may be absent:
Volumerecords that the workload reads the effective storage path from an environment variable. The variable itself is written by anMount Binding Annotation. Environment Variable Name Environmentwhose closure captures the name, which makes the intent invisible to anything inspecting the model. Restating it here lets a compute environment tell whether a host process materializes a local backing store for the volume, without having to observe the callback running.Callback Annotation Volumelets a compute environment supply the local directory that backs the volume in run mode. Without it, host processes fall back to a workload-scoped directory underMount Binding Annotation. Run Mode Host Path Resolver I.Aspire Store
The two facets are produced by different parties at different times — the AppHost author opts into the environment variable, while the compute environment supplies the local path — so a resource can carry several of these annotations for the same Volume. A binding resolves through its own Volume when it has one, and otherwise takes the last sibling that does. Volume alone is not a unique key, because separate compute environments can each declare a volume under the same name.
Constructors1
Section titled ConstructorsProperties4
Section titled PropertiesEnvironmentVariableName get; initstring?null when this binding only supplies a run-mode path. MountPath get; initstring?null when this binding only supplies a run-mode path for a mount declared elsewhere. RunModeHostPathResolver get; initFunc<EnvironmentCallbackContext, string> null to use the default workload-scoped directory under IAspireStore . Methods1
Section titled Methodsstring