Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package azure-cli-core for openSUSE:Factory 
checked in at 2022-09-20 19:23:28
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/azure-cli-core (Old)
 and      /work/SRC/openSUSE:Factory/.azure-cli-core.new.2083 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "azure-cli-core"

Tue Sep 20 19:23:28 2022 rev:43 rq:1004118 version:2.40.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/azure-cli-core/azure-cli-core.changes    
2022-08-08 11:43:01.082408802 +0200
+++ /work/SRC/openSUSE:Factory/.azure-cli-core.new.2083/azure-cli-core.changes  
2022-09-20 19:23:33.794470527 +0200
@@ -1,0 +2,12 @@
+Fri Sep 16 09:40:28 UTC 2022 - John Paul Adrian Glaubitz 
<adrian.glaub...@suse.com>
+
+- New upstream release
+  + Version 2.40.0
+  + For detailed information about changes see the
+    HISTORY.rst file provided with this package
+- Refresh patches for new version
+  + acc_disable-update-check.patch
+  + acc_update-argcomplete.patch
+- Update Requires from setup.py
+
+-------------------------------------------------------------------

Old:
----
  azure-cli-core-2.39.0.tar.gz

New:
----
  azure-cli-core-2.40.0.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ azure-cli-core.spec ++++++
--- /var/tmp/diff_new_pack.tQ0bgf/_old  2022-09-20 19:23:34.310472007 +0200
+++ /var/tmp/diff_new_pack.tQ0bgf/_new  2022-09-20 19:23:34.318472030 +0200
@@ -17,7 +17,7 @@
 
 
 Name:           azure-cli-core
-Version:        2.39.0
+Version:        2.40.0
 Release:        0
 Summary:        Microsoft Azure CLI Core Module
 License:        MIT
@@ -33,7 +33,7 @@
 BuildRequires:  python3-azure-nspkg >= 3.0.0
 BuildRequires:  python3-setuptools
 Requires:       azure-cli-nspkg
-Requires:       azure-cli-telemetry >= 1.0.7
+Requires:       azure-cli-telemetry >= 1.0.8
 Requires:       python3-PyJWT >= 2.1.0
 Requires:       python3-argcomplete < 3.0
 Requires:       python3-argcomplete >= 2.0
@@ -45,7 +45,7 @@
 Requires:       python3-humanfriendly >= 10.0
 Requires:       python3-jmespath
 Requires:       python3-knack < 1.0.0
-Requires:       python3-knack >= 0.9.0
+Requires:       python3-knack >= 0.10.0
 Requires:       python3-msal < 2.0.0
 Requires:       python3-msal >= 1.18.0b1
 Requires:       python3-msal-extensions < 2.0.0

++++++ acc_disable-update-check.patch ++++++
--- /var/tmp/diff_new_pack.tQ0bgf/_old  2022-09-20 19:23:34.350472121 +0200
+++ /var/tmp/diff_new_pack.tQ0bgf/_new  2022-09-20 19:23:34.354472133 +0200
@@ -1,8 +1,7 @@
-Index: azure-cli-core-2.39.0/azure/cli/core/util.py
-===================================================================
---- azure-cli-core-2.39.0.orig/azure/cli/core/util.py
-+++ azure-cli-core-2.39.0/azure/cli/core/util.py
-@@ -485,20 +485,7 @@ def show_updates_available(new_line_befo
+diff -Nru azure-cli-core-2.40.0.orig/azure/cli/core/util.py 
azure-cli-core-2.40.0/azure/cli/core/util.py
+--- azure-cli-core-2.40.0.orig/azure/cli/core/util.py  2022-09-02 
07:40:04.000000000 +0200
++++ azure-cli-core-2.40.0/azure/cli/core/util.py       2022-09-16 
11:13:11.938223294 +0200
+@@ -485,19 +485,7 @@
  
  
  def show_updates(updates_available_components, 
only_show_when_updates_available=False):
@@ -11,17 +10,16 @@
 -            logger.warning('Unable to check if your CLI is up-to-date. Check 
your internet connection.')
 -    elif updates_available_components:  # pylint: 
disable=too-many-nested-blocks
 -        if in_cloud_console():
--            warning_msg = 'You have %i updates available. They will be 
updated with the next build of Cloud Shell.'
+-            warning_msg = 'You have %i update(s) available. They will be 
updated with the next build of Cloud Shell.'
 -        else:
--            warning_msg = "You have %i updates available."
+-            warning_msg = "You have %i update(s) available."
 -            if CLI_PACKAGE_NAME in updates_available_components:
 -                warning_msg = "{} Consider updating your CLI installation 
with 'az upgrade'".format(warning_msg)
 -        logger.warning(warning_msg, len(updates_available_components))
 -    elif not only_show_when_updates_available:
 -        print('Your CLI is up-to-date.')
--
 +    return
  
+ 
  def get_json_object(json_string):
-     """ Loads a JSON string as an object and converts all keys to snake case 
"""
 

++++++ acc_update-argcomplete.patch ++++++
--- /var/tmp/diff_new_pack.tQ0bgf/_old  2022-09-20 19:23:34.366472168 +0200
+++ /var/tmp/diff_new_pack.tQ0bgf/_new  2022-09-20 19:23:34.370472179 +0200
@@ -1,15 +1,13 @@
-
-Index: azure-cli-core-2.39.0/setup.py
-===================================================================
---- azure-cli-core-2.39.0.orig/setup.py
-+++ azure-cli-core-2.39.0/setup.py
-@@ -43,7 +43,7 @@ CLASSIFIERS = [
+diff -Nru azure-cli-core-2.40.0.orig/setup.py azure-cli-core-2.40.0/setup.py
+--- azure-cli-core-2.40.0.orig/setup.py        2022-09-02 07:40:04.000000000 
+0200
++++ azure-cli-core-2.40.0/setup.py     2022-09-16 11:35:17.346870084 +0200
+@@ -43,7 +43,7 @@
  ]
  
  DEPENDENCIES = [
 -    'argcomplete~=1.8',
 +    'argcomplete>=1.8.0',
-     'azure-cli-telemetry==1.0.7.*',
+     'azure-cli-telemetry==1.0.8.*',
      'azure-mgmt-core>=1.2.0,<2',
      'cryptography',
 

++++++ azure-cli-core-2.39.0.tar.gz -> azure-cli-core-2.40.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/azure-cli-core-2.39.0/HISTORY.rst 
new/azure-cli-core-2.40.0/HISTORY.rst
--- old/azure-cli-core-2.39.0/HISTORY.rst       2022-07-29 05:25:38.000000000 
+0200
+++ new/azure-cli-core-2.40.0/HISTORY.rst       2022-09-02 07:40:04.000000000 
+0200
@@ -3,6 +3,15 @@
 Release History
 ===============
 
+2.40.0
+++++++
+* `aaz`: Support using `cli_ctx` to initiate AAZCommand class (#23459)
+* `aaz`: Fix AAZBearerTokenCredentialPolicy to support 
MSIAuthenticationWrapper credential (#23471)
+* Allow adding dedicated key for collecting CLI Telemetry (#23530)
+* Add `az.ps1` entry script for PowerShell (#23514)
+* `aaz`: Support generic update arguments (#23701)
+* Add CLI survey invitation (#23460)
+
 2.39.0
 ++++++
 * `az extension add`: Improve feedback shown to users when installation is 
unsuccessful (#22941)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/azure-cli-core-2.39.0/PKG-INFO 
new/azure-cli-core-2.40.0/PKG-INFO
--- old/azure-cli-core-2.39.0/PKG-INFO  2022-07-29 05:25:59.246679000 +0200
+++ new/azure-cli-core-2.40.0/PKG-INFO  2022-09-02 07:40:15.802124500 +0200
@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: azure-cli-core
-Version: 2.39.0
+Version: 2.40.0
 Summary: Microsoft Azure Command-Line Tools Core Module
 Home-page: https://github.com/Azure/azure-cli
 Author: Microsoft Corporation
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/azure-cli-core-2.39.0/azure/cli/core/__init__.py 
new/azure-cli-core-2.40.0/azure/cli/core/__init__.py
--- old/azure-cli-core-2.39.0/azure/cli/core/__init__.py        2022-07-29 
05:25:38.000000000 +0200
+++ new/azure-cli-core-2.40.0/azure/cli/core/__init__.py        2022-09-02 
07:40:04.000000000 +0200
@@ -4,7 +4,7 @@
 # 
--------------------------------------------------------------------------------------------
 # pylint: disable=line-too-long
 
-__version__ = "2.39.0"
+__version__ = "2.40.0"
 
 import os
 import sys
@@ -117,19 +117,11 @@
 
     def show_version(self):
         from azure.cli.core.util import get_az_version_string, show_updates
-        from azure.cli.core.commands.constants import SURVEY_PROMPT_STYLED, 
UX_SURVEY_PROMPT_STYLED
-        from azure.cli.core.style import print_styled_text
 
         ver_string, updates_available_components = get_az_version_string()
         print(ver_string)
         show_updates(updates_available_components)
 
-        show_link = self.config.getboolean('output', 'show_survey_link', True)
-        if show_link:
-            print_styled_text()
-            print_styled_text(SURVEY_PROMPT_STYLED)
-            print_styled_text(UX_SURVEY_PROMPT_STYLED)
-
     def exception_handler(self, ex):  # pylint: disable=no-self-use
         from azure.cli.core.util import handle_exception
         return handle_exception(ex)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/azure-cli-core-2.39.0/azure/cli/core/_help.py 
new/azure-cli-core-2.40.0/azure/cli/core/_help.py
--- old/azure-cli-core-2.39.0/azure/cli/core/_help.py   2022-07-29 
05:25:38.000000000 +0200
+++ new/azure-cli-core-2.40.0/azure/cli/core/_help.py   2022-09-02 
07:40:04.000000000 +0200
@@ -171,13 +171,6 @@
         self._print_detailed_help(cli_name, help_file)
         from azure.cli.core.util import show_updates_available
         show_updates_available(new_line_after=True)
-        show_link = self.cli_ctx.config.getboolean('output', 
'show_survey_link', True)
-        from azure.cli.core.commands.constants import (SURVEY_PROMPT_STYLED, 
UX_SURVEY_PROMPT_STYLED)
-        from azure.cli.core.style import print_styled_text
-        if show_link:
-            print_styled_text(SURVEY_PROMPT_STYLED)
-            if not nouns:
-                print_styled_text(UX_SURVEY_PROMPT_STYLED)
 
     def get_examples(self, command, parser, is_group):
         """Get examples of a certain command from the help file.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/azure-cli-core-2.39.0/azure/cli/core/_profile.py 
new/azure-cli-core-2.40.0/azure/cli/core/_profile.py
--- old/azure-cli-core-2.39.0/azure/cli/core/_profile.py        2022-07-29 
05:25:38.000000000 +0200
+++ new/azure-cli-core-2.40.0/azure/cli/core/_profile.py        2022-09-02 
07:40:04.000000000 +0200
@@ -675,8 +675,19 @@
     def get_installation_id(self):
         installation_id = self._storage.get(_INSTALLATION_ID)
         if not installation_id:
-            import uuid
-            installation_id = str(uuid.uuid1())
+            try:
+                # We share the same installationId with Azure Powershell. So 
try to load installationId from PSH file
+                # Contact: DEV@Nanxiang Liu, PM@Damien Caro
+                shared_installation_id_file = 
os.path.join(self.cli_ctx.config.config_dir,
+                                                           
'AzureRmContextSettings.json')
+                with open(shared_installation_id_file, 'r', 
encoding='utf-8-sig') as f:
+                    import json
+                    content = json.load(f)
+                    installation_id = content['Settings']['InstallationId']
+            except Exception as ex:  # pylint: disable=broad-except
+                logger.debug('Failed to load installationId from 
AzureRmSurvey.json. %s', str(ex))
+                import uuid
+                installation_id = str(uuid.uuid1())
             self._storage[_INSTALLATION_ID] = installation_id
         return installation_id
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/azure-cli-core-2.39.0/azure/cli/core/aaz/_arg.py 
new/azure-cli-core-2.40.0/azure/cli/core/aaz/_arg.py
--- old/azure-cli-core-2.39.0/azure/cli/core/aaz/_arg.py        2022-07-29 
05:25:38.000000000 +0200
+++ new/azure-cli-core-2.40.0/azure/cli/core/aaz/_arg.py        2022-09-02 
07:40:04.000000000 +0200
@@ -3,12 +3,13 @@
 # Licensed under the MIT License. See License.txt in the project root for 
license information.
 # 
--------------------------------------------------------------------------------------------
 import abc
+import copy
 
 from azure.cli.core import azclierror
 from knack.arguments import CLICommandArgument, CaseInsensitiveList
 
 from ._arg_action import AAZSimpleTypeArgAction, AAZObjectArgAction, 
AAZDictArgAction, AAZListArgAction, \
-    AAZGenericUpdateAction
+    AAZGenericUpdateAction, AAZGenericUpdateForceStringAction
 from ._base import AAZBaseType, AAZUndefined
 from ._field_type import AAZObjectType, AAZStrType, AAZIntType, AAZBoolType, 
AAZFloatType, AAZListType, AAZDictType, \
     AAZSimpleType
@@ -17,7 +18,7 @@
     AAZResourceLocationArgFormat, AAZResourceIdArgFormat, AAZUuidFormat, 
AAZDateFormat, AAZTimeFormat, \
     AAZDateTimeFormat, AAZDurationFormat
 
-# pylint: disable=redefined-builtin, protected-access
+# pylint: disable=redefined-builtin, protected-access, too-few-public-methods
 
 
 class AAZArgumentsSchema(AAZObjectType):
@@ -115,7 +116,7 @@
             required=self._required if self._default == AAZUndefined else 
False,
             help=self._help.get('short-summary', None),
             id_part=self._id_part,
-            default=self._default,
+            default=copy.deepcopy(self._default),
         )
         if self._arg_group:
             arg.arg_group = self._arg_group
@@ -448,7 +449,7 @@
 
 
 # Generic Update arguments
-class AAZGenericUpdateForceString(AAZBoolArg):
+class AAZGenericUpdateForceStringArg(AAZBoolArg):
 
     def __init__(
             self, options=('--force-string',), arg_group='Generic Update',
@@ -461,6 +462,11 @@
             **kwargs,
         )
 
+    def _build_cmd_action(self):
+        class Action(AAZGenericUpdateForceStringAction):
+            _schema = self  # bind action class with current schema
+        return Action
+
 
 class AAZGenericUpdateArg(AAZBaseArg, AAZListType):
 
@@ -495,7 +501,9 @@
         return arg
 
     def _build_cmd_action(self):
-        return AAZGenericUpdateAction
+        class Action(AAZGenericUpdateAction):
+            ACTION_NAME = "set"
+        return Action
 
 
 class AAZGenericUpdateAddArg(AAZGenericUpdateArg):
@@ -520,7 +528,9 @@
         return arg
 
     def _build_cmd_action(self):
-        return AAZGenericUpdateAction
+        class Action(AAZGenericUpdateAction):
+            ACTION_NAME = "add"
+        return Action
 
 
 class AAZGenericUpdateRemoveArg(AAZGenericUpdateArg):
@@ -545,7 +555,9 @@
         return arg
 
     def _build_cmd_action(self):
-        return AAZGenericUpdateAction
+        class Action(AAZGenericUpdateAction):
+            ACTION_NAME = "remove"
+        return Action
 
 
 def has_value(arg_value):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/azure-cli-core-2.39.0/azure/cli/core/aaz/_arg_action.py 
new/azure-cli-core-2.40.0/azure/cli/core/aaz/_arg_action.py
--- old/azure-cli-core-2.39.0/azure/cli/core/aaz/_arg_action.py 2022-07-29 
05:25:38.000000000 +0200
+++ new/azure-cli-core-2.40.0/azure/cli/core/aaz/_arg_action.py 2022-09-02 
07:40:04.000000000 +0200
@@ -5,6 +5,7 @@
 
 # pylint: disable=protected-access
 
+import copy
 import os
 from argparse import Action
 from collections import OrderedDict
@@ -117,7 +118,7 @@
         if data == AAZBlankArgValue:
             if cls._schema._blank == AAZUndefined:
                 raise AAZInvalidValueError("argument value cannot be blank")
-            data = cls._schema._blank
+            data = copy.deepcopy(cls._schema._blank)
 
         if isinstance(data, str):
             # transfer string into correct data
@@ -145,7 +146,7 @@
         if values is None:
             if cls._schema._blank == AAZUndefined:
                 raise AAZInvalidValueError("argument cannot be blank")
-            dest_ops.add(cls._schema._blank, *prefix_keys)
+            dest_ops.add(copy.deepcopy(cls._schema._blank), *prefix_keys)
         else:
             assert isinstance(values, list)
             for _, key_parts, value in cls.decode_values(values):
@@ -209,7 +210,7 @@
         if data == AAZBlankArgValue:
             if cls._schema._blank == AAZUndefined:
                 raise AAZInvalidValueError("argument value cannot be blank")
-            data = cls._schema._blank
+            data = copy.deepcopy(cls._schema._blank)
 
         if data is None:
             if cls._schema._nullable:
@@ -236,7 +237,7 @@
         if data == AAZBlankArgValue:
             if cls._schema._blank == AAZUndefined:
                 raise AAZInvalidValueError("argument value cannot be blank")
-            data = cls._schema._blank
+            data = copy.deepcopy(cls._schema._blank)
 
         if data is None:
             if cls._schema._nullable:
@@ -284,7 +285,7 @@
         if values is None:
             if cls._schema._blank == AAZUndefined:
                 raise AAZInvalidValueError("argument cannot be blank")
-            dest_ops.add(cls._schema._blank, *prefix_keys)
+            dest_ops.add(copy.deepcopy(cls._schema._blank), *prefix_keys)
         else:
             assert isinstance(values, list)
             ops = []
@@ -340,7 +341,7 @@
         if data == AAZBlankArgValue:
             if cls._schema._blank == AAZUndefined:
                 raise AAZInvalidValueError("argument value cannot be blank")
-            data = cls._schema._blank
+            data = copy.deepcopy(cls._schema._blank)
 
         if data is None:
             if cls._schema._nullable:
@@ -361,9 +362,29 @@
 
 
 class AAZGenericUpdateAction(Action):  # pylint: disable=too-few-public-methods
-    DEST = '_generic_update_args'
+    DEST = 'generic_update_args'
+    ACTION_NAME = None
 
     def __call__(self, parser, namespace, values, option_string=None):
         if not getattr(namespace, self.DEST, None):
-            setattr(namespace, self.DEST, [])
-        getattr(namespace, self.DEST).append((option_string, values))
+            setattr(namespace, self.DEST, {"actions": []})
+        getattr(namespace, self.DEST)["actions"].append((self.ACTION_NAME or 
option_string, values))
+
+
+class AAZGenericUpdateForceStringAction(AAZSimpleTypeArgAction):
+    DEST = 'generic_update_args'
+
+    def __call__(self, parser, namespace, values, option_string=None):
+        dest_ops = AAZArgActionOperations()
+        try:
+            self.setup_operations(dest_ops, values)
+        except (ValueError, KeyError) as ex:
+            raise azclierror.InvalidArgumentValueError(f"Failed to parse 
'{option_string}' argument: {ex}") from ex
+        except AAZShowHelp as aaz_help:
+            # show help message
+            aaz_help.keys = (option_string, *aaz_help.keys)
+            self.show_aaz_help(parser, aaz_help)
+
+        if not getattr(namespace, self.DEST, None):
+            setattr(namespace, self.DEST, {"actions": []})
+        dest_ops.apply(getattr(namespace, self.DEST), dest='force_string')
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/azure-cli-core-2.39.0/azure/cli/core/aaz/_base.py 
new/azure-cli-core-2.40.0/azure/cli/core/aaz/_base.py
--- old/azure-cli-core-2.39.0/azure/cli/core/aaz/_base.py       2022-07-29 
05:25:38.000000000 +0200
+++ new/azure-cli-core-2.40.0/azure/cli/core/aaz/_base.py       2022-09-02 
07:40:04.000000000 +0200
@@ -65,6 +65,12 @@
     def __bool__(self):
         return False
 
+    def __copy__(self):
+        return self
+
+    def __deepcopy__(self, *args, **kwargs):
+        return self
+
     def __lt__(self, other):
         self._cmp_err(other, '<')
 
@@ -119,6 +125,12 @@
     def __bool__(self):
         return False
 
+    def __copy__(self):
+        return self
+
+    def __deepcopy__(self, *args, **kwargs):
+        return self
+
     def __lt__(self, other):
         self._cmp_err(other, '<')
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/azure-cli-core-2.39.0/azure/cli/core/aaz/_command.py 
new/azure-cli-core-2.40.0/azure/cli/core/aaz/_command.py
--- old/azure-cli-core-2.39.0/azure/cli/core/aaz/_command.py    2022-07-29 
05:25:38.000000000 +0200
+++ new/azure-cli-core-2.40.0/azure/cli/core/aaz/_command.py    2022-09-02 
07:40:04.000000000 +0200
@@ -14,7 +14,8 @@
 from knack.preview import PreviewItem
 
 from azure.cli.core.azclierror import CLIInternalError
-from ._arg import AAZArgumentsSchema, AAZBoolArg
+from ._arg import AAZArgumentsSchema, AAZBoolArg, \
+    AAZGenericUpdateAddArg, AAZGenericUpdateSetArg, AAZGenericUpdateRemoveArg, 
AAZGenericUpdateForceStringArg
 from ._base import AAZUndefined, AAZBaseValue
 from ._field_type import AAZObjectType
 from ._paging import AAZPaged
@@ -79,18 +80,23 @@
                 options=['--no-wait'],
                 help='Do not wait for the long-running operation to finish.'
             )
-        # TODO: Implement Generic Update
-        # if cls.AZ_SUPPORT_GENERIC_UPDATE:
-        #     schema.generic_update_add = AAZGenericUpdateAddArg()
-        #     schema.generic_update_set = AAZGenericUpdateSetArg()
-        #     schema.generic_update_remove = AAZGenericUpdateRemoveArg()
-        #     schema.generic_update_force_string = 
AAZGenericUpdateForceString()
+        if cls.AZ_SUPPORT_GENERIC_UPDATE:
+            schema.generic_update_add = AAZGenericUpdateAddArg()
+            schema.generic_update_set = AAZGenericUpdateSetArg()
+            schema.generic_update_remove = AAZGenericUpdateRemoveArg()
+            schema.generic_update_force_string = 
AAZGenericUpdateForceStringArg()
         return schema
 
-    def __init__(self, loader):
+    def __init__(self, loader=None, cli_ctx=None, **kwargs):
+        """
+
+        :param loader: it is required for command registered in the command 
table
+        :param cli_ctx: if a command instance is not registered in the command 
table, only cli_ctx is required.
+        """
+        assert loader or cli_ctx, "loader or cli_ctx is required"
         self.loader = loader
         super().__init__(
-            cli_ctx=loader.cli_ctx,
+            cli_ctx=cli_ctx or loader.cli_ctx,
             name=self.AZ_NAME,
             confirmation=self.AZ_CONFIRMATION,
             arguments_loader=self._cli_arguments_loader,
@@ -98,6 +104,7 @@
             # knack use cmd.handler to check whether it is group or command,
             # however this property will not be used in AAZCommand. So use 
True value for it.
             # 
https://github.com/microsoft/knack/blob/e496c9590792572e680cb3ec959db175d9ba85dd/knack/parser.py#L227-L233
+            **kwargs
         )
         self.command_kwargs = {}
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/azure-cli-core-2.39.0/azure/cli/core/aaz/_http_policy.py 
new/azure-cli-core-2.40.0/azure/cli/core/aaz/_http_policy.py
--- old/azure-cli-core-2.39.0/azure/cli/core/aaz/_http_policy.py        
2022-07-29 05:25:38.000000000 +0200
+++ new/azure-cli-core-2.40.0/azure/cli/core/aaz/_http_policy.py        
2022-09-02 07:40:04.000000000 +0200
@@ -58,6 +58,8 @@
 
     @property
     def _need_new_aux_tokens(self):
+        if not hasattr(self._credential, 'get_auxiliary_tokens'):
+            return False
         if not self._aux_tokens:
             return True
         for token in self._aux_tokens:
@@ -91,8 +93,11 @@
         :param ~azure.core.pipeline.PipelineRequest request: the request
         :param str scopes: required scopes of authentication
         """
-        self._token = self._credential.get_token(*scopes, **kwargs)
-        self._aux_tokens = self._credential.get_auxiliary_tokens(*self._scopes)
+        if self._need_new_token:
+            self._token = self._credential.get_token(*scopes, **kwargs)
+
+        if self._need_new_aux_tokens:
+            self._aux_tokens = 
self._credential.get_auxiliary_tokens(*self._scopes)
 
         self._update_headers(request.http_request.headers)
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/azure-cli-core-2.39.0/azure/cli/core/aaz/_operation.py 
new/azure-cli-core-2.40.0/azure/cli/core/aaz/_operation.py
--- old/azure-cli-core-2.39.0/azure/cli/core/aaz/_operation.py  2022-07-29 
05:25:38.000000000 +0200
+++ new/azure-cli-core-2.40.0/azure/cli/core/aaz/_operation.py  2022-09-02 
07:40:04.000000000 +0200
@@ -14,6 +14,7 @@
 from ._base import AAZUndefined, AAZBaseValue, AAZBaseType
 from ._content_builder import AAZContentBuilder
 from ._field_type import AAZSimpleType, AAZObjectType, AAZDictType, AAZListType
+from ._field_value import AAZSimpleValue
 
 try:
     from urllib import quote  # type: ignore
@@ -368,6 +369,47 @@
         raise NotImplementedError()
 
     @staticmethod
-    def _update_instance_by_generic(instance, args):  # pylint: 
disable=unused-argument
-        # TODO: implement generic instance update
+    def _update_instance_by_generic(instance, generic_update_args):  # pylint: 
disable=unused-argument
+        from azure.cli.core.commands.arm import add_usage, remove_usage, 
set_usage, \
+            add_properties, remove_properties, set_properties
+        from azure.cli.core.azclierror import InvalidArgumentValueError
+        if not generic_update_args or not generic_update_args['actions']:
+            return instance
+        assert isinstance(instance, AAZBaseValue)
+
+        data = instance.to_serialized_data()  # to raw data
+        force_string = generic_update_args.get('force_string', False)
+        for action_name, values in generic_update_args['actions']:
+            if action_name == "set":
+                try:
+                    for expression in values:
+                        set_properties(data, expression, force_string)
+                except ValueError:
+                    raise InvalidArgumentValueError('invalid syntax: 
{}'.format(set_usage))
+            elif action_name == "add":
+                try:
+                    add_properties(data, values, force_string)
+                except ValueError:
+                    raise InvalidArgumentValueError('invalid syntax: 
{}'.format(add_usage))
+            elif action_name == "remove":
+                try:
+                    remove_properties(data, values)
+                except ValueError:
+                    raise InvalidArgumentValueError('invalid syntax: 
{}'.format(remove_usage))
+
+        # verify and update instance
+        try:
+            data = instance._schema.process_data(data)
+        except AssertionError as err:
+            raise InvalidArgumentValueError(f'invalid argument: {err}')
+
+        if isinstance(instance, AAZSimpleValue):
+            # should be combined with
+            #   self.ctx.var.instance = 
_update_instance_by_generic(self.ctx.var.instance, self.ctx.generic_update_args)
+            instance._data = data
+        else:
+            # in place update _data. Cannot use instance._data = data, because 
the original _data will not be changed.
+            assert isinstance(instance._data, dict)
+            instance._data.clear()
+            instance._data.update(data)
         return instance
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/azure-cli-core-2.39.0/azure/cli/core/auth/adal_authentication.py 
new/azure-cli-core-2.40.0/azure/cli/core/auth/adal_authentication.py
--- old/azure-cli-core-2.39.0/azure/cli/core/auth/adal_authentication.py        
2022-07-29 05:25:38.000000000 +0200
+++ new/azure-cli-core-2.40.0/azure/cli/core/auth/adal_authentication.py        
2022-09-02 07:40:04.000000000 +0200
@@ -98,6 +98,12 @@
         logger.debug("MSIAuthenticationWrapper.signed_session invoked by Track 
1 SDK")
         super().signed_session(session)
 
+    def get_auxiliary_tokens(self, *scopes, **kwargs):  # 
pylint:disable=no-self-use,unused-argument
+        """This method is added to align with 
CredentialAdaptor.get_auxiliary_tokens
+        Since managed identity belongs to a single tenant and currently 
doesn't support cross-tenant authentication,
+        simply return None."""
+        return None
+
 
 def _normalize_expires_on(expires_on):
     """
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/azure-cli-core-2.39.0/azure/cli/core/auth/credential_adaptor.py 
new/azure-cli-core-2.40.0/azure/cli/core/auth/credential_adaptor.py
--- old/azure-cli-core-2.39.0/azure/cli/core/auth/credential_adaptor.py 
2022-07-29 05:25:38.000000000 +0200
+++ new/azure-cli-core-2.40.0/azure/cli/core/auth/credential_adaptor.py 
2022-09-02 07:40:04.000000000 +0200
@@ -66,6 +66,7 @@
         return token
 
     def get_auxiliary_tokens(self, *scopes, **kwargs):
+        # To test cross-tenant authentication, see 
https://github.com/Azure/azure-cli/issues/16691
         if self._auxiliary_credentials:
             return [cred.get_token(*scopes, **kwargs) for cred in 
self._auxiliary_credentials]
         return None
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/azure-cli-core-2.39.0/azure/cli/core/auth/identity.py 
new/azure-cli-core-2.40.0/azure/cli/core/auth/identity.py
--- old/azure-cli-core-2.39.0/azure/cli/core/auth/identity.py   2022-07-29 
05:25:38.000000000 +0200
+++ new/azure-cli-core-2.40.0/azure/cli/core/auth/identity.py   2022-09-02 
07:40:04.000000000 +0200
@@ -6,6 +6,7 @@
 import json
 import os
 import re
+import sys
 
 from azure.cli.core._environment import get_config_dir
 from knack.log import get_logger
@@ -148,7 +149,8 @@
         if "user_code" not in flow:
             raise ValueError(
                 "Fail to create device flow. Err: %s" % json.dumps(flow, 
indent=4))
-        logger.warning(flow["message"])
+        from azure.cli.core.style import print_styled_text, Style
+        print_styled_text((Style.WARNING, flow["message"]), file=sys.stderr)
         result = self._msal_app.acquire_token_by_device_flow(flow, **kwargs)  
# By default it will block
         return check_result(result)
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/azure-cli-core-2.39.0/azure/cli/core/auth/landing_pages/success.html 
new/azure-cli-core-2.40.0/azure/cli/core/auth/landing_pages/success.html
--- old/azure-cli-core-2.39.0/azure/cli/core/auth/landing_pages/success.html    
2022-07-29 05:25:38.000000000 +0200
+++ new/azure-cli-core-2.40.0/azure/cli/core/auth/landing_pages/success.html    
2022-09-02 07:40:04.000000000 +0200
@@ -7,6 +7,6 @@
 </head>
 <body>
     <h4>You have logged into Microsoft Azure!</h4>
-    <p>You can close this window, or we will redirect you to the <a 
href="https://docs.microsoft.com/cli/azure/";>Azure CLI documents</a> in 10 
seconds.</p>
+    <p>You can close this window, or we will redirect you to the <a 
href="https://docs.microsoft.com/cli/azure/";>Azure CLI documentation</a> in 10 
seconds.</p>
 </body>
 </html>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/azure-cli-core-2.39.0/azure/cli/core/commands/constants.py 
new/azure-cli-core-2.40.0/azure/cli/core/commands/constants.py
--- old/azure-cli-core-2.39.0/azure/cli/core/commands/constants.py      
2022-07-29 05:25:38.000000000 +0200
+++ new/azure-cli-core-2.40.0/azure/cli/core/commands/constants.py      
2022-09-02 07:40:04.000000000 +0200
@@ -3,7 +3,6 @@
 # Licensed under the MIT License. See License.txt in the project root for 
license information.
 # 
--------------------------------------------------------------------------------------------
 
-from azure.cli.core.style import Style
 from knack.parser import ARGPARSE_SUPPORTED_KWARGS
 
 
@@ -31,15 +30,3 @@
 DEFAULT_QUERY_TIME_RANGE = 3600000
 
 BLOCKED_MODS = ['context', 'shell', 'documentdb', 'component']
-
-SURVEY_PROMPT = 'Please let us know how we are doing: 
https://aka.ms/azureclihats'
-SURVEY_PROMPT_STYLED = [
-    (Style.PRIMARY, 'Please let us know how we are doing: '),
-    (Style.HYPERLINK, 'https://aka.ms/azureclihats'),
-]
-
-UX_SURVEY_PROMPT = 'and let us know if you\'re interested in trying out our 
newest features: https://aka.ms/CLIUXstudy'
-UX_SURVEY_PROMPT_STYLED = [
-    (Style.PRIMARY, 'and let us know if you\'re interested in trying out our 
newest features: '),
-    (Style.HYPERLINK, 'https://aka.ms/CLIUXstudy'),
-]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/azure-cli-core-2.39.0/azure/cli/core/intercept_survey.py 
new/azure-cli-core-2.40.0/azure/cli/core/intercept_survey.py
--- old/azure-cli-core-2.39.0/azure/cli/core/intercept_survey.py        
1970-01-01 01:00:00.000000000 +0100
+++ new/azure-cli-core-2.40.0/azure/cli/core/intercept_survey.py        
2022-09-02 07:40:04.000000000 +0200
@@ -0,0 +1,98 @@
+# 
--------------------------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 
license information.
+# 
--------------------------------------------------------------------------------------------
+
+import os
+import sys
+import json
+from datetime import datetime, timedelta
+from azure.cli.core._config import GLOBAL_CONFIG_DIR
+from azure.cli.core._profile import Profile
+from azure.cli.core.style import print_styled_text
+from knack.log import get_logger
+
+logger = get_logger(__name__)
+
+SURVEY_NOTE_NAME = 'az_survey.json'
+GLOBAL_SURVEY_NOTE_PATH = os.path.join(GLOBAL_CONFIG_DIR, SURVEY_NOTE_NAME)
+
+EXPERIENCE_PERIOD_IN_DAYS = 3
+PROMPT_INTERVAL_IN_DAYS = 180
+
+# VT code for text formatting:
+# 
https://docs.microsoft.com/en-us/windows/console/console-virtual-terminal-sequences#extended-colors
+SURVEY_STYLE = '\x1b[0;38;2;255;255;255;48;2;0;120;212m'  # Default & 
Foreground #FFFFFF & Background #0078D4
+
+# VT code for text modification:
+# 
https://docs.microsoft.com/en-us/windows/console/console-virtual-terminal-sequences#text-modification
+NEW_LINE = '\x1b[1L'
+ERASE_IN_LINE = '\x1b[0K'
+
+
+_SURVEY_URL = 
"https://go.microsoft.com/fwlink/?linkid=2201856&ID={installation_id}&v={version}&d={day}";
+_SURVEY_LEARN_MORE_URL = "https://go.microsoft.com/fwlink/?linkid=2203309";
+
+
+def should_prompt(cli):
+    # should not prompt for automation
+    if not sys.stderr.isatty():
+        return False
+
+    # should not prompt if cx disables with config
+    if not cli.config.getboolean('core', 'survey_message', True):
+        return False
+
+    # should not prompt if cx is running survey command already
+    if sys.argv[1] == 'survey':
+        return False
+
+    if not os.path.isfile(GLOBAL_SURVEY_NOTE_PATH):
+        import uuid
+
+        # If the survey note file doesn't exist, then it should be the first 
time for cx to run CLI
+        # We should let cx try CLI for some days(EXPERIENCE_PERIOD_IN_DAYS) 
and then prompt the survey message
+        # We don't want to get the survey feedback on the same day, so we 
evenly distribute cx over 128 days
+        # using their installationId
+        installation_id = Profile(cli_ctx=cli).get_installation_id()
+        prompt_period = EXPERIENCE_PERIOD_IN_DAYS + 
(uuid.UUID(installation_id).int & 127)
+        next_prompt_time = datetime.utcnow() + timedelta(days=prompt_period)
+        survey_note = {
+            'last_prompt_time': '',
+            'next_prompt_time': next_prompt_time.strftime('%Y-%m-%dT%H:%M:%S')
+        }
+        with open(GLOBAL_SURVEY_NOTE_PATH, 'w') as f:
+            json.dump(survey_note, f)
+        return False
+
+    with open(GLOBAL_SURVEY_NOTE_PATH, 'r', encoding='utf-8-sig') as f:
+        survey_note = json.load(f)
+        next_prompt_time = datetime.strptime(survey_note['next_prompt_time'], 
'%Y-%m-%dT%H:%M:%S')
+        if datetime.utcnow() < next_prompt_time:
+            return False
+
+    return True
+
+
+def prompt_survey_message(cli):
+    if not should_prompt(cli):
+        return
+
+    # prompt message
+    print_styled_text((SURVEY_STYLE, NEW_LINE))
+    print_styled_text([
+        (SURVEY_STYLE, f"[Survey] Help us improve Azure CLI by sharing your 
experience. "
+                       f"This survey should take about 5 minutes. Run 'az 
survey' to "
+                       f"open in browser. Learn more at 
{_SURVEY_LEARN_MORE_URL}"),
+        (SURVEY_STYLE, ERASE_IN_LINE)
+    ])
+    print_styled_text((SURVEY_STYLE, NEW_LINE))
+
+    # log prompt time
+    next_prompt_time = datetime.utcnow() + 
timedelta(days=PROMPT_INTERVAL_IN_DAYS)
+    survey_note = {
+        'last_prompt_time': datetime.utcnow().strftime('%Y-%m-%dT%H:%M:%S'),
+        'next_prompt_time': next_prompt_time.strftime('%Y-%m-%dT%H:%M:%S')
+    }
+    with open(GLOBAL_SURVEY_NOTE_PATH, 'w') as f:
+        json.dump(survey_note, f)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/azure-cli-core-2.39.0/azure/cli/core/profiles/_shared.py 
new/azure-cli-core-2.40.0/azure/cli/core/profiles/_shared.py
--- old/azure-cli-core-2.39.0/azure/cli/core/profiles/_shared.py        
2022-07-29 05:25:38.000000000 +0200
+++ new/azure-cli-core-2.40.0/azure/cli/core/profiles/_shared.py        
2022-09-02 07:40:04.000000000 +0200
@@ -151,8 +151,8 @@
 
 AZURE_API_PROFILES = {
     'latest': {
-        ResourceType.MGMT_STORAGE: '2021-09-01',
-        ResourceType.MGMT_NETWORK: '2021-08-01',
+        ResourceType.MGMT_STORAGE: '2022-05-01',
+        ResourceType.MGMT_NETWORK: '2022-01-01',
         ResourceType.MGMT_COMPUTE: SDKProfile('2022-03-01', {
             'resource_skus': '2019-04-01',
             'disks': '2022-03-02',
@@ -178,18 +178,19 @@
         ResourceType.MGMT_RESOURCE_PRIVATELINKS: '2020-05-01',
         ResourceType.MGMT_NETWORK_DNS: '2018-05-01',
         ResourceType.MGMT_KEYVAULT: SDKProfile('2021-04-01-preview', {
-            'vaults': '2021-06-01-preview'
+            'vaults': '2022-07-01'
         }),
         ResourceType.MGMT_AUTHORIZATION: SDKProfile('2020-04-01-preview', {
             'classic_administrators': '2015-06-01',
             'role_definitions': '2018-01-01-preview',
             'provider_operations_metadata': '2018-01-01-preview'
         }),
-        ResourceType.MGMT_CONTAINERREGISTRY: SDKProfile('2021-08-01-preview', {
+        ResourceType.MGMT_CONTAINERREGISTRY: SDKProfile('2022-02-01-preview', {
             'agent_pools': '2019-06-01-preview',
             'tasks': '2019-06-01-preview',
             'task_runs': '2019-06-01-preview',
             'runs': '2019-06-01-preview',
+            'network_rule': '2021-08-01-preview'
         }),
         # The order does make things different.
         # Please keep ResourceType.DATA_KEYVAULT_KEYS before 
ResourceType.DATA_KEYVAULT
@@ -200,14 +201,14 @@
         ResourceType.DATA_KEYVAULT_ADMINISTRATION_ACCESS_CONTROL: 
'7.2-preview',
         ResourceType.DATA_STORAGE: '2018-11-09',
         ResourceType.DATA_STORAGE_BLOB: '2021-06-08',
-        ResourceType.DATA_STORAGE_FILEDATALAKE: '2021-06-08',
+        ResourceType.DATA_STORAGE_FILEDATALAKE: '2021-08-06',
         ResourceType.DATA_STORAGE_FILESHARE: '2021-06-08',
         ResourceType.DATA_STORAGE_QUEUE: '2018-03-28',
         ResourceType.DATA_COSMOS_TABLE: '2017-04-17',
-        ResourceType.MGMT_SERVICEBUS: '2021-06-01-preview',
+        ResourceType.MGMT_SERVICEBUS: '2022-01-01-preview',
         ResourceType.MGMT_EVENTHUB: '2022-01-01-preview',
         ResourceType.MGMT_MONITOR: SDKProfile('2019-06-01', {
-            'action_groups': '2021-09-01',
+            'action_groups': '2022-06-01',
             'activity_log_alerts': '2017-04-01',
             'activity_logs': '2015-04-01',
             'alert_rule_incidents': '2016-03-01',
@@ -239,7 +240,7 @@
             'private_endpoint_connections': '2019-10-17-preview',
             'subscription_diagnostic_settings': '2017-05-01-preview'
         }),
-        ResourceType.MGMT_MSI: '2021-09-30-preview',
+        ResourceType.MGMT_MSI: '2022-01-31-preview',
         ResourceType.MGMT_APPSERVICE: '2022-03-01',
         ResourceType.MGMT_IOTHUB: '2021-07-02',
         ResourceType.MGMT_IOTDPS: '2021-10-15',
@@ -294,7 +295,7 @@
         ResourceType.DATA_COSMOS_TABLE: '2017-04-17',
         ResourceType.MGMT_APPSERVICE: '2018-02-01',
         ResourceType.MGMT_EVENTHUB: '2022-01-01-preview',
-        ResourceType.MGMT_SERVICEBUS: '2021-06-01-preview',
+        ResourceType.MGMT_SERVICEBUS: '2022-01-01-preview',
         ResourceType.MGMT_IOTHUB: '2019-07-01-preview',
         ResourceType.MGMT_DATABOXEDGE: '2019-08-01',
         ResourceType.MGMT_CONTAINERREGISTRY: '2019-05-01',
@@ -341,7 +342,7 @@
         # API versions
         ResourceType.MGMT_APPSERVICE: '2018-02-01',
         ResourceType.MGMT_EVENTHUB: '2022-01-01-preview',
-        ResourceType.MGMT_SERVICEBUS: '2021-06-01-preview',
+        ResourceType.MGMT_SERVICEBUS: '2022-01-01-preview',
         ResourceType.MGMT_IOTHUB: '2019-03-22',
         ResourceType.MGMT_DATABOXEDGE: '2019-08-01'
     },
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/azure-cli-core-2.39.0/azure/cli/core/style.py 
new/azure-cli-core-2.40.0/azure/cli/core/style.py
--- old/azure-cli-core-2.39.0/azure/cli/core/style.py   2022-07-29 
05:25:38.000000000 +0200
+++ new/azure-cli-core-2.40.0/azure/cli/core/style.py   2022-09-02 
07:40:04.000000000 +0200
@@ -185,8 +185,12 @@
             try:
                 escape_seq = theme[style]
             except KeyError:
-                from azure.cli.core.azclierror import CLIInternalError
-                raise CLIInternalError("Invalid style. Only use pre-defined 
style in Style enum.")
+                if style.startswith('\x1b['):
+                    escape_seq = style
+                else:
+                    from azure.cli.core.azclierror import CLIInternalError
+                    raise CLIInternalError("Invalid style. Please use 
pre-defined style in Style enum "
+                                           "or give a valid ANSI code.")
             # Replace blue in powershell.exe
             if is_legacy_powershell and escape_seq in 
POWERSHELL_COLOR_REPLACEMENT:
                 escape_seq = POWERSHELL_COLOR_REPLACEMENT[escape_seq]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/azure-cli-core-2.39.0/azure/cli/core/telemetry.py 
new/azure-cli-core-2.40.0/azure/cli/core/telemetry.py
--- old/azure-cli-core-2.39.0/azure/cli/core/telemetry.py       2022-07-29 
05:25:38.000000000 +0200
+++ new/azure-cli-core-2.40.0/azure/cli/core/telemetry.py       2022-09-02 
07:40:04.000000000 +0200
@@ -16,11 +16,11 @@
 from functools import wraps
 from knack.util import CLIError
 from azure.cli.core import decorators
+from azure.cli.telemetry import DEFAULT_INSTRUMENTATION_KEY
 
 PRODUCT_NAME = 'azurecli'
 TELEMETRY_VERSION = '0.0.1.4'
 AZURE_CLI_PREFIX = 'Context.Default.AzureCLI.'
-DEFAULT_INSTRUMENTATION_KEY = 'c4395b75-49cc-422c-bc95-c7d51aef5d46'
 CORRELATION_ID_PROP_NAME = 'Reserved.DataModel.CorrelationId'
 # Put a config section or key (section.name) in the allowed set to allow 
recording the config
 # values in the section or for the key with 'az config set'
@@ -30,6 +30,7 @@
 
 class TelemetrySession:  # pylint: disable=too-many-instance-attributes
     def __init__(self, correlation_id=None, application=None):
+        self.instrumentation_key = {DEFAULT_INSTRUMENTATION_KEY}
         self.start_time = None
         self.end_time = None
         self.application = application
@@ -66,6 +67,13 @@
         self.poll_start_time = None
         self.poll_end_time = None
 
+    def add_event(self, name, properties):
+        for key in self.instrumentation_key:
+            self.events[key].append({
+                'name': name,
+                'properties': properties
+            })
+
     def add_exception(self, exception, fault_type, description=None, 
message=''):
         # Move the exception info into userTask record, in order to make one 
Telemetry record for one command
         self.exception_name = exception.__class__.__name__
@@ -97,20 +105,14 @@
             user_task.update(base)
             user_task.update(cli)
 
-            self.events[DEFAULT_INSTRUMENTATION_KEY].append({
-                'name': '{}/command'.format(PRODUCT_NAME),
-                'properties': user_task
-            })
+            self.add_event('{}/command'.format(PRODUCT_NAME), user_task)
 
             for name, props in self.exceptions:
                 props.update(base)
                 props.update(cli)
                 props.update({CORRELATION_ID_PROP_NAME: str(uuid.uuid4()),
                               'Reserved.EventId': self.event_id})
-                self.events[DEFAULT_INSTRUMENTATION_KEY].append({
-                    'name': name,
-                    'properties': props
-                })
+                self.add_event(name, props)
 
         payload = json.dumps(self.events, separators=(',', ':'))
         return _remove_symbols(payload)
@@ -201,6 +203,7 @@
         set_custom_properties(result, 'debug_info', ','.join(self.debug_info))
         set_custom_properties(result, 'PollStartTime', 
str(self.poll_start_time))
         set_custom_properties(result, 'PollEndTime', str(self.poll_end_time))
+        set_custom_properties(result, 'CloudName', _get_cloud_name())
 
         return result
 
@@ -415,6 +418,18 @@
 
 
 @decorators.suppress_all_exceptions()
+def add_dedicated_instrumentation_key(dedicated_instrumentation_key):
+    if not dedicated_instrumentation_key:
+        return
+
+    from collections.abc import Iterable
+    if isinstance(dedicated_instrumentation_key, str):
+        _session.instrumentation_key.add(dedicated_instrumentation_key)
+    elif isinstance(dedicated_instrumentation_key, Iterable):
+        _session.instrumentation_key.update(dedicated_instrumentation_key)
+
+
+@decorators.suppress_all_exceptions()
 def add_extension_event(extension_name, properties, 
instrumentation_key=DEFAULT_INSTRUMENTATION_KEY):
     set_custom_properties(properties, 'ExtensionName', extension_name)
     _add_event('extension', properties, 
instrumentation_key=instrumentation_key)
@@ -547,6 +562,14 @@
         return None
 
 
+@decorators.suppress_all_exceptions(fallback_return=None)
+def _get_cloud_name():
+    try:
+        return _session.application.cloud.name
+    except AttributeError:
+        return 'unknown'
+
+
 def _get_shell_type():
     # This method is not accurate and needs improvement, for instance all 
shells on Windows return 'cmd'.
     if 'ZSH_VERSION' in os.environ:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/azure-cli-core-2.39.0/azure/cli/core/util.py 
new/azure-cli-core-2.40.0/azure/cli/core/util.py
--- old/azure-cli-core-2.39.0/azure/cli/core/util.py    2022-07-29 
05:25:38.000000000 +0200
+++ new/azure-cli-core-2.40.0/azure/cli/core/util.py    2022-09-02 
07:40:04.000000000 +0200
@@ -490,9 +490,9 @@
             logger.warning('Unable to check if your CLI is up-to-date. Check 
your internet connection.')
     elif updates_available_components:  # pylint: 
disable=too-many-nested-blocks
         if in_cloud_console():
-            warning_msg = 'You have %i updates available. They will be updated 
with the next build of Cloud Shell.'
+            warning_msg = 'You have %i update(s) available. They will be 
updated with the next build of Cloud Shell.'
         else:
-            warning_msg = "You have %i updates available."
+            warning_msg = "You have %i update(s) available."
             if CLI_PACKAGE_NAME in updates_available_components:
                 warning_msg = "{} Consider updating your CLI installation with 
'az upgrade'".format(warning_msg)
         logger.warning(warning_msg, len(updates_available_components))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/azure-cli-core-2.39.0/azure_cli_core.egg-info/PKG-INFO 
new/azure-cli-core-2.40.0/azure_cli_core.egg-info/PKG-INFO
--- old/azure-cli-core-2.39.0/azure_cli_core.egg-info/PKG-INFO  2022-07-29 
05:25:59.000000000 +0200
+++ new/azure-cli-core-2.40.0/azure_cli_core.egg-info/PKG-INFO  2022-09-02 
07:40:15.000000000 +0200
@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: azure-cli-core
-Version: 2.39.0
+Version: 2.40.0
 Summary: Microsoft Azure Command-Line Tools Core Module
 Home-page: https://github.com/Azure/azure-cli
 Author: Microsoft Corporation
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/azure-cli-core-2.39.0/azure_cli_core.egg-info/SOURCES.txt 
new/azure-cli-core-2.40.0/azure_cli_core.egg-info/SOURCES.txt
--- old/azure-cli-core-2.39.0/azure_cli_core.egg-info/SOURCES.txt       
2022-07-29 05:25:59.000000000 +0200
+++ new/azure-cli-core-2.40.0/azure_cli_core.egg-info/SOURCES.txt       
2022-09-02 07:40:15.000000000 +0200
@@ -23,6 +23,7 @@
 azure/cli/core/command_recommender.py
 azure/cli/core/decorators.py
 azure/cli/core/file_util.py
+azure/cli/core/intercept_survey.py
 azure/cli/core/keys.py
 azure/cli/core/local_context.py
 azure/cli/core/mock.py
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/azure-cli-core-2.39.0/azure_cli_core.egg-info/requires.txt 
new/azure-cli-core-2.40.0/azure_cli_core.egg-info/requires.txt
--- old/azure-cli-core-2.39.0/azure_cli_core.egg-info/requires.txt      
2022-07-29 05:25:59.000000000 +0200
+++ new/azure-cli-core-2.40.0/azure_cli_core.egg-info/requires.txt      
2022-09-02 07:40:15.000000000 +0200
@@ -1,10 +1,10 @@
 argcomplete~=1.8
-azure-cli-telemetry==1.0.7.*
+azure-cli-telemetry==1.0.8.*
 azure-mgmt-core<2,>=1.2.0
 cryptography
 humanfriendly~=10.0
 jmespath
-knack~=0.9.0
+knack~=0.10.0
 msal-extensions~=1.0.0
 msal==1.18.0b1
 msrestazure~=0.6.4
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/azure-cli-core-2.39.0/setup.py 
new/azure-cli-core-2.40.0/setup.py
--- old/azure-cli-core-2.39.0/setup.py  2022-07-29 05:25:38.000000000 +0200
+++ new/azure-cli-core-2.40.0/setup.py  2022-09-02 07:40:04.000000000 +0200
@@ -8,7 +8,7 @@
 from codecs import open
 from setuptools import setup, find_packages
 
-VERSION = "2.39.0"
+VERSION = "2.40.0"
 
 # If we have source, validate that our version numbers match
 # This should prevent uploading releases with mismatched versions.
@@ -44,12 +44,12 @@
 
 DEPENDENCIES = [
     'argcomplete~=1.8',
-    'azure-cli-telemetry==1.0.7.*',
+    'azure-cli-telemetry==1.0.8.*',
     'azure-mgmt-core>=1.2.0,<2',
     'cryptography',
     'humanfriendly~=10.0',
     'jmespath',
-    'knack~=0.9.0',
+    'knack~=0.10.0',
     'msal-extensions~=1.0.0',
     'msal==1.18.0b1',
     'msrestazure~=0.6.4',

Reply via email to