-
Notifications
You must be signed in to change notification settings - Fork 330
Closed
Labels
Description
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
- Add a
Directory.Packages.propsfile at the root of the sample folder. - Move all package version declarations for shared dependencies into the props file.
- Update each project (
AppHost, Azure Functions app, shared libraries, etc.) to use versionless<PackageReference>entries. - 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.