-
Notifications
You must be signed in to change notification settings - Fork 3.3k
{Edge Actions} Edge actions support for api version 2025-09-01-preview and add deploy-from-file custom command #32436
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
base: dev
Are you sure you want to change the base?
{Edge Actions} Edge actions support for api version 2025-09-01-preview and add deploy-from-file custom command #32436
Conversation
️✔️AzureCLI-FullTest
|
|
Hi @tundwed, |
|
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>
|
|
Thank you for your contribution! We will review the pull request and get back to you soon. |
️✔️AzureCLI-BreakingChangeTest
|
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 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-filecommand 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.
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
- 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
…efix, add swap-default example)
- 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)
5e328a4 to
2f308ea
Compare
- 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
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
1 similar comment
|
Azure Pipelines successfully started running 3 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
|
@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. |
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 featureThis checklist is used to make sure that common guidelines for a pull request are followed.
[x ] The PR title and description has followed the guideline in Submitting Pull Requests.
[x ] I adhere to the Command Guidelines.
[ x] I adhere to the Error Handling Guidelines.