Skip to content

Add support for custom configuration for CosmosDB #9143

Open
@lucas-morel-shift

Description

@lucas-morel-shift

Is there an existing issue for this?

  • I have searched the existing issues

Is your feature request related to a problem? Please describe the problem.

I am trying to add Aspire to an existing project which requires composite indexes.

After several tentative, with custom commands, snapshot (via initial state) or trying directly to use the builder's required services, I just went with the code in base project way.
However in terms of design and separation of concerns, I'm not very happy with modifying the structure of my CosmosDB containers after their creation and at run time of my application.

Describe the solution you'd like

I noticed a discussion here #8438 where it was suggested to add container options to pass along custom configuration. It seems like a good suggestion.

Another way could be to modify the API offering methods to add the values needed.
In my case for example it could look like:

var container = cosmosDbDatabase.AddContainer("container", "/partitionKey"); container.AddIndexingPolicy(new CompositePath() { Path = "/path/path", Order = CompositePathSortOrder.Descending });

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-integrationsIssues pertaining to Aspire Integrations packagesazureIssues associated specifically with scenarios tied to using Azureazure-cosmosdbIssues related to Azure CosmosDB

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions