Skip to content

[containerapp] Fix null revisionSuffix when updating from YAML with --from-revision - #9983

Draft
Aditya Pujara (a0x1ab) with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-null-revisionsuffix-issue
Draft

[containerapp] Fix null revisionSuffix when updating from YAML with --from-revision#9983
Aditya Pujara (a0x1ab) with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-null-revisionsuffix-issue

Conversation

Copilot AI commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

az containerapp revision copy (and az containerapp update) sent "revisionSuffix": null in the PATCH body even when properties.template.revisionSuffix was set in the --yaml file or via --revision-suffix.

Root cause: In set_up_update_containerapp_yaml, when --from-revision is used, the entire template dict is replaced with the old revision's template, silently discarding the revisionSuffix the YAML had already populated. Additionally, the --revision-suffix CLI arg was fully ignored in the YAML code path.

Changes (containerapp_decorator.pyset_up_update_containerapp_yaml):

  • Save revisionSuffix from the YAML-loaded template before overwriting it with the --from-revision revision's template, then restore it afterward.
  • Apply the --revision-suffix CLI arg at the end of the YAML path (takes precedence over the YAML value, consistent with the non-YAML path).
# YAML with revisionSuffix
properties:
  template:
    revisionSuffix: dev3
# Before fix: revisionSuffix sent as null
# After fix:  revisionSuffix sent as "dev3"
az containerapp revision copy --name myapp -g myrg \
  --from-revision myapp--abc123 \
  --yaml config.yaml

Tests: Added 5 unit tests in test_containerapp_patch_unit.py covering YAML suffix preservation, CLI arg override, and the no-suffix baseline.

Related command

az containerapp update, az containerapp revision copy

General Guidelines

  • Have you run azdev style <YOUR_EXT> locally? (pip install azdev required)
  • Have you run python scripts/ci/test_index.py -q locally? (azdev required; see .azure-pipelines/templates/azdev_setup.yml for the install command until azdev==0.2.11b1 is on PyPI)
  • My extension version conforms to the Extension version schema

For new extensions:

About Extension Publish

There is a pipeline to automatically build, upload and publish extension wheels.
Once your pull request is merged into main branch, a new pull request will be created to update src/index.json automatically.
You only need to update the version information in file setup.py and historical information in file HISTORY.rst in your PR but do not modify src/index.json.

@azure-client-tools-bot-prd

azure-client-tools-bot-prd Bot commented Jun 22, 2026

Copy link
Copy Markdown
️✔️Azure CLI Extensions Breaking Change Test
️✔️Non Breaking Changes

@azure-client-tools-bot-prd

Copy link
Copy Markdown

Hi Copilot,
Please write the description of changes which can be perceived by customers into HISTORY.rst.
If you want to release a new extension version, please update the version in setup.py as well.

…rom-revision

When `az containerapp revision copy` or `az containerapp update` is run
with both `--yaml` and `--from-revision`, the entire `template` dict is
replaced with the old revision's template. This discarded any
`revisionSuffix` that was specified in the YAML file, causing the PATCH
request to send `revisionSuffix: null`.

Fixes:
1. In `set_up_update_containerapp_yaml`: save the revisionSuffix from the
   YAML-loaded `new_containerapp` before overwriting the template from
   `--from-revision`, then restore it afterward if it was explicitly set.
2. Apply the `--revision-suffix` CLI arg in the YAML code path (it was
   previously silently ignored when `--yaml` was provided).

Adds unit tests covering all three scenarios:
- YAML sets revisionSuffix + --from-revision overwrites template
- --revision-suffix CLI arg provided alongside --yaml
- Neither YAML nor CLI provides a suffix (old behaviour preserved)

Closes #9982"
Copilot AI changed the title [WIP] Fix null revisionSuffix when updating container app from YAML [containerapp] Fix null revisionSuffix when updating from YAML with --from-revision Jun 22, 2026
@yonzhan

Copy link
Copy Markdown
Collaborator

containerapp

@a0x1ab Aditya Pujara (a0x1ab) added azure-client-tools-agent Pull request commented on or reviewed by Azure Client Tools Agent and removed azure-client-tools-agent Pull request commented on or reviewed by Azure Client Tools Agent labels Aug 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Auto-Assign Auto assign by bot ContainerApp

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants