Skip to content

Conversation

@tundwed
Copy link
Member

@tundwed tundwed commented Nov 18, 2025

Related command
az edge-action

Description

Add custom deploy-from-file command for file-based Edge Action deployments supporting the 2025-09-01-preview API version. This command provides a developer-friendly way to deploy JavaScript files to Edge Action versions without manually encoding content. Key features: automatic file type detection (.js → "file", .zip → "zip"), --deployment-type parameter matching API semantics (file: base64 only, zip: auto-zip or use existing), and --no-wait support for async operations. Also includes help documentation for the swap-default AAZ command and updated automated tests.

Testing Guide

Create an Edge Action and version

az edge-action create -g MyRG -n MyEdgeAction --sku name=Standard tier=Standard --location global
az edge-action version create -g MyRG --edge-action-name MyEdgeAction --version v1 --deployment-type file --location global

Deploy JavaScript file (auto-detects deployment-type=file)

az edge-action version deploy-from-file -g MyRG --edge-action-name MyEdgeAction --version v1 --file-path ./handler.js

Deploy with explicit deployment type

az edge-action version deploy-from-file -g MyRG --edge-action-name MyEdgeAction --version v1 --file-path ./handler.js --deployment-type file

Deploy with auto-zipping

az edge-action version deploy-from-file -g MyRG --edge-action-name MyEdgeAction --version v2 --file-path ./handler.js --deployment-type zip

Use --no-wait for async deployment

az edge-action version deploy-from-file -g MyRG --edge-action-name MyEdgeAction --version v1 --file-path ./code.zip --no-wait

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.

@tundwed tundwed requested a review from kairu-ms as a code owner November 18, 2025 18:53
Copilot AI review requested due to automatic review settings November 18, 2025 18:53
@azure-client-tools-bot-prd
Copy link

azure-client-tools-bot-prd bot commented Nov 18, 2025

️✔️AzureCLI-FullTest
️✔️acr
️✔️latest
️✔️3.12
️✔️3.13
️✔️acs
️✔️latest
️✔️3.12
️✔️3.13
️✔️advisor
️✔️latest
️✔️3.12
️✔️3.13
️✔️ams
️✔️latest
️✔️3.12
️✔️3.13
️✔️apim
️✔️latest
️✔️3.12
️✔️3.13
️✔️appconfig
️✔️latest
️✔️3.12
️✔️3.13
️✔️appservice
️✔️latest
️✔️3.12
️✔️3.13
️✔️aro
️✔️latest
️✔️3.12
️✔️3.13
️✔️backup
️✔️latest
️✔️3.12
️✔️3.13
️✔️batch
️✔️latest
️✔️3.12
️✔️3.13
️✔️batchai
️✔️latest
️✔️3.12
️✔️3.13
️✔️billing
️✔️latest
️✔️3.12
️✔️3.13
️✔️botservice
️✔️latest
️✔️3.12
️✔️3.13
️✔️cdn
️✔️latest
️✔️3.12
️✔️3.13
️✔️cloud
️✔️latest
️✔️3.12
️✔️3.13
️✔️cognitiveservices
️✔️latest
️✔️3.12
️✔️3.13
️✔️compute_recommender
️✔️latest
️✔️3.12
️✔️3.13
️✔️computefleet
️✔️latest
️✔️3.12
️✔️3.13
️✔️config
️✔️latest
️✔️3.12
️✔️3.13
️✔️configure
️✔️latest
️✔️3.12
️✔️3.13
️✔️consumption
️✔️latest
️✔️3.12
️✔️3.13
️✔️container
️✔️latest
️✔️3.12
️✔️3.13
️✔️containerapp
️✔️latest
️✔️3.12
️✔️3.13
️✔️core
️✔️latest
️✔️3.12
️✔️3.13
️✔️cosmosdb
️✔️latest
️✔️3.12
️✔️3.13
️✔️databoxedge
️✔️latest
️✔️3.12
️✔️3.13
️✔️dls
️✔️latest
️✔️3.12
️✔️3.13
️✔️dms
️✔️latest
️✔️3.12
️✔️3.13
️✔️edge_action
️✔️latest
️✔️3.12
️✔️3.13
️✔️eventgrid
️✔️latest
️✔️3.12
️✔️3.13
️✔️eventhubs
️✔️latest
️✔️3.12
️✔️3.13
️✔️feedback
️✔️latest
️✔️3.12
️✔️3.13
️✔️find
️✔️latest
️✔️3.12
️✔️3.13
️✔️hdinsight
️✔️latest
️✔️3.12
️✔️3.13
️✔️identity
️✔️latest
️✔️3.12
️✔️3.13
️✔️iot
️✔️latest
️✔️3.12
️✔️3.13
️✔️keyvault
️✔️latest
️✔️3.12
️✔️3.13
️✔️lab
️✔️latest
️✔️3.12
️✔️3.13
️✔️managedservices
️✔️latest
️✔️3.12
️✔️3.13
️✔️maps
️✔️latest
️✔️3.12
️✔️3.13
️✔️marketplaceordering
️✔️latest
️✔️3.12
️✔️3.13
️✔️monitor
️✔️latest
️✔️3.12
️✔️3.13
️✔️mysql
️✔️latest
️✔️3.12
️✔️3.13
️✔️netappfiles
️✔️latest
️✔️3.12
️✔️3.13
️✔️network
️✔️latest
️✔️3.12
️✔️3.13
️✔️policyinsights
️✔️latest
️✔️3.12
️✔️3.13
️✔️privatedns
️✔️latest
️✔️3.12
️✔️3.13
️✔️profile
️✔️latest
️✔️3.12
️✔️3.13
️✔️rdbms
️✔️latest
️✔️3.12
️✔️3.13
️✔️redis
️✔️latest
️✔️3.12
️✔️3.13
️✔️relay
️✔️latest
️✔️3.12
️✔️3.13
️✔️resource
️✔️latest
️✔️3.12
️✔️3.13
️✔️role
️✔️latest
️✔️3.12
️✔️3.13
️✔️search
️✔️latest
️✔️3.12
️✔️3.13
️✔️security
️✔️latest
️✔️3.12
️✔️3.13
️✔️servicebus
️✔️latest
️✔️3.12
️✔️3.13
️✔️serviceconnector
️✔️latest
️✔️3.12
️✔️3.13
️✔️servicefabric
️✔️latest
️✔️3.12
️✔️3.13
️✔️signalr
️✔️latest
️✔️3.12
️✔️3.13
️✔️sql
️✔️latest
️✔️3.12
️✔️3.13
️✔️sqlvm
️✔️latest
️✔️3.12
️✔️3.13
️✔️storage
️✔️latest
️✔️3.12
️✔️3.13
️✔️synapse
️✔️latest
️✔️3.12
️✔️3.13
️✔️telemetry
️✔️latest
️✔️3.12
️✔️3.13
️✔️util
️✔️latest
️✔️3.12
️✔️3.13
️✔️vm
️✔️latest
️✔️3.12
️✔️3.13

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

Hi @tundwed,
Since the current milestone time is less than 7 days, this pr will be reviewed in the next milestone.

@github-actions
Copy link

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>

@yonzhan
Copy link
Collaborator

yonzhan commented Nov 18, 2025

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

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

azure-client-tools-bot-prd bot commented Nov 18, 2025

️✔️AzureCLI-BreakingChangeTest
️✔️Non Breaking Changes

Copilot finished reviewing on behalf of tundwed November 18, 2025 18:55
Copy link
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 adds comprehensive support for Azure Front Door Edge Actions with API version 2025-09-01-preview, introducing a custom deploy-from-file command that simplifies file-based deployments by automatically handling file encoding and optional auto-zipping of JavaScript files.

Key Changes:

  • Custom deploy-from-file command with automatic file type detection and encoding
  • Complete AAZ-generated command scaffolding for Edge Actions, versions, and execution filters
  • Comprehensive test suite covering CRUD operations and deployment scenarios

Reviewed Changes

Copilot reviewed 41 out of 42 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
custom.py Implements file-based deployment logic with type detection and base64 encoding
commands.py Registers the custom deploy-from-file command with no-wait support
_help.py Provides detailed help documentation for commands with usage examples
test_edge_action.py Contains comprehensive test scenarios for Edge Action operations
aaz/* files Auto-generated AAZ command implementations for API operations

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

@kairu-ms
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

Danny Tundwe (from Dev Box) added 12 commits November 19, 2025 12:31
- Implement EdgeActionVersionDeployFromFile class with file-path support
- Support both --content (original) and --file-path (new) modes
- Auto-set --name from --version when using file-path
- Support file types: 'file' (single file) and 'zip' (auto-compress)
- Add comprehensive help documentation with examples
- Add test scenarios for file, zip, and content deployment modes
- Maintain backward compatibility with existing --content usage
- Add sample_edge_action.js: JavaScript handler for edge action testing
- Add sample_edge_action.zip: Pre-zipped version for zip deployment tests
- Update test scenarios to use fixture files instead of temporary files
- Ensures tests work consistently in Azure DevOps pipelines
- Change 'Azure CDN' to 'Azure Front Door' in help documentation
- Edge Actions are part of Azure Front Door, not CDN
- For --file-type 'zip': Accept both zip and non-zip files (auto-zip non-zip files), reject directories
- For --file-type 'file': Accept only non-zip files, reject zips and directories
- Remove _create_zip_from_directory() method as directories are not supported
- Clear error messages for all rejection cases
- Clarified that --name is optional when using --file-path
- Updated examples to show that --name defaults to --version value
- Removed directory deployment example (directories not supported per validation rules)
- Created separate custom command 'deploy-from-file' for file-based deployment
- Renamed parameter from --file-type to --deployment-type to match API
- Fixed critical bug: deployment-type=file does NOT zip (base64 encode only)
- deployment-type=zip: Auto-zips .js files or accepts .zip files
- Auto-detection: .js → 'file', .zip → 'zip'
- Separated help documentation for deploy-version-code (AAZ) and deploy-from-file (custom)
- All linter and style checks passed
- Maintains AAZ file pristine for regeneration safety
- Added supports_no_wait=True to deploy-from-file command
- Fixed tests to use deploy-from-file custom command instead of deploy-version-code
- Updated test parameters: --file-type → --deployment-type
- Tests now correctly use the custom command with proper parameters
- All style and linter checks passed
- Fixes linter error: missing_command_example
- All linter checks now pass
- Maps az edge-action to Azure Front Door service
- Required for CI pipeline
Danny Tundwe (from Dev Box) added 2 commits November 19, 2025 12:31
- Add parameter definitions for deploy-from-file custom command in _params.py
- Fix JavaScript content validation in test_edge_action_version_deploy_with_content test
- Record all 5 test scenarios for CI/CD playback:
  - test_edge_action_crud
  - test_edge_action_version_operations
  - test_edge_action_version_deploy_with_file
  - test_edge_action_version_deploy_with_zip
  - test_edge_action_version_deploy_with_content
- All tests passing (5/5)
@tundwed tundwed force-pushed the feature/edge-actions-2025-09-01-preview branch from 5e328a4 to 2f308ea Compare November 19, 2025 20:34
Danny Tundwe (from Dev Box) added 2 commits November 19, 2025 12:45
- Remove --resource-group parameter documentation from _help.py
- resource_group_name_type already provides complete help automatically
- Remove unnecessary linter exclusion from linter_exclusions.yml
- All linter checks now pass (0 violations)
- Remove trailing whitespace
- Break long lines to comply with 120 character limit
- All pylint and flake8 checks now pass
@necusjz
Copy link
Member

necusjz commented Nov 20, 2025

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

1 similar comment
@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@tundwed tundwed requested a review from yanzhudd as a code owner November 20, 2025 00:44
@necusjz
Copy link
Member

necusjz commented Nov 20, 2025

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@jsntcy
Copy link
Member

jsntcy commented Nov 20, 2025

@tundwed, Since edge action is a new service, usually you should put it in our extension repository https://github.com/Azure/azure-cli-extensions instead of in main repository https://github.com/Azure/azure-cli. Could you please move the code to https://github.com/Azure/azure-cli-extensions? If you move your code to extension repository, we can release it at any time on your demand, but in main repository, we can only release it monthly with fixed date.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants