{CDN} Version upgraded to 2025 09 01 p, edgeaction suppoort#33123
{CDN} Version upgraded to 2025 09 01 p, edgeaction suppoort#33123
Conversation
|
Validation for Azure CLI Full Test Starting...
Thanks for your contribution! |
|
Validation for Breaking Change Starting...
Thanks for your contribution! |
|
Thank you for your contribution! We will review the pull request and get back to you soon. |
|
The git hooks are available for azure-cli and azure-cli-extensions repos. They could help you run required checks before creating the PR. Please sync the latest code with latest dev branch (for azure-cli) or main branch (for azure-cli-extensions). pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>
|
There was a problem hiding this comment.
Pull request overview
This PR updates the CDN/AFD command module to align with newer CDN RP API shapes (notably 2025-09-01-preview) and adds support for invoking EdgeAction from AFD rules (delivery rule actions). It also introduces internal “cdn-cli” skill documentation and helper scripts for aaz-dev workspace resource selection.
Changes:
- Upgrade AFD rule AAZ commands to
2025-09-01-preview, adding schema support for new action types (e.g.,EdgeAction,AfdUrlSigning) and refactoring some shared schema helpers. - Add
EdgeActiondelivery-rule action construction/parsing incustom_rule_util.pyand expose--edge-action-id/--invocation-pointin AFD rule custom flows. - Remove the
cdn edge-actionAAZ command group implementation files and the associated scenario test; remove related linter exclusions; add new.github/skills/cdn-cli/*docs and scripts.
Reviewed changes
Copilot reviewed 46 out of 49 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| src/azure-cli/azure/cli/command_modules/cdn/tests/latest/test_edge_action_scenario.py | Removes Edge Action scenario coverage (file deleted). |
| src/azure-cli/azure/cli/command_modules/cdn/linter_exclusions.yml | Removes EdgeAction execution-filter linter exclusions. |
| src/azure-cli/azure/cli/command_modules/cdn/custom/custom_rule_util.py | Adds EdgeAction action creation + parsing in rule utilities. |
| src/azure-cli/azure/cli/command_modules/cdn/custom/custom_afdx.py | Adds CLI args and wiring for EdgeAction in AFD rule create/action-create flows. |
| src/azure-cli/azure/cli/command_modules/cdn/aaz/latest/cdn/edge_action/version/_wait.py | Removes cdn edge-action version wait implementation (file deleted). |
| src/azure-cli/azure/cli/command_modules/cdn/aaz/latest/cdn/edge_action/version/_update.py | Removes cdn edge-action version update implementation (file deleted). |
| src/azure-cli/azure/cli/command_modules/cdn/aaz/latest/cdn/edge_action/version/_show.py | Removes cdn edge-action version show implementation (file deleted). |
| src/azure-cli/azure/cli/command_modules/cdn/aaz/latest/cdn/edge_action/version/_list.py | Removes cdn edge-action version list implementation (file deleted). |
| src/azure-cli/azure/cli/command_modules/cdn/aaz/latest/cdn/edge_action/version/_get_version_code.py | Removes cdn edge-action version get-version-code implementation (file deleted). |
| src/azure-cli/azure/cli/command_modules/cdn/aaz/latest/cdn/edge_action/version/_deploy_version_code.py | Removes cdn edge-action version deploy-version-code implementation (file deleted). |
| src/azure-cli/azure/cli/command_modules/cdn/aaz/latest/cdn/edge_action/version/_delete.py | Removes cdn edge-action version delete implementation (file deleted). |
| src/azure-cli/azure/cli/command_modules/cdn/aaz/latest/cdn/edge_action/version/_create.py | Removes cdn edge-action version create implementation (file deleted). |
| src/azure-cli/azure/cli/command_modules/cdn/aaz/latest/cdn/edge_action/version/init.py | Removes edge-action version package exports (file deleted). |
| src/azure-cli/azure/cli/command_modules/cdn/aaz/latest/cdn/edge_action/version/__cmd_group.py | Removes edge-action version command group registration (file deleted). |
| src/azure-cli/azure/cli/command_modules/cdn/aaz/latest/cdn/edge_action/execution_filter/_wait.py | Removes cdn edge-action execution-filter wait implementation (file deleted). |
| src/azure-cli/azure/cli/command_modules/cdn/aaz/latest/cdn/edge_action/execution_filter/_update.py | Removes cdn edge-action execution-filter update implementation (file deleted). |
| src/azure-cli/azure/cli/command_modules/cdn/aaz/latest/cdn/edge_action/execution_filter/_show.py | Removes cdn edge-action execution-filter show implementation (file deleted). |
| src/azure-cli/azure/cli/command_modules/cdn/aaz/latest/cdn/edge_action/execution_filter/_list.py | Removes cdn edge-action execution-filter list implementation (file deleted). |
| src/azure-cli/azure/cli/command_modules/cdn/aaz/latest/cdn/edge_action/execution_filter/_delete.py | Removes cdn edge-action execution-filter delete implementation (file deleted). |
| src/azure-cli/azure/cli/command_modules/cdn/aaz/latest/cdn/edge_action/execution_filter/_create.py | Removes cdn edge-action execution-filter create implementation (file deleted). |
| src/azure-cli/azure/cli/command_modules/cdn/aaz/latest/cdn/edge_action/execution_filter/init.py | Removes edge-action execution-filter package exports (file deleted). |
| src/azure-cli/azure/cli/command_modules/cdn/aaz/latest/cdn/edge_action/execution_filter/__cmd_group.py | Removes edge-action execution-filter command group registration (file deleted). |
| src/azure-cli/azure/cli/command_modules/cdn/aaz/latest/cdn/edge_action/_wait.py | Removes cdn edge-action wait implementation (file deleted). |
| src/azure-cli/azure/cli/command_modules/cdn/aaz/latest/cdn/edge_action/_update.py | Removes cdn edge-action update implementation (file deleted). |
| src/azure-cli/azure/cli/command_modules/cdn/aaz/latest/cdn/edge_action/_show.py | Removes cdn edge-action show implementation (file deleted). |
| src/azure-cli/azure/cli/command_modules/cdn/aaz/latest/cdn/edge_action/_list.py | Removes cdn edge-action list implementation (file deleted). |
| src/azure-cli/azure/cli/command_modules/cdn/aaz/latest/cdn/edge_action/_delete.py | Removes cdn edge-action delete implementation (file deleted). |
| src/azure-cli/azure/cli/command_modules/cdn/aaz/latest/cdn/edge_action/_delete_attachment.py | Removes cdn edge-action delete-attachment implementation (file deleted). |
| src/azure-cli/azure/cli/command_modules/cdn/aaz/latest/cdn/edge_action/_create.py | Removes cdn edge-action create implementation (file deleted). |
| src/azure-cli/azure/cli/command_modules/cdn/aaz/latest/cdn/edge_action/_add_attachment.py | Removes cdn edge-action add-attachment implementation (file deleted). |
| src/azure-cli/azure/cli/command_modules/cdn/aaz/latest/cdn/edge_action/init.py | Removes edge-action package exports (file deleted). |
| src/azure-cli/azure/cli/command_modules/cdn/aaz/latest/cdn/edge_action/__cmd_group.py | Removes edge-action command group registration (file deleted). |
| src/azure-cli/azure/cli/command_modules/cdn/aaz/latest/afd/rule/_wait.py | Bumps api-version to 2025-09-01-preview and adds schema for new action types. |
| src/azure-cli/azure/cli/command_modules/cdn/aaz/latest/afd/rule/_show.py | Bumps api-version to 2025-09-01-preview and adds schema for new action types. |
| src/azure-cli/azure/cli/command_modules/cdn/aaz/latest/afd/rule/_list.py | Bumps api-version to 2025-09-01-preview and adds schema for new action types. |
| src/azure-cli/azure/cli/command_modules/cdn/aaz/latest/afd/rule/_delete.py | Bumps api-version to 2025-09-01-preview. |
| src/azure-cli/azure/cli/command_modules/cdn/aaz/latest/afd/rule/_create.py | Bumps api-version to 2025-09-01-preview and adds args/schema for EdgeAction + AfdUrlSigning. |
| .github/skills/cdn-cli/SKILL.md | Adds CDN/AFD CLI development skill documentation. |
| .github/skills/cdn-cli/scripts/auto_select_resources.py | Adds helper script to auto-select swagger resources into an aaz-dev workspace. |
| .github/skills/cdn-cli/scripts/_check_webagent.py | Adds helper script for checking webagents swagger/AAZ coverage. |
| .github/skills/cdn-cli/scripts/_check_waf.py | Adds helper script for checking WAF swagger/AAZ coverage. |
| .github/skills/cdn-cli/scripts/_check_ea.py | Adds helper script for checking EdgeAction swagger presence for a version. |
Comments suppressed due to low confidence (1)
src/azure-cli/azure/cli/command_modules/cdn/custom/custom_rule_util.py:431
create_actions_from_existingonly reconstructs a small allowlist of action types; any unknown/new action types returned by the service are silently dropped when a rule is updated (e.g., newly introducedAfdUrlSigningon API 2025-09-01-preview). This can lead to data loss when usingaz afd rule action create/removeor similar update flows. Consider preserving unrecognized actions as-is (append the originalactionobject) or adding parsing support for the new action types.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if action_name == "EdgeAction": | ||
| formatted_edge_action_id = None | ||
| if has_value(edge_action_id): | ||
| try: | ||
| formatted_edge_action_id = edge_action_id.to_serialized_data() | ||
| except AttributeError: | ||
| formatted_edge_action_id = edge_action_id | ||
| action = { | ||
| "edge_action": { | ||
| "parameters": { | ||
| "type_name": "DeliveryRuleEdgeActionParameters", | ||
| "edge_action_reference": { | ||
| "id": formatted_edge_action_id | ||
| }, | ||
| "invocation_point": invocation_point | ||
| } | ||
| } | ||
| } | ||
| return action |
There was a problem hiding this comment.
create_action can build an EdgeAction payload even when edge_action_id and/or invocation_point are not provided, resulting in edge_action_reference.id being None and likely causing API validation errors. Consider enforcing these as required when action_name == "EdgeAction" (either by raising a validation error here or by validating earlier in the calling command).
| if action_name == "EdgeAction": | ||
| formatted_edge_action_id = None | ||
| if has_value(edge_action_id): | ||
| try: | ||
| formatted_edge_action_id = edge_action_id.to_serialized_data() | ||
| except AttributeError: | ||
| formatted_edge_action_id = edge_action_id | ||
| action = { |
There was a problem hiding this comment.
Edge Action support is added, but there are no scenario tests covering --action-name EdgeAction (and its parameters) in the AFD rule scenarios. Please add/extend a scenario test to create a rule or add an action using EdgeAction and validate the resulting actions[].parameters.edgeActionReference.id and invocationPoint fields.
| args_schema.edge_action_id = AAZStrArg( | ||
| options=['--edge-action-id'], | ||
| help='Resource ID of the edge action to invoke.', | ||
| ) | ||
| args_schema.invocation_point = AAZStrArg( | ||
| options=['--invocation-point'], | ||
| help='Defines at which point in the request processing pipeline the edge action will be invoked.', | ||
| enum={'ClientRequest': 'ClientRequest', 'OriginRequest': 'OriginRequest'}, | ||
| ) |
There was a problem hiding this comment.
--edge-action-id and --invocation-point are optional in the argument schema, but the EdgeAction action requires both values. Without validation, the command can send an invalid payload (e.g., null edgeActionReference.id). Consider making them required when --action-name EdgeAction is selected, or add an explicit validation error in pre_operations.
| args_schema.edge_action_id = AAZStrArg( | ||
| options=['--edge-action-id'], | ||
| help='Resource ID of the edge action to invoke.', | ||
| ) | ||
| args_schema.invocation_point = AAZStrArg( | ||
| options=['--invocation-point'], | ||
| help='Defines at which point in the request processing pipeline the edge action will be invoked.', | ||
| enum={'ClientRequest': 'ClientRequest', 'OriginRequest': 'OriginRequest'}, | ||
| ) |
There was a problem hiding this comment.
Same issue as above for AFDRuleActionCreate: --edge-action-id and --invocation-point are optional, but required for an EdgeAction action. Add conditional required/validation to prevent sending invalid updates that fail server-side or create hard-to-debug errors.
| rule_exclusions: | ||
| - option_length_too_long | ||
| user_assigned_identities: | ||
| rule_exclusions: | ||
| - option_length_too_long | ||
|
|
||
| cdn edge-action execution-filter create: | ||
| parameters: | ||
| execution_filter_identifier_header_name: | ||
| rule_exclusions: | ||
| - option_length_too_long | ||
| execution_filter_identifier_header_value: | ||
| rule_exclusions: | ||
| - option_length_too_long | ||
| cdn edge-action execution-filter update: | ||
| parameters: | ||
| execution_filter_identifier_header_name: | ||
| rule_exclusions: | ||
| - option_length_too_long | ||
| execution_filter_identifier_header_value: | ||
| rule_exclusions: | ||
| - option_length_too_long | ||
| ... |
There was a problem hiding this comment.
This change removes the linter exclusions for cdn edge-action execution-filter {create,update}, and the PR also deletes all cdn edge-action AAZ command implementations/tests. That’s a breaking surface-area removal and doesn’t align with the PR title suggesting EdgeAction support. If the command group is intentionally removed, please update the PR title/description and ensure any docs/help/command registration are consistent; otherwise, restore the command implementations/exclusions.
| import argparse | ||
| import sys | ||
| from base64 import b64encode | ||
|
|
||
| import requests |
There was a problem hiding this comment.
sys is imported but never used, and the script also accepts parameters that aren't used in some functions (e.g., version in add_resources_to_workspace). Please remove unused imports/parameters to keep this helper script clean and avoid lint warnings.
| ```powershell | ||
| # Generate code directly from spec — uses default tag (latest stable) | ||
| aaz-dev cli generate --spec cdn --module cdn --cli-path C:\Users\jingnanxu\source\repos\cli | ||
| ``` | ||
|
|
||
| This converts the spec from `azure-rest-api-specs/specification/cdn/` into AAZ commands using the default tag. If the result isn't ideal, refine with the UI. | ||
|
|
There was a problem hiding this comment.
This skill doc hard-codes a specific developer username and local paths (e.g., C:\Users\jingnanxu\...). For a repo-wide guide, this makes the instructions non-portable and can unintentionally expose personal environment details. Consider replacing these with placeholder paths (e.g., C:\Users\<you>\...) and/or emphasizing that they are examples only.
Related command
Description
Testing Guide
History Notes
[Component Name 1] BREAKING CHANGE:
az command a: Make some customer-facing breaking change[Component Name 2]
az command b: Add some customer-facing featureThis checklist is used to make sure that common guidelines for a pull request are followed.
The PR title and description has followed the guideline in Submitting Pull Requests.
I adhere to the Command Guidelines.
I adhere to the Error Handling Guidelines.