Skip to content

Conversation

@tundwed
Copy link
Member

@tundwed tundwed commented Nov 19, 2025

Description

This PR adds the Az.EdgeAction PowerShell module (v0.1.0) for the 2025-09-01-preview API, providing 17 cmdlets to manage Azure Edge Actions as a top-level resource. The implementation includes an enhanced Deploy-AzEdgeActionVersionCode cmdlet with file-based deployment, auto-detection, and auto-zipping capabilities

Mandatory Checklist

  • SHOULD update ChangeLog.md file(s) appropriately
    • Update src/{{SERVICE}}/{{SERVICE}}/ChangeLog.md.
      • A snippet outlining the change(s) made in the PR should be written under the ## Upcoming Release header in the past tense.
    • Should not change ChangeLog.md if no new release is required, such as fixing test case only.
  • SHOULD regenerate markdown help files if there is cmdlet API change. Instruction
  • SHOULD have proper test coverage for changes in pull request.
  • SHOULD NOT adjust version of module manually in pull request

Danny Tundwe (from Dev Box) added 3 commits November 18, 2025 14:43
- Create EdgeAction as top-level module (not under CDN)
- Generate SDK using AutoRest from 2025-09-01-preview API
- Implement custom Deploy-AzEdgeActionVersionCode cmdlet with file-based deployment
  * Deploy from JavaScript files (.js)
  * Deploy from ZIP archives (.zip)
  * Auto-zip JavaScript files when using zip deployment type
  * Auto-detect deployment type from file extension
  * Automatic base64 encoding
- Add comprehensive test suite for file deployment scenarios
- Generate 17 cmdlets for EdgeAction management
- Add test fixture files for deployment testing
- Regenerated help markdown files after module rebuild
- Updated AssemblyInfo.cs with build information
- Added generate-info.json for module metadata
- Updated Az.EdgeAction.psd1 with complete cmdlet exports
- All help files now have ProgressAction parameter removed (standard practice)
Copilot AI review requested due to automatic review settings November 19, 2025 00:31
@azure-client-tools-bot-prd
Copy link

Thanks for your contribution! The pull request validation has started. Please revisit this comment for updated status.

Copilot finished reviewing on behalf of tundwed November 19, 2025 00:34
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 introduces the Az.EdgeAction PowerShell module (v0.1.0) to support the Azure Edge Actions API version 2025-09-01-preview. The module provides 17 cmdlets for managing Azure Edge Actions as a top-level resource, with enhanced file-based deployment capabilities for the Deploy-AzEdgeActionVersionCode cmdlet.

Key changes:

  • New Az.EdgeAction module with 17 cmdlets for CRUD operations on edge actions, versions, execution filters, and attachments
  • Enhanced Deploy-AzEdgeActionVersionCode cmdlet with file-based deployment, auto-detection, and auto-zipping
  • Comprehensive test suite with actual test implementation for Deploy-AzEdgeActionVersionCode

Reviewed Changes

Copilot reviewed 95 out of 95 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/EdgeAction/EdgeAction/Az.EdgeAction.psd1 Module manifest defining module metadata, dependencies, and exported functions
src/EdgeAction/EdgeAction/ChangeLog.md Release notes documenting new cmdlets and enhanced features
src/EdgeAction/EdgeAction/Properties/AssemblyInfo.cs Assembly metadata for the EdgeAction module
src/EdgeAction/EdgeAction/EdgeAction.csproj Project configuration for building the module
src/EdgeAction/EdgeAction/help/*.md Help documentation files for all 17 cmdlets with placeholder examples
src/EdgeAction/EdgeAction.Autorest/examples/*.md Example files for cmdlets - some with actual examples, most with placeholders
src/EdgeAction/EdgeAction.Autorest/test/*.Tests.ps1 Pester test files - Deploy-AzEdgeActionVersionCode has actual tests, others are stubs
src/EdgeAction/EdgeAction.Autorest/test/test_handler.js Sample JavaScript handler file for testing deployment functionality
src/EdgeAction/EdgeAction.Autorest/docs/*.md Generated documentation files matching help folder content
src/EdgeAction/EdgeAction.Autorest/how-to.md Developer guide for working with the Az.EdgeAction module
src/EdgeAction/EdgeAction.sln Visual Studio solution file for the module projects

@notyashhh
Copy link
Member

/azp run

@azure-pipelines
Copy link
Contributor

Azure Pipelines successfully started running 3 pipeline(s).

Danny Tundwe (from Dev Box) added 4 commits November 19, 2025 13:18
- Change FormatsToProcess from 'EdgeAction.Autorest/Az.EdgeAction.format.ps1xml' to @()
- AutoRest doesn't generate format files by default
- Fixes CI build error: Cannot find path 'Az.EdgeAction.format.ps1xml'
- Module validates successfully with Test-ModuleManifest
- Implemented 19 core tests covering CRUD operations
- EdgeAction: New (1), Get (3), Update (1), Remove (1)
- Version: New (1), Get (2), Update (1), Remove (1), Switch default (1), Get code (1)
- ExecutionFilter: New (1), Get (2), Update (1), Remove (1)
- All execution filter tests now deploy code to version before creating filter
- Deploy tests (5) already implemented in previous commit

Tests ready for recording with live Azure connection.
- Switch-AzEdgeActionVersionDefault now deploys code to v1 and v2
- Ensures both versions are fully provisioned before switching default
- Aligns with execution filter requirement for deployed versions
- Changed all test files to use 'powershelltests' instead of 'clitests'
- Updated utils.ps1 to set ResourceGroupName in setupEnv
- Aligns with subscription 6b381315-e92c-478a-9cc3-ce3eda35bbe1
@notyashhh
Copy link
Member

/azp run

@azure-pipelines
Copy link
Contributor

Azure Pipelines successfully started running 3 pipeline(s).

- Generated PowerShell cmdlets from EdgeActions swagger specification
- Implemented custom Deploy-AzEdgeActionVersionCode cmdlet with file deployment support
  - Supports JavaScript (.js) and ZIP file deployment
  - Auto-zips JavaScript files when deployment type is 'zip'
  - Handles base64 encoding for API payload
- Skipped Get-AzEdgeActionVersionCode test (known API issue requiring empty JSON body)
- Recorded working tests for all other cmdlets (18 tests passing)
- Updated README.md to use portable  path for swagger spec
@notyashhh
Copy link
Member

/azp run

@azure-pipelines
Copy link
Contributor

Azure Pipelines successfully started running 3 pipeline(s).

The build script expects generate-info.json in src/EdgeAction/EdgeAction.Autorest/
to calculate outdated submodules. This file is required by PrepareAutorestModule.ps1.
Copilot AI review requested due to automatic review settings November 26, 2025 06:28
Copilot finished reviewing on behalf of tundwed November 26, 2025 06:31
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

Copilot reviewed 107 out of 117 changed files in this pull request and generated no new comments.

@notyashhh
Copy link
Member

/azp run

@azure-pipelines
Copy link
Contributor

Azure Pipelines successfully started running 3 pipeline(s).

Danny Tundwe (from Dev Box) added 2 commits November 26, 2025 11:49
…y JSON body

- Modified generated EdgeAction.cs to add Content-Type: application/json header
  and empty JSON body {} for getVersionCode and swapDefault POST operations
- These APIs require an empty JSON body even though the OpenAPI spec shows no body
- Added test recordings showing successful API responses (HTTP 200/202)
- Updated test files for Get-AzEdgeActionVersionCode and Switch-AzEdgeActionVersionDefault
…th deterministic names, skip failing tests (List subscription-level, Switch default)
@isra-fel
Copy link
Member

isra-fel commented Dec 1, 2025

/azp run

@azure-pipelines
Copy link
Contributor

Azure Pipelines successfully started running 3 pipeline(s).

Copilot finished reviewing on behalf of tundwed December 1, 2025 17:06
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

Copilot reviewed 109 out of 117 changed files in this pull request and generated 1 comment.

Comment on lines +9 to +16
$ssPtr = [System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($SecureString)
try {
$plaintext = [System.Runtime.InteropServices.Marshal]::PtrToStringBSTR($ssPtr)
} finally {
[System.Runtime.InteropServices.Marshal]::ZeroFreeBSTR($ssPtr)
}

return $plaintext No newline at end of file
Copy link

Copilot AI Dec 1, 2025

Choose a reason for hiding this comment

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

Unprotect-SecureString.ps1 converts a SecureString to plaintext and returns it, which facilitates accidental leakage of secrets. An attacker or misused call site can pipe sensitive values into this function and obtain cleartext, increasing the chance of logging/storage exposure. Remove or restrict this utility; if conversion is unavoidable, ensure the plaintext is never logged, minimize scope, and prefer APIs that avoid exposing secrets in cleartext.

$ssPtr = [System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($SecureString)
try {
    $plaintext = [System.Runtime.InteropServices.Marshal]::PtrToStringBSTR($ssPtr)
} finally {
    [System.Runtime.InteropServices.Marshal]::ZeroFreeBSTR($ssPtr)
}

return $plaintext

Copilot uses AI. Check for mistakes.
@isra-fel
Copy link
Member

isra-fel commented Dec 1, 2025

Checks should trigger automatically for members. Let me close and reopen the PR to see if it's back to normal
image

@isra-fel isra-fel closed this Dec 1, 2025
@isra-fel isra-fel reopened this Dec 1, 2025
@isra-fel
Copy link
Member

isra-fel commented Dec 2, 2025

No it's not. Let me tirgger it manually

@isra-fel
Copy link
Member

isra-fel commented Dec 2, 2025

/azp run

@azure-pipelines
Copy link
Contributor

Azure Pipelines successfully started running 3 pipeline(s).

@tundwed
Copy link
Member Author

tundwed commented Dec 2, 2025

/azp run

@isra-fel / @notyashhh would you help me run the pipelines again. fixed failing test. Thanks!

@isra-fel
Copy link
Member

isra-fel commented Dec 2, 2025

/azp run

@azure-pipelines
Copy link
Contributor

Azure Pipelines successfully started running 3 pipeline(s).

Copilot AI review requested due to automatic review settings December 2, 2025 04:00
Copilot finished reviewing on behalf of tundwed December 2, 2025 04:04
@isra-fel
Copy link
Member

isra-fel commented Dec 2, 2025

/azp run

@azure-pipelines
Copy link
Contributor

Azure Pipelines successfully started running 3 pipeline(s).

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

Copilot reviewed 107 out of 115 changed files in this pull request and generated 12 comments.

@isra-fel
Copy link
Member

isra-fel commented Dec 2, 2025

/azp run

@azure-pipelines
Copy link
Contributor

Azure Pipelines successfully started running 3 pipeline(s).

- Fix MissingExampleTitle, MissingExampleCode, MissingExampleDescription errors
- Replace placeholder examples with actual cmdlet examples in docs/ and help/ folders
- Update attachment examples to use AFD rule resource IDs instead of IoT Hub
- Fix Az.EdgeAction.md module help with proper GUID, locale, and description
- Remove unused test helper scripts (Run-GetVersionCodeTest.ps1, Test-GetVersionCodeRest.ps1)
Copilot AI review requested due to automatic review settings December 2, 2025 06:10
@isra-fel
Copy link
Member

isra-fel commented Dec 2, 2025

/azp run

@azure-pipelines
Copy link
Contributor

Azure Pipelines successfully started running 3 pipeline(s).

Copilot finished reviewing on behalf of tundwed December 2, 2025 06:12
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

Copilot reviewed 105 out of 113 changed files in this pull request and generated no new comments.

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.

3 participants