-
Notifications
You must be signed in to change notification settings - Fork 152
Remove publisher APIs #3389
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Remove publisher APIs #3389
Changes from 4 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
b5e4656
Fixes #3373, removal of publisher APIs.
IEvangelist 8ca9ac8
Minor tweaks
IEvangelist 518d0cb
Edit pass
IEvangelist b1e3561
Sort table
IEvangelist 974d62f
Apply suggestions from code review
IEvangelist 442b970
Address feedback
IEvangelist File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
--- | ||
title: "Breaking change - Removal of DockerComposePublisher, KubernetesPublisher, and AzurePublisher" | ||
description: "Learn about the breaking change in .NET Aspire 9.3 where publisher APIs were removed in favor of new resource types." | ||
ms.date: 5/12/2025 | ||
ai-usage: ai-assisted | ||
ms.custom: https://github.com/dotnet/docs-aspire/issues/3373 | ||
--- | ||
|
||
# Removal of DockerComposePublisher, KubernetesPublisher, and AzurePublisher | ||
|
||
In .NET Aspire 9.3, the `AddDockerComposePublisher`, `AddKubernetesPublisher`, and `AddAzurePublisher` APIs were removed. These APIs are now replaced with new resource types that provide a more streamlined and flexible publishing experience. | ||
|
||
## Version introduced | ||
|
||
.NET Aspire 9.3 | ||
|
||
## Previous behavior | ||
|
||
In .NET Aspire 9.2, the publisher API was introduced in preview, allowing the use of the following publishers: | ||
|
||
- DockerCompose | ||
- Kubernetes | ||
- Azure | ||
|
||
These publishers were added using the following methods: | ||
|
||
- <xref:Aspire.Hosting.DockerComposePublisherExtensions.AddDockerComposePublisher*> | ||
- <xref:Aspire.Hosting.KubernetesPublisherExtensions.AddKubernetesPublisher*> | ||
- <xref:Aspire.Hosting.AzurePublisherExtensions.AddAzurePublisher*> | ||
|
||
Multiple publishers could be added, and the `aspire publish` CLI command allowed users to select one for publishing. | ||
|
||
## New behavior | ||
|
||
In .NET Aspire 9.3, the publishers are now replaced with new resource types: | ||
|
||
<!-- TODO: Add xrefs when available. --> | ||
|
||
- `DockerEnvironmentResource` | ||
- `KubernetesEnvironmentResource` | ||
- `AzureEnvironmentResource` | ||
IEvangelist marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
These resources include a `PublisherCallbackAnnotation` that defines their publishing behavior. The default publisher now automatically processes all resources with this annotation to generate assets. The `aspire publish` command no longer requires selecting a publisher; it uses the default publisher to handle all annotated resources. | ||
|
||
Example: | ||
|
||
```csharp | ||
builder.AddDockerComposeEnvironment(publisher => | ||
IEvangelist marked this conversation as resolved.
Show resolved
Hide resolved
|
||
{ | ||
// Configure the Docker environment publisher | ||
}); | ||
|
||
builder.AddKubernetesEnvironment(publisher => | ||
{ | ||
// Configure the Kubernetes environment publisher | ||
}); | ||
|
||
builder.AddAzureEnvironment(publisher => | ||
{ | ||
// Configure the Azure environment publisher | ||
}); | ||
``` | ||
|
||
## Type of breaking change | ||
|
||
This is a [binary incompatible](../categories.md#binary-compatibility), [source incompatible](../categories.md#source-compatibility), and [behavioral change](../categories.md#behavioral-change). | ||
|
||
## Reason for change | ||
|
||
The change simplifies the publishing process by consolidating functionality into resource types with a unified publishing mechanism. For more information, see the [GitHub issue](https://github.com/dotnet/aspire/issues/9089). | ||
|
||
## Recommended action | ||
|
||
Update your code to use the new resource APIs: | ||
|
||
- Replace `AddDockerComposePublisher` with `AddDockerComposeEnvironment(...)`. | ||
- Replace `AddKubernetesPublisher` with `AddKubernetesEnvironment(...)`. | ||
- Replace `AddAzurePublisher` with `AddAzureEnvironment(...)` (implicit with any Azure resource). | ||
|
||
Example: | ||
|
||
```csharp | ||
builder.AddDockerComposeEnvironment(...); | ||
builder.AddKubernetesEnvironment(...); | ||
builder.AddAzureEnvironment(...); | ||
``` | ||
|
||
## Affected APIs | ||
|
||
- `IDistributedApplicationBuilder.AddDockerComposePublisher` | ||
- `IDistributedApplicationBuilder.AddKubernetesPublisher` | ||
- `IDistributedApplicationBuilder.AddAzurePublisher` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.