Repository navigation
[App Service] Add Active Backup silo management preview - #34239
JarodAertsMsft wants to merge 7 commits into
Conversation
Add dedicated plan/site silo lifecycle, managed regional traffic, Last Known Good, accepted refresh, networking, and operational pass-through commands. Preserve service eligibility and API operation semantics. Include isolated ARM transport, offline coverage, opt-in live scenarios, and usage documentation. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 224abf0a-0923-4347-a5ea-5c4a1b4e4824
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
|
Thank you for your contribution JarodAertsMsft! We will review the pull request and get back to you soon. |
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
Preserve no-wait receipts, return canonical resources after asynchronous writes, add the approved origin-only collection compatibility, and use async-status mode for standalone CRUD operation inspection and waits. Keep service errors visible and do not infer deletion success from polling 404. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 224abf0a-0923-4347-a5ea-5c4a1b4e4824
Add checkout-bound PowerShell Plan, Preflight, Run, Resume and Cleanup modes with explicit subscription/resource authorization, protected evidence, ownership-checked cleanup and offline safety tests. Cover Windows Core workflows while preserving known service polling failures in report history. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 224abf0a-0923-4347-a5ea-5c4a1b4e4824
Preserve silo regions despite configured location defaults, paginate actual ARM collections without flattening property bags, and clear completed mutation journal state regardless of validated output shape. Add parser/output/pagination and safe-resume regressions; keep backend errors and delete-404 policy unchanged. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 224abf0a-0923-4347-a5ea-5c4a1b4e4824
Normalize identity conflicts without private argparse APIs, preserve core HTTP error categories and retry behavior, expose named diagnostic inputs, and author complete help/examples. Protect recovery manifests with initialization/lock guards, ownership reconciliation and snapshot handoff validation. Keep strict delete polling errors; add regression coverage validated by 119 Python tests and 57 offline harness checks. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 224abf0a-0923-4347-a5ea-5c4a1b4e4824
|
Hey Yong Zhang (@yonzhan), we need this payload for a feature we are announcing at ignite. Is it possible to get this reviewed before the cutoff? |
|
@microsoft-github-policy-service agree company="Microsoft" |
|
|
||
| def load_arguments(self, _): | ||
| from ._active_backup_commands import load_arguments as load_active_backup_arguments | ||
| load_active_backup_arguments(self, _) |
There was a problem hiding this comment.
Ensure commands and params are registered according to pre-existing conventions. Refer to https://github.com/Azure/azure-cli/blob/dev/doc/authoring_command_modules/authoring_commands.md for guidance or how existing commands and params are registered
| from azure.cli.core.util import get_az_user_agent, get_error_type_by_status_code, should_disable_connection_verify | ||
|
|
||
|
|
||
| API_VERSION = '2026-08-01' |
There was a problem hiding this comment.
This looks like a hand rolled client. Is there an sdk for this? Or a rest spec that we can code gen from? Refer to https://azure.github.io/aaz-dev-tools/pages/usage/cli-generator/
There was a problem hiding this comment.
There is not yet an SDK and the swagger has not yet been published as the API has not yet been 100% deployed. But we have our PR into the swagger repo. I will look to use that to generate CLI and update PR with that. There might be some parts that will still require some somewhat special handling, but will see once I get things into a better state.
Azure/azure-rest-api-specs#44330
Thank you for the direction.
There was a problem hiding this comment.
I have scoped this PR down to the base commands that can be automatically generated from the Swagger with the cli generator along with some required custom handling for async and some mismatches in our swagger we need to fix.
Some of the content I had previously related to our passthrough APIs (which is where Silo resources can use same endpoints as normal web app resources but with their path), I have omitted for now.
I will continue to test and address comments on the PR, please let me know if the direction here is incorrect. This is my first time doing CLI work and really appreciate the help.
There was a problem hiding this comment.
🟡 Changes recommended
File-backed live capture and binary request-file handling have unresolved data-integrity defects.
2 open issues
What changed in this PR
Adds preview Active Backup management to the App Service CLI without changing existing app/plan API versions.
Changes:
- Adds silo lifecycle, traffic, networking, diagnostics, and operational commands.
- Implements authenticated transport, operation polling, pagination, and file streaming.
- Adds mock/live tests, usage documentation, and an opt-in validation harness.
| File | Description |
|---|---|
| src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_active_backup_commands.py | Opt-in Windows/Linux lifecycle tests. |
| src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_active_backup_commands_thru_mock.py | Command routing, help, and CLI regression tests. |
| src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_active_backup_client.py | Transport, polling, and file-handling tests. |
| src/azure-cli/azure/cli/command_modules/appservice/commands.py | Registers preview commands. |
| src/azure-cli/azure/cli/command_modules/appservice/active_backup.py | Implements Active Backup handlers. |
| src/azure-cli/azure/cli/command_modules/appservice/_params.py | Loads new arguments. |
| src/azure-cli/azure/cli/command_modules/appservice/_help.py | Loads preview help. |
| src/azure-cli/azure/cli/command_modules/appservice/_active_backup_commands.py | Defines commands, arguments, and examples. |
| src/azure-cli/azure/cli/command_modules/appservice/_active_backup_client.py | Provides ARM transport and operation handling. |
| scripts/appservice/test_active_backup.ps1 | Adds authorized validation and recovery entrypoint. |
| scripts/appservice/README.md | Documents harness operation and safeguards. |
| doc/active_backup_preview.md | Documents preview usage and limitations. |
| .gitignore | Excludes local validation artifacts. |
Review effort: Balanced
| descriptor, temporary = tempfile.mkstemp(dir=os.path.dirname(destination)) | ||
| with os.fdopen(descriptor, 'wb') as handle: | ||
| for chunk in response.iter_content(chunk_size=65536): | ||
| handle.write(chunk) | ||
| if overwrite: | ||
| os.replace(temporary, destination) | ||
| temporary = None | ||
| else: | ||
| os.link(temporary, destination) | ||
| return {'file': destination} |
| elif isinstance(body, str) and body.startswith('@'): | ||
| try: | ||
| with open(body[1:], 'rb') as handle: | ||
| body = handle.read() |
Replace the handwritten transport and signature-driven command dispatch with the spec-limited 24-command AAZ preview. Retain narrow generated-command subclasses for observed resource-envelope, polling, origin-read, VNet-response and conflict-format compatibility. Keep portable offline and gated scenario tests, and remove developer-only PowerShell validation tooling from the feature PR while preserving it locally. Companion model publication, replay recordings and full azdev gates remain review-readiness work. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 224abf0a-0923-4347-a5ea-5c4a1b4e4824
Regenerate the preview commands from the merged 2026-08-01 contract, remove backend compatibility overrides, require primary-location on silo creation, and update regressions and preview documentation. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
|
JarodAertsMsft Review of
To addressTick each item as you address it.
Review detailsTest validation
Recording-warning correction: The two deterministic recording warnings below are not applicable at this head: Focused coverage: Both files are under Prior Copilot feedback: Both comments target Risk assessment83/100 · Critical The Critical rating is driven by security-sensitive behavior, public CLI behavior, failure-handling behavior and 1 additional signal(s).
Ask the Agent Tick a box to queue an action. Requires write access to this repository.
|
|
JarodAertsMsft |
|
There is still CI issue and this PR will be postponed to post Ignite. |

🤖 PR Validation —⚠️ Review suggested
This PR adds warning or check suppressions. Fix the underlying warning where possible and justify each remaining suppression in a code comment or the PR description.
1 added suppression
src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_active_backup_commands.py@unittest.skipUnless(os.environ.get('AZURE_ACTIVE_BACKUP_LIVE') == '1',Related command
az appservice plan silo,az webapp silo,az webapp managed-traffic,az webapp last-known-goodDescription
Add public-preview Active Backup silo management for App Service plans and web apps using standard AAZ-generated command implementations.
Generation now targets the merged App Service
2026-08-01contract from Azure/azure-rest-api-specs#44330, pinned to merge commit2d07da92bcad212fdd5e2bffebf96563081ec250. No additional Swagger PR is required for this CLI update.Preview scope
The implementation exposes 25 preview commands covering 21 HTTP operations, plus generated update/wait behavior:
appservice plan siloappservice plan silo vnet-integrationwebapp silowebapp silo vnet-integrationwebapp managed-trafficwebapp last-known-good--primary-locationin the command models for both silo create commands; omission fails before any HTTP request. Keep standard AAZ location defaults and the separate optional legacy--silo-locationfield.--set/--add/--removesupport. The tags-only PATCH operations are not separate CLI commands. Site VNet update uses the modeled PATCH operation.--no-waitand resource-basedwaitcommands standard. Refresh returns on HTTP 204 acceptance; it does not wait for revision propagation.Silo pass-through APIs, standalone operation inspection, managed-traffic metrics and a synthetic failover workflow remain out of scope. See the preview guide for usage and limitations.
Accepted backend rollout gaps
Implement the merged contract without CLI-specific workarounds for accepted backend gaps. Tags-only PATCH, site-silo VNet collection GET and trafficMode read-back have agreed service follow-ups; temporary service failures or absent fields are expected until those changes deploy. The CLI does not feature-detect these capabilities, fabricate successful responses, fall back from origin GET to list, or override async-monitor selection. Standard polling can fail on malformed/empty async-status responses while the service operation continues.
Companion models
The corresponding
Azure/aazcommand-model changes have been prepared and verified locally against a pinned upstream baseline, including preservation of existing parent command indexes. They have not been pushed or published as a companion PR. That separate command-model publication/cross-link remains outstanding; it is not another Swagger change. Developer-local specs, models, patch packages, environments and reports under ignored.xpaths are not part of this CLI commit.Testing Guide
With an eligible primary plan/app, feature-enabled subscription and supported regions, create the plan silo before the site silo:
Delete site silos before their backing plan silo. Live execution allocates billable resources and requires explicit authorization and service-side enablement. No live resources were provisioned for this update. Native Windows/Linux scenarios remain opt-in, live-only tests; sanitized replay recordings for those new scenarios are still outstanding.
Local validation for
d3f1b046dcUsed the same immutable azdev/diff-tool revision selected by this branch's CI environment setup (
c429216bfdae9b196dcfa6689f4d3f15a7b7054e) in the repository virtual environment, with repository-local configuration.These exact commands passed:
The command-table linter passed with the repository's existing CI exclusions applied; no new exclusions were added.
The focused offline regression command passed: 54 tests run, 52 passed, 2 opt-in live scenarios skipped:
Coverage includes the 25-command inventory/help, modeled request routes and bodies, required primary-location parsing, root location/tags, standard updates/errors/polling, collection pagination, resource-ID guards and adjacent App Service regressions. Offline mocked transport does not establish deployed feature availability.
The broader module run was not fully green. With
AZURE_TEST_RUN_LIVEunset and a developer-local pytest guard excluding live-only classes and blocking socket connections, this exact command reached 351 passed, 43 skipped, 201 subtests passed, then stopped on an unrelated existing Functions test:FunctionAppOnLinux.test_functionapp_on_linux_version_consumptionfails because its recorded Python 3.10 runtime reached end-of-life on 2026-10-31 and the current runtime validator rejects it. The test and runtime-validation code are unchanged by this update; the failure was left unchanged rather than altering unrelated behavior or weakening assertions. The local guard/results are not committed assets, and this result is not a claim that the full suite passed.Hosted checks for the new head are separate from these local results. The preserved bot-managed validation block above records an earlier head (
c8c9e8b...); its 130/130 badge is not evidence for the current generated implementation.History Notes
[App Service]
az appservice plan silo,az webapp silo: Add preview spec-generated Active Backup silo lifecycle, refresh and networking commands.[App Service]
az webapp managed-traffic,az webapp last-known-good: Add preview regional traffic and Last Known Good management.This checklist is used to make sure that common guidelines for a pull request are followed.
The PR title and description has followed the guideline in Submitting Pull Requests.
I adhere to the Command Guidelines.
I adhere to the Error Handling Guidelines.