Skip to content

[Chaos] Re-target Az.Chaos to Microsoft.Chaos 2026-05-01-preview (V2) - #29866

Draft
kekivelez wants to merge 6 commits into
Azure:mainfrom
kekivelez:users/kekivelez/az-chaos-v2-2026-05-01-preview
Draft

[Chaos] Re-target Az.Chaos to Microsoft.Chaos 2026-05-01-preview (V2)#29866
kekivelez wants to merge 6 commits into
Azure:mainfrom
kekivelez:users/kekivelez/az-chaos-v2-2026-05-01-preview

Conversation

@kekivelez

Copy link
Copy Markdown

Description

Re-targets the Az.Chaos PowerShell module from the retired V1 stable/2024-01-01
experiment surface to the Chaos Studio V2 Microsoft.Chaos 2026-05-01-preview API.

The module now maps 1:1 to the V2 operations and adds three workflow-level porcelain
cmdlets that wrap the multi-step V2 flows.

Plumbing cmdlets (generated)

  • Workspaces: Get/New/Update/Remove-AzChaosWorkspace, Update-AzChaosWorkspaceRecommendation
  • Scenarios: Get/New/Remove-AzChaosScenario
  • Scenario configurations: Get/New/Remove-AzChaosScenarioConfiguration,
    Test-AzChaosScenarioConfiguration, Invoke-AzChaosScenarioConfigurationExecution,
    Repair-AzChaosScenarioConfigurationResourcePermission
  • Scenario runs: Get/Stop-AzChaosScenarioRun
  • Discovery: Get-AzChaosDiscoveredResource
  • V2 model helpers: New-AzChaosScenarioActionObject, New-AzChaosScenarioParameterObject,
    New-AzChaosRunAfterObject, New-AzChaosExternalResourceObject,
    New-AzChaosKeyValuePairObject, New-AzChaosConfigurationFiltersObject,
    New-AzChaosConfigurationExclusionsObject

Workflow porcelain cmdlets (custom)

  • Start-AzChaosScenarioRun — validates a scenario configuration before it starts the run
    and guards catalog scenarios that the workspace has not evaluated.
  • Invoke-AzChaosWorkspaceScenarioEvaluation — discovers and evaluates a workspace in one step.
  • Initialize-AzChaosWorkspace — stands up a ready-to-use workspace end to end.

Breaking changes

The V1 experiment surface is removed. The removals are documented in the module ChangeLog
under ## Upcoming Release. Scoped StaticAnalysis breaking-change exceptions are added under
tools/StaticAnalysis/Exceptions/Az.Chaos/BreakingChangeIssues.csv for the 22 removed V1
cmdlets so the breaking-change gate reflects the intended re-target.

The server-side whatIf field on Repair-AzChaosScenarioConfigurationResourcePermission is
exposed as -WhatIfMode, distinct from the common -WhatIf switch.

Checklist

  • The title of the PR is clear and informative.
  • The associated ChangeLog entry is added under ## Upcoming Release.
  • The module-scoped build passes.
  • Scoped StaticAnalysis exceptions are added for the intended V1 removals.
  • Examples and Pester tests are included for the new cmdlets.

Cristian Velez (from Dev Box) and others added 3 commits July 20, 2026 20:37
Re-pin the Chaos.Autorest/README.md codegen driver to the V2 spec commit
f228b86c72657cd366e26c77420bfbd436938821. Replace the V1 experiment directives
with the V2 shaping and V1-pruning directives. Add the -WhatIfMode rename for
Repair-AzChaosScenarioConfigurationResourcePermission. Replace the V1
model-cmdlet helpers with the V2 helpers.

Regenerate the tracked plumbing surface. The exported surface has 17 command
cmdlets and 7 model helpers. No V1 noun appears in the surface, the tracked
docs, or the parent Az.Chaos.psd1 FunctionsToExport. Reset the parent
FunctionsToExport to an empty array. Prune the V1 docs, examples, model helpers,
and portal UX files. Add the V2 docs, example stubs, test stubs, model helpers,
and portal UX files.

The generated C# tree, exports, internal module, and generated psd1 stay
git-ignored and out of this commit.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Author real example bodies (>=2 per cmdlet) for all 27 exported Az.Chaos
cmdlets, covering the primary parameter sets for plumbing, model-helper,
and porcelain commands. Regenerate the flat docs/*.md via build-module.ps1
-NotIsolated -Debugger -DisableAfterBuildTasks, injecting the authored
examples and adding the three porcelain cmdlet docs
(Initialize-AzChaosWorkspace, Invoke-AzChaosWorkspaceScenarioEvaluation,
Start-AzChaosScenarioRun). Replace the 22 deferred V1 help markdown files
(DEV-005) with 27 V2 help files copied from docs/, plus the updated
Az.Chaos.md landing page, eliminating all V1 nouns from help/. Record the
V2 surface additions and V1 removals in ChangeLog.md under
'## Upcoming Release'.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
… request

Add scoped BreakingChange exceptions for the 22 intended V1 experiment
cmdlet removals (ProblemId 1000, severity 0) so the module-scoped
StaticAnalysis breaking-change gate passes. Remove the stale V1
Update-AzChaosExperiment entry from the example-issue exceptions.

Commit the three V2 workflow porcelain cmdlets and their Pester tests
and playback recordings so the contributor pull request contains the
complete V2 surface:
- Start-AzChaosScenarioRun
- Invoke-AzChaosWorkspaceScenarioEvaluation
- Initialize-AzChaosWorkspace

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 21, 2026 04:32

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot wasn't able to review this pull request because it exceeds the maximum number of lines (20,000). Try reducing the number of changed lines and requesting a review from Copilot again.

@azure-pipelines

Copy link
Copy Markdown
Contributor
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

@microsoft-github-policy-service

Copy link
Copy Markdown
Contributor

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

… module

Removes a debugging-artifact swagger transform ($..physicalZones ->
description = 'SENTRECURSIVE') from Chaos.Autorest/README.md that overrode
the authored PhysicalZone property-description directive above it and
leaked the placeholder into five shipped files. Hand-corrects the five
affected docs/help/custom files to the authored description text (the
generated/ C# tree is git-ignored and could not be regenerated offline
without the autorest.powershell extension; see DEV-012).

Also aligns Initialize-AzChaosWorkspace's [OutputType] with its documented
IScenario output, consistent with the other porcelain cmdlets, and adds a
Pester completeness test that fails the suite if a placeholder sentinel
token leaks into tracked docs/help/custom content again.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@kekivelez
kekivelez marked this pull request as draft July 21, 2026 05:07
@kekivelez

Copy link
Copy Markdown
Author

Marked as drafted while I review. My copilot session went a little too trigger happy and opened the pull request without prompting me. Apologies for the premature churn

Copilot AI review requested due to automatic review settings July 21, 2026 20:12

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot wasn't able to review this pull request because it exceeds the maximum number of lines (20,000). Try reducing the number of changed lines and requesting a review from Copilot again.

- Bump Chaos.Autorest/generate-info.json generate_Id so the post-merge archive
  automation regenerates generated/Chaos/. The prior GUID matched the archived
  copy, so Get-OutdatedSubModule treated the module as up to date and skipped
  regeneration, leaving the V2 surface unpublished.
- Populate the hand-maintained src/Chaos/Chaos/Az.Chaos.psd1 FunctionsToExport
  with the 27 V2 cmdlets. It was an empty array, so importing the module
  exported no cmdlets.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 33dd348d-6b27-4d6f-9e31-525903029cc3
Copilot AI review requested due to automatic review settings July 22, 2026 00:41

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot wasn't able to review this pull request because it exceeds the maximum number of lines (20,000). Try reducing the number of changed lines and requesting a review from Copilot again.

@a0x1ab

a0x1ab commented Jul 22, 2026

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Contributor
Azure Pipelines:
Successfully started running 3 pipeline(s).

The generator escapes a double quote in a property description as a
backtick-quote pair, but emits the description's own backticks verbatim. The
ConfigurationFilters.physicalZones description contains a backtick immediately
before a quote, so the generated double-quoted HelpMessage string terminates
early and New-AzChaosConfigurationFiltersObject.ps1 fails to parse, which fails
build-module.ps1 during export generation.

Replace the two ineffective model-level 'set: property-description' directives
with a single swagger-document transform that restates the physicalZones
description without a backtick-before-quote sequence. A model-level directive
does not reach the model-cmdlet proxy, and a transform without an explicit
'from: swagger-document' stage does not reach the swagger document.

The sibling zones description contains quotes but no backtick before a quote,
so it generates valid PowerShell and needs no transform.

This makes the generated model-cmdlet reproducible: regeneration now produces
the corrected help text instead of output that must be hand-corrected.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 33dd348d-6b27-4d6f-9e31-525903029cc3
Copilot AI review requested due to automatic review settings July 25, 2026 01:22

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot wasn't able to review this pull request because it exceeds the maximum number of lines (20,000). Try reducing the number of changed lines and requesting a review from Copilot again.

@a0x1ab

a0x1ab commented Jul 25, 2026

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Contributor
Azure Pipelines:
Successfully started running 3 pipeline(s).

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants