Aspirerelease/17.0
Watch Aspire live streamsDocsTry Aspire

PublishAsMigrationBundle

Method
📦 Aspire.Hosting.EntityFrameworkCore v17.0.0-preview.1.26565.2
func (EFMigrationResource) PublishAsMigrationBundle(options ...*PublishAsMigrationBundleOptions) EFMigrationResource

Signature

methodPublishAsMigrationBundlebuilder
Configures the EF migration resource to generate a migration bundle during publishing.
PublishAsMigrationBundle(options ...*PublishAsMigrationBundleOptions) EFMigrationResource
options...*PublishAsMigrationBundleOptionsOptional settings, described under Options.

Optional parameters are passed in a trailing options ...*PublishAsMigrationBundleOptions argument.

TargetRuntime*stringThe target runtime identifier for the bundle (e.g., linux-x64, win-x64). If null and publishContainer is true, defaults to linux-x64 to match the default Linux base container image used for the generated Dockerfile. If null and publishContainer is false, the bundle targets the runtime hosting aspire publish.
SelfContained*boolIf true, creates a self-contained bundle that includes the .NET runtime.
PublishContainer*boolIf true, the bundle is published as a container image that applies migrations at deploy time. The resource becomes a compute resource; each target environment deploys it the same way it deploys any other container (supplying connection strings from referenced IResourceWithConnectionString dependencies via the standard WithReference mechanism).
BaseImage*stringOverrides the base container image for the generated Dockerfile. When null (the default), the image is derived from the project's target framework — for example, mcr.microsoft.com/dotnet/runtime:10.0 for a net10.0 framework-dependent bundle. Set this when the default is not suitable, e.g. for preview SDKs or custom base images. Only meaningful when publishContainer is true.
EFMigrationResource

The resource builder for chaining.

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

Applies to

This method applies to the following types: