Description
Description
We removed AddDockerComposePublisher, AddKubernetesPublisher and AddAzurePublisher APIs.
Version
.NET Aspire 9.3
Previous behavior
9.2 introduced a preview version of the publisher API and introduced 3 new publishers:
- DockerCompose
- Kubernetes
- Azure
These were accompanied by an API on IDistributedApplicationBuilder.AddXPublisher methods. Adding multiple publisher was supported, and the aspire publish CLI command would let you pick one.
New behavior
In 9.3 we've removed these publishers in favor of new resource types:
- DockerEnvironmentResource
- KuberentesEnvironmentResource
- AzureEnvironmentResource
These resources have a new PublisherCallbackAnnotation
that describes their publish behavior. This new publisher (the default publisher) looks at all resources that have this new annotation and invokes the callback to produce assets. The aspire publish
command has changed to use the default publisher and emit whatever is described in your application with these resources (you never pick a publisher).
Type of breaking change
- Binary incompatible: Existing binaries might encounter a breaking change in behavior, such as failure to load or execute, and if so, require recompilation.
- Source incompatible: When recompiled using the new SDK or component or to target the new runtime, existing source code might require source changes to compile successfully.
- Behavioral change: Existing binaries might behave differently at run time.
Reason for change
dotnet/aspire#9089 explains the whole thing
Recommended action
Use the new APIs:
- builder.AddDockerComposeEnvironment(..)
- builder.AddKubernetesEnvironment(..)
- builder.AddAzureEnvironment(..) (implicit with any azure resource)
Affected APIs
IDistributedApplicationBuilder.AddDockerComposePublisher
IDistributedApplicationBuilder.AddKuberentesPublisher
IDistributedApplicationBuilder.AddAzurePublisher