Skip to content

{CDN} Version upgraded to 2025 09 01 p, edgeaction suppoort#33123

Open
Ptnan7 wants to merge 2 commits intoAzure:devfrom
Ptnan7:2025-09-01-p-edgeaction
Open

{CDN} Version upgraded to 2025 09 01 p, edgeaction suppoort#33123
Ptnan7 wants to merge 2 commits intoAzure:devfrom
Ptnan7:2025-09-01-p-edgeaction

Conversation

@Ptnan7
Copy link
Copy Markdown
Member

@Ptnan7 Ptnan7 commented Apr 2, 2026

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 feature


This checklist is used to make sure that common guidelines for a pull request are followed.

Copilot AI review requested due to automatic review settings April 2, 2026 04:19
@azure-client-tools-bot-prd
Copy link
Copy Markdown

Validation for Azure CLI Full Test Starting...

Thanks for your contribution!

@azure-client-tools-bot-prd
Copy link
Copy Markdown

Validation for Breaking Change Starting...

Thanks for your contribution!

@yonzhan
Copy link
Copy Markdown
Collaborator

yonzhan commented Apr 2, 2026

Thank you for your contribution! We will review the pull request and get back to you soon.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 2, 2026

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).
After that please run the following commands to enable git hooks:

pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>

Copy link
Copy Markdown
Contributor

Copilot AI left a 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 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 EdgeAction delivery-rule action construction/parsing in custom_rule_util.py and expose --edge-action-id/--invocation-point in AFD rule custom flows.
  • Remove the cdn edge-action AAZ 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_existing only 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 introduced AfdUrlSigning on API 2025-09-01-preview). This can lead to data loss when using az afd rule action create/remove or similar update flows. Consider preserving unrecognized actions as-is (append the original action object) or adding parsing support for the new action types.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +402 to +420
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
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Copilot uses AI. Check for mistakes.
Comment on lines +402 to +409
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 = {
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Comment on lines +948 to +956
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'},
)
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

--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.

Copilot uses AI. Check for mistakes.
Comment on lines +1198 to +1206
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'},
)
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Comment on lines 373 to 378
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
...
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Comment on lines +17 to +21
import argparse
import sys
from base64 import b64encode

import requests
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Comment on lines +94 to +100
```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.

Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

act-quality-productivity-squad Auto-Assign Auto assign by bot Network - CDN az cdn Network az network vnet/lb/nic/dns/etc...

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants