Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/edge-action/HISTORY.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.. :changelog:
Release History
===============

1.0.0b1
++++++
* Initial release.
71 changes: 71 additions & 0 deletions src/edge-action/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# Azure CLI Edge Action Extension

Azure CLI extension for managing Azure Front Door (AFD) Edge Actions.

## Overview

Edge Actions allow you to customize how Azure Front Door handles requests and responses at the edge. This extension provides commands to create, manage, and deploy Edge Actions for Azure Front Door.

## Installation

```bash
az extension add --name edge-action
```

## Commands

### Edge Action Management

```bash
# Create an edge action
az edge-action create --resource-group myResourceGroup --name myEdgeAction --location global --sku name=Standard tier=Standard

# List edge actions
az edge-action list --resource-group myResourceGroup

# Show edge action details
az edge-action show --resource-group myResourceGroup --name myEdgeAction

# Update edge action
az edge-action update --resource-group myResourceGroup --name myEdgeAction --tags env=prod

# Delete edge action
az edge-action delete --resource-group myResourceGroup --name myEdgeAction
```

### Version Management

```bash
# Create a version
az edge-action version create --resource-group myResourceGroup --edge-action-name myEdgeAction --name v1 --location global --deployment-type file

# Deploy code to a version
az edge-action version deploy-from-file --resource-group myResourceGroup --edge-action-name myEdgeAction --version v1 --file-path ./mycode.js

# List versions
az edge-action version list --resource-group myResourceGroup --edge-action-name myEdgeAction

# Delete a version
az edge-action version delete --resource-group myResourceGroup --edge-action-name myEdgeAction --name v1
```

### Execution Filters

```bash
# Create an execution filter
az edge-action execution-filter create --resource-group myResourceGroup --edge-action-name myEdgeAction --name myFilter --location global --action-version-id /subscriptions/{sub}/resourceGroups/{rg}/providers/Microsoft.Cdn/edgeActions/{name}/versions/{version}

# List execution filters
az edge-action execution-filter list --resource-group myResourceGroup --edge-action-name myEdgeAction

# Delete an execution filter
az edge-action execution-filter delete --resource-group myResourceGroup --edge-action-name myEdgeAction --name myFilter
```

## Features

- Full lifecycle management of Azure Front Door Edge Actions
- Version control for Edge Action code
- JavaScript and zip file deployment support
- Execution filter management for selective Edge Action execution
- Azure Front Door route attachment support
42 changes: 42 additions & 0 deletions src/edge-action/azext_edge_action/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
#
# Code generated by aaz-dev-tools
# --------------------------------------------------------------------------------------------

from azure.cli.core import AzCommandsLoader
from azext_edge_action._help import helps # pylint: disable=unused-import


class EdgeActionCommandsLoader(AzCommandsLoader):

def __init__(self, cli_ctx=None):
from azure.cli.core.commands import CliCommandType
custom_command_type = CliCommandType(
operations_tmpl='azext_edge_action.custom#{}')
super().__init__(cli_ctx=cli_ctx,
custom_command_type=custom_command_type)

def load_command_table(self, args):
from azext_edge_action.commands import load_command_table
from azure.cli.core.aaz import load_aaz_command_table
try:
from . import aaz
except ImportError:
aaz = None
if aaz:
load_aaz_command_table(
loader=self,
aaz_pkg_name=aaz.__name__,
args=args
)
load_command_table(self, args)
return self.command_table

def load_arguments(self, command):
from azext_edge_action._params import load_arguments
load_arguments(self, command)


COMMAND_LOADER_CLS = EdgeActionCommandsLoader
29 changes: 29 additions & 0 deletions src/edge-action/azext_edge_action/_help.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
#
# Code generated by aaz-dev-tools
# --------------------------------------------------------------------------------------------

# pylint: disable=line-too-long
# pylint: disable=too-many-lines

from knack.help_files import helps # pylint: disable=unused-import


helps['edge-action version deploy-from-file'] = """
type: command
short-summary: Deploy edge action version code from a JavaScript or zip file.
long-summary: |
This command provides file-based deployment for edge action versions. It automatically detects the deployment type based on the file extension (.js for JavaScript files, .zip for zip archives) unless explicitly specified.
examples:
- name: Deploy a JavaScript file to an edge action version
text: |
az edge-action version deploy-from-file --resource-group myResourceGroup --edge-action-name myEdgeAction --version v1 --file-path ./mycode.js
- name: Deploy a zip file to an edge action version
text: |
az edge-action version deploy-from-file --resource-group myResourceGroup --edge-action-name myEdgeAction --version v1 --file-path ./mycode.zip
- name: Deploy a JavaScript file with explicit deployment type
text: |
az edge-action version deploy-from-file --resource-group myResourceGroup --edge-action-name myEdgeAction --version v1 --file-path ./mycode.js --deployment-type file
"""
22 changes: 22 additions & 0 deletions src/edge-action/azext_edge_action/_params.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
#
# Code generated by aaz-dev-tools
# --------------------------------------------------------------------------------------------

# pylint: disable=too-many-lines
# pylint: disable=too-many-statements


def load_arguments(self, _): # pylint: disable=unused-argument
with self.argument_context('edge-action version deploy-from-file') as c:
c.argument('resource_group', options_list=['--resource-group', '-g'],
help='Name of resource group.')
c.argument('edge_action_name', help='Name of the edge action.')
c.argument('version', help='Version name.')
c.argument('file_path', help='Path to JavaScript (.js) or zip (.zip) file to deploy.')
c.argument('deployment_type',
help='Deployment type: "file" for JavaScript files, "zip" for zip archives. '
'Auto-detected if not specified.')
c.argument('no_wait', help='Do not wait for the long-running operation to finish.')
6 changes: 6 additions & 0 deletions src/edge-action/azext_edge_action/aaz/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
#
# Code generated by aaz-dev-tools
# --------------------------------------------------------------------------------------------
10 changes: 10 additions & 0 deletions src/edge-action/azext_edge_action/aaz/latest/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
#
# Code generated by aaz-dev-tools
# --------------------------------------------------------------------------------------------

# pylint: skip-file
# flake8: noqa

Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
#
# Code generated by aaz-dev-tools
# --------------------------------------------------------------------------------------------

# pylint: skip-file
# flake8: noqa

from azure.cli.core.aaz import *


@register_command_group(
"edge-action",
)
class __CMDGroup(AAZCommandGroup):
"""Manage Edge Action
"""
pass


__all__ = ["__CMDGroup"]
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
#
# Code generated by aaz-dev-tools
# --------------------------------------------------------------------------------------------

# pylint: skip-file
# flake8: noqa

from .__cmd_group import *
from ._add_attachment import *
from ._create import *
from ._delete import *
from ._delete_attachment import *
from ._list import *
from ._show import *
from ._update import *
from ._wait import *
Loading
Loading