Skip to content

{AKS} Fix DCR create/update for container network logs and high log scale mode#9667

Draft
carlotaarvela wants to merge 7 commits intoAzure:mainfrom
carlotaarvela:cnl-hslm-update
Draft

{AKS} Fix DCR create/update for container network logs and high log scale mode#9667
carlotaarvela wants to merge 7 commits intoAzure:mainfrom
carlotaarvela:cnl-hslm-update

Conversation

@carlotaarvela
Copy link
Contributor

@carlotaarvela carlotaarvela commented Mar 10, 2026

Related command

az aks create, az aks update

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? (pip install wheel==0.30.0 required)
  • 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.


Description

Fixes the az aks create and az aks update commands so that the Data Collection Rule (DCR) is properly created or updated when container network logs (CNL) or high log scale mode (HLSM) flags are passed. Previously, the DCR was not being created/updated in these scenarios, causing streams like Microsoft-ContainerLogV2-HighScale to be out of sync.

Changes

Create path (AKSPreviewManagedClusterCreateDecorator):

  • Added _should_create_dcra() helper to detect when any monitoring/CNL/HLSM flag is provided, ensuring the DCRA creation postprocessing step runs.
  • When CNL or HLSM flags are passed, create_dcr=True is now set so the DCR is created/updated alongside the DCRA.

Update path (AKSPreviewManagedClusterUpdateDecorator):

  • When --enable-container-network-logs or --enable-retina-flow-logs is passed, the monitoring_addon_postprocessing_required intermediate is now set, triggering the DCR update via ensure_container_insights_for_monitoring.
  • Added validation for standalone --enable-high-log-scale-mode on the update path: requires the monitoring addon (omsagent) with MSI authentication to be enabled, otherwise raises a clear error.

Tests:

  • Added comprehensive unit tests covering the new create and update behaviors for CNL and HLSM flag combinations.

Testing

  • Unit tests: pytest src/aks-preview/azext_aks_preview/tests/latest/test_managed_cluster_decorator.py -k "container_network_logs or high_log_scale_mode or enable_container_network or standalone_high_log"

@azure-client-tools-bot-prd
Copy link

azure-client-tools-bot-prd bot commented Mar 10, 2026

️✔️Azure CLI Extensions Breaking Change Test
️✔️Non Breaking Changes

@azure-client-tools-bot-prd
Copy link

Hi @carlotaarvela,
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.

@yonzhan
Copy link
Collaborator

yonzhan commented Mar 10, 2026

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

@github-actions
Copy link
Contributor

The git hooks are available for azure-cli and azure-cli-extensions repos. They could help you run required checks before creating the PR.

Please sync the latest code with latest dev branch (for azure-cli) or main branch (for azure-cli-extensions).
After that please run the following commands to enable git hooks:

pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>

@github-actions
Copy link
Contributor

CodeGen Tools Feedback Collection

Thank you for using our CodeGen tool. We value your feedback, and we would like to know how we can improve our product. Please take a few minutes to fill our codegen survey

@github-actions
Copy link
Contributor

github-actions bot commented Mar 10, 2026

@yonzhan yonzhan requested a review from yanzhudd March 11, 2026 01:09
@carlotaarvela carlotaarvela changed the title Fix update enable cnl hlsm {AKS} Fix DCR create/update for container network logs and high log scale mode Mar 12, 2026
@github-actions github-actions bot added the release-version-block Updates do not qualify release version rules. NOTE: please do not edit it manually. label Mar 13, 2026
@github-actions github-actions bot removed the release-version-block Updates do not qualify release version rules. NOTE: please do not edit it manually. label Mar 13, 2026
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