-
Notifications
You must be signed in to change notification settings - Fork 264
Adds support for additional/unknown properties on project/service config #6196
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
Conversation
1e33bc8 to
e4cd904
Compare
I wonder about this. It looks like using |
This was an unintended quote - removed. Anything in the Application state should be stored in environment values/config. |
e90cddb to
7d12edc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds comprehensive support for extension authors to store custom configuration data in azure.yaml through AdditionalProperties fields on both ProjectConfig and ServiceConfig. The implementation enables extensions to manage configuration via 10 new gRPC methods while maintaining backward compatibility and preserving event dispatchers across config updates.
Key changes:
- Added
AdditionalProperties map[string]interface{}fields to project and service configs with YAML inline marshaling - Implemented 10 new gRPC methods (Get/Set/Unset for sections/values at project/service levels)
- Updated JSON schemas to allow additional properties (security consideration)
- Added EventDispatcher preservation logic to maintain hook continuity after config reloads
Reviewed changes
Copilot reviewed 22 out of 22 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| schemas/v1.0/azure.yaml.json | Enabled additionalProperties validation at project and service levels |
| schemas/alpha/azure.yaml.json | Enabled additionalProperties validation at project and service levels |
| cli/azd/pkg/project/project_config.go | Added AdditionalProperties field to ProjectConfig with yaml inline tag |
| cli/azd/pkg/project/service_config.go | Added AdditionalProperties field to ServiceConfig with yaml inline tag |
| cli/azd/pkg/project/mapper_registry.go | Added protobuf conversion logic for AdditionalProperties in both directions |
| cli/azd/pkg/azdext/models.pb.go | Generated protobuf code with additional_properties fields |
| cli/azd/grpc/proto/models.proto | Added additional_properties fields to ProjectConfig and ServiceConfig messages |
| cli/azd/pkg/azdext/project.pb.go | Generated protobuf code for new config management request/response types |
| cli/azd/pkg/azdext/project_grpc.pb.go | Generated gRPC service stubs for 10 new config management methods |
| cli/azd/grpc/proto/project.proto | Defined 10 new RPC methods for project/service config management |
| cli/azd/internal/grpcserver/project_service.go | Implemented gRPC methods with validation, persistence, and EventDispatcher preservation |
| cli/azd/internal/grpcserver/project_service_test.go | Added comprehensive tests for all config methods including edge cases |
| cli/azd/pkg/project/project_test.go | Added marshalling tests and config extraction examples |
| cli/azd/pkg/project/mapper_registry_test.go | Added tests for AdditionalProperties protobuf conversion |
| cli/azd/pkg/project/testdata/*.snap | Snapshot files demonstrating YAML structure with additional properties |
| cli/azd/extensions/microsoft.azd.demo/internal/cmd/config.go | Demo extension showcasing type-safe config management |
| cli/azd/docs/extension-framework.md | Documentation for new gRPC config management APIs |
| .github/copilot-instructions.md | Added extension build instructions |
7db13cd to
5fc2773
Compare
Azure Dev CLI Install InstructionsInstall scriptsMacOS/Linux
bash: pwsh: WindowsPowerShell install MSI install Standalone Binary
MSI
Documentationlearn.microsoft.com documentationtitle: Azure Developer CLI reference
|
PR Summary: Add AdditionalProperties Support for Extension Framework
Enables extension authors to add custom configuration fields to project and service configs without breaking existing functionality.
Use Cases:
1. Project-Level Extension Configuration
Developer building a custom deployment extension needs project-wide settings:
Extension reads these via
project.AdditionalProperties["deploymentStrategy"]and modifies deployment behavior accordingly.2. Service-Level Extension Configuration
Developer building a monitoring extension that works with any service type:
Extension processes any service regardless of host type, reading
service.AdditionalProperties["monitoring"]to configure service-specific monitoring rules.Key Changes:
• Added
AdditionalPropertiesfield toProjectConfigandServiceConfigstructs usingyaml:",inline"tag for seamless YAML integration• Enhanced protobuf schema with
additional_propertiesfields in bothProjectConfigandServiceConfigmessages• Updated mapper registry to convert
AdditionalProperties↔additional_propertiesfor extension wire protocol communication• Preserved existing behavior - only writes additional properties to YAML when they differ from defaults (uses mergo pattern)
• Full round-trip support - YAML ↔ Go structs ↔ protobuf ↔ extensions with data integrity maintained
Extension Author Benefits:
• Add custom fields to
azure.yamlwithout schema violations• Access additional properties via gRPC extension framework
• Clean separation between core config and extension-specific data
• Type-safe configuration extraction using existing config system
• Works with any service type (containerapp, appservice, staticwebapp, etc.)
Based on the comprehensive implementation we've completed, here's a summary you can append to your pull request description:
New gRPC Configuration Management Services
This implementation enables extensions to store and manage custom configuration data at both project and service levels, providing the foundation for rich extension capabilities while maintaining clean separation from core Azure Developer CLI configuration schema.
New Project Service RPC Methods
Project-Level Configuration:
GetConfigSection- Retrieve configuration sections using dot-notation pathsGetConfigValue- Retrieve individual configuration valuesSetConfigSection- Set/update entire configuration sectionsSetConfigValue- Set/update individual configuration valuesUnsetConfig- Remove configuration sections or valuesService-Level Configuration:
GetServiceConfigSection- Retrieve service-specific configuration sectionsGetServiceConfigValue- Retrieve service-specific configuration valuesSetServiceConfigSection- Set/update service configuration sectionsSetServiceConfigValue- Set/update service configuration valuesUnsetServiceConfig- Remove service configuration sections or valuesKey Features
"database.connection.host"AdditionalProperties