Skip to content

Migrate aspire-with-azure-functions sample to Central Package Management (CPM) #1357

@asilverman

Description

@asilverman

The aspire-with-azure-functions sample should adopt Central Package Management (CPM) to align with modern .NET best practices and provide a more maintainable, scalable project structure.

Sample:
https://github.com/dotnet/aspire-samples/tree/main/samples/aspire-with-azure-functions

Rationale

CPM has become the recommended approach for managing NuGet dependencies in multi-project C# solutions. Updating this sample would:

  • Improve clarity for developers by modeling current best practices for Aspire workloads.
  • Reduce duplication of package version declarations across projects.
  • Simplify dependency upgrades by centralizing version management.
  • Better represent production-grade architecture, where CPM is widely adopted.

Proposed Changes

  1. Add a Directory.Packages.props file at the root of the sample folder.
  2. Move all package version declarations for shared dependencies into the props file.
  3. Update each project (AppHost, Azure Functions app, shared libraries, etc.) to use versionless <PackageReference> entries.
  4. Validate that the sample builds and runs identically post-change.

Example Structure

samples/aspire-with-azure-functions/
  Directory.Packages.props
  AppHost/
  FunctionsApp/
  ...

Outcome

Updating the sample to use CPM will make it a stronger reference implementation for Aspire projects integrating Azure Functions, demonstrating how to model dependencies in a modern, maintainable way.

Happy to submit a PR if this change is accepted.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions