[17.0] Document breaking change: Azure Cosmos DB `configureClientOptions` callback now receives `IServiceProvider`
Los mantenedores suelen responder en 2 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 85/100
- Tipo de issue
- Documentación
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- csharp, markdown
- Área
- documentation
Línea de trabajo
Lee la tabla de cambios incompatibles en src/frontend/src/content/docs/whats-new/aspire-13-3.mdx y la sección configureClientOptions de src/frontend/src/content/docs/integrations/cloud/azure/azure-cosmos-db/azure-cosmos-db-connect.mdx. Añade el cambio incompatible de Aspire 17.0 a la página «What's new» de la versión 17.0 cuando exista y considera añadir un ejemplo actualizado de callback a la página de integración. El trabajo estará terminado cuando el cambio, su impacto en la compatibilidad y la migración estén documentados con precisión.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
In Aspire 17.0, the configureClientOptions parameter in the stable Aspire.Microsoft.Azure.Cosmos client integration changed from Action<CosmosClientOptions>? to Action<IServiceProvider, CosmosClientOptions>?. The old signatures were removed rather than kept as overloads. This breaks both source and binary compatibility, so it should be listed in the 17.0 breaking changes.
- Code change: microsoft/aspire#19349 (partially addresses microsoft/aspire#667)
- Raised in the 17.0 API review: https://github.com/microsoft/aspire/pull/22185#discussion_r4552196618
- The change was held for 17.0 so it could ship as a breaking change: https://github.com/microsoft/aspire/pull/22185#discussion_r4553509110
The change applies to all six methods on Microsoft.Extensions.Hosting.AspireMicrosoftAzureCosmosExtensions:
AddAzureCosmosClientandAddKeyedAzureCosmosClientAddAzureCosmosContainerandAddKeyedAzureCosmosContainerAddAzureCosmosDatabaseandAddKeyedAzureCosmosDatabase
- Action<CosmosClientOptions>? configureClientOptions = null
+ Action<IServiceProvider, CosmosClientOptions>? configureClientOptions = null
Why it changed
The callback can now resolve services from DI while it configures the client. For example, it can add RequestHandler instances that have their own dependencies to CosmosClientOptions.CustomHandlers.
Impact
- Source: passing a single-parameter lambda, a method group, or an
Action<CosmosClientOptions>variable asconfigureClientOptionsno longer compiles. Calls that don't passconfigureClientOptionsstill compile. - Binary: assemblies compiled against 13.x that call any of these methods throw
MissingMethodExceptionat run time, even if they don't passconfigureClientOptions. - Behavior:
configureClientOptionsnow runs when theCosmosClientis first resolved from DI, not during registration, so an exception thrown by the callback surfaces at that point. Likewise,CosmosDatabaseBuilder.AddKeyedContainerno longer creates theCosmosClientduring registration, so missing connection information is reported when the container is first resolved.
Migration
Add an IServiceProvider parameter to the callback:
// Aspire 13.x
builder.AddAzureCosmosClient("cosmos", configureClientOptions: options =>
{
options.ApplicationName = "myapp";
});
// Aspire 17.0
builder.AddAzureCosmosClient("cosmos", configureClientOptions: (services, options) =>
{
options.ApplicationName = "myapp";
});
The new parameter can resolve services that the options need:
builder.Services.AddSingleton<MyRequestHandler>(); // MyRequestHandler derives from RequestHandler
builder.AddAzureCosmosClient("cosmos", configureClientOptions: (services, options) =>
{
options.CustomHandlers.Add(services.GetRequiredService<MyRequestHandler>());
});
Where to document
- Add a row to the ⚠️ Breaking changes table on the 17.0 What's new page. There's no
whats-new/aspire-17*.mdxonmainyet; follow the table in aspire-13-3.mdx. - Consider adding a
configureClientOptionsexample next to the inline delegates example in azure-cosmos-db-connect.mdx, which only showsconfigureSettingstoday. The package README has an updated example.
- Lenguaje dominante
- MDX
- Estrellas
- 202
- Forks
- 99
- Merge medio
- 2 d 10 h
- PR fusionados (30 d)
- 97
Preparar el entorno
Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de microsoft/aspire.dev
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
microsoft/aspire.dev#2131 ·
Los mantenedores suelen responder en 2 días
-
Dificultad 1/5 1-3 horas Aptitud para principiantes 82/100
microsoft/aspire.dev#2129 ·
Los mantenedores suelen responder en 2 días
-
Docs: note that Bun resources don't trust the dev cert via NODE_EXTRA_CA_CERTS (upstream Bun bug)Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
microsoft/aspire.dev#1802 · 3 comentarios ·
Los mantenedores suelen responder en 2 días
-
[docs] Missing information about the dotnet container steps around image being built locallyPosiblemente ocupada @IEvangelist la tomó hace 54 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
microsoft/aspire.dev#1288 · 1 reacción · 2 asignados ·
Los mantenedores suelen responder en 2 días
-
Dificultad 3/5 1-2 días Aptitud para principiantes 68/100
microsoft/aspire.dev#2114 ·
Los mantenedores suelen responder en 2 días
Todos los issues de microsoft/aspire.dev
Issues similares
-
area:mcp effort:low P5 source:agent
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
README says the land/sea mask must match the XS grid; the demo mask does not, and Step 4 worksPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abiertodocumentation
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
buckai-observatory/Automated-Cloud-Removal-and-Seamless-Satellite-Image-Mosaicking-Pipeline#52 ·
Los mantenedores suelen responder en 1 día
-
documentation
Dificultad 1/5 1-3 horas Aptitud para principiantes 84/100
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 1-3 horas Aptitud para principiantes 82/100
run-llama/llama_index#24163 ·
Los mantenedores suelen responder en 1 día
-
documentation good first issue severity: low
Dificultad 2/5 1-3 horas Aptitud para principiantes 83/100
TMHSDigital/Static_Chess#48 ·