From 3485c58606bb357bb875a4ebcf07bcf76a3cf362 Mon Sep 17 00:00:00 2001 From: Michael Dai Date: Tue, 20 Oct 2026 12:53:12 +0800 Subject: [PATCH 1/2] [Containerapp] Pre-announce future logs destination default change Keep the default at log-analytics and warn about the future azure-monitor default without promising an unconfirmed release window. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../containerapp/_breaking_change.py | 15 +++++++++ .../test_containerapp_breaking_change.py | 33 +++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 src/azure-cli/azure/cli/command_modules/containerapp/_breaking_change.py create mode 100644 src/azure-cli/azure/cli/command_modules/containerapp/tests/latest/test_containerapp_breaking_change.py diff --git a/src/azure-cli/azure/cli/command_modules/containerapp/_breaking_change.py b/src/azure-cli/azure/cli/command_modules/containerapp/_breaking_change.py new file mode 100644 index 00000000000..beaa27f2e1e --- /dev/null +++ b/src/azure-cli/azure/cli/command_modules/containerapp/_breaking_change.py @@ -0,0 +1,15 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +from azure.cli.core.breaking_change import register_default_value_breaking_change + +register_default_value_breaking_change( + 'containerapp env create', + '--logs-destination', + 'log-analytics', + 'azure-monitor', + target_version=None, + doc_link='https://github.com/Azure/azure-cli/pull/34228', +) diff --git a/src/azure-cli/azure/cli/command_modules/containerapp/tests/latest/test_containerapp_breaking_change.py b/src/azure-cli/azure/cli/command_modules/containerapp/tests/latest/test_containerapp_breaking_change.py new file mode 100644 index 00000000000..e20abd7272c --- /dev/null +++ b/src/azure-cli/azure/cli/command_modules/containerapp/tests/latest/test_containerapp_breaking_change.py @@ -0,0 +1,33 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +import inspect +import runpy +import unittest +from unittest import mock + +from azure.cli.core.breaking_change import upcoming_breaking_changes +from azure.cli.core.mock import DummyCli +from azure.cli.command_modules.containerapp.custom import create_managed_environment + + +class ContainerappBreakingChangeTest(unittest.TestCase): + def test_logs_destination_preannouncement(self): + with mock.patch.dict(upcoming_breaking_changes, clear=True): + runpy.run_module('azure.cli.command_modules.containerapp._breaking_change') + changes = upcoming_breaking_changes['containerapp env create'] + self.assertEqual(len(changes), 1) + change = changes[0] + self.assertEqual(change.current_default, 'log-analytics') + self.assertEqual(change.new_default, 'azure-monitor') + self.assertIn('--logs-destination', change.message) + self.assertIn('in a future release', change.message) + self.assertIn('https://github.com/Azure/azure-cli/pull/34228', change.message) + self.assertTrue(change.to_tag(DummyCli()).always_display) + + self.assertEqual( + inspect.signature(create_managed_environment).parameters['logs_destination'].default, + 'log-analytics', + ) From 8f4930686e256b4320d5c8786ea00909b30f51e5 Mon Sep 17 00:00:00 2001 From: Michael Dai Date: Mon, 26 Oct 2026 10:48:21 +0800 Subject: [PATCH 2/2] [Containerapp] Target logs default pre-announcement at CLI 2.93.0 Address reviewer release guidance and update the warning regression assertion; preserve the current log-analytics default. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../azure/cli/command_modules/containerapp/_breaking_change.py | 2 +- .../tests/latest/test_containerapp_breaking_change.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/azure-cli/azure/cli/command_modules/containerapp/_breaking_change.py b/src/azure-cli/azure/cli/command_modules/containerapp/_breaking_change.py index beaa27f2e1e..4e1e0699a2a 100644 --- a/src/azure-cli/azure/cli/command_modules/containerapp/_breaking_change.py +++ b/src/azure-cli/azure/cli/command_modules/containerapp/_breaking_change.py @@ -10,6 +10,6 @@ '--logs-destination', 'log-analytics', 'azure-monitor', - target_version=None, + target_version='2.93.0', doc_link='https://github.com/Azure/azure-cli/pull/34228', ) diff --git a/src/azure-cli/azure/cli/command_modules/containerapp/tests/latest/test_containerapp_breaking_change.py b/src/azure-cli/azure/cli/command_modules/containerapp/tests/latest/test_containerapp_breaking_change.py index e20abd7272c..ec0b4f2ffa5 100644 --- a/src/azure-cli/azure/cli/command_modules/containerapp/tests/latest/test_containerapp_breaking_change.py +++ b/src/azure-cli/azure/cli/command_modules/containerapp/tests/latest/test_containerapp_breaking_change.py @@ -23,7 +23,7 @@ def test_logs_destination_preannouncement(self): self.assertEqual(change.current_default, 'log-analytics') self.assertEqual(change.new_default, 'azure-monitor') self.assertIn('--logs-destination', change.message) - self.assertIn('in a future release', change.message) + self.assertIn('in 2.93.0', change.message) self.assertIn('https://github.com/Azure/azure-cli/pull/34228', change.message) self.assertTrue(change.to_tag(DummyCli()).always_display)