azure-cli-core 2.87.0__tar.gz → 2.89.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (101) hide show
  1. {azure_cli_core-2.87.0 → azure_cli_core-2.89.0}/HISTORY.rst +9 -0
  2. {azure_cli_core-2.87.0/azure_cli_core.egg-info → azure_cli_core-2.89.0}/PKG-INFO +3 -2
  3. {azure_cli_core-2.87.0 → azure_cli_core-2.89.0}/azure/cli/core/__init__.py +10 -43
  4. {azure_cli_core-2.87.0 → azure_cli_core-2.89.0}/azure/cli/core/_profile.py +5 -0
  5. {azure_cli_core-2.87.0 → azure_cli_core-2.89.0}/azure/cli/core/aaz/_arg_fmt.py +10 -1
  6. {azure_cli_core-2.87.0 → azure_cli_core-2.89.0}/azure/cli/core/commandIndex.latest.json +4 -7
  7. {azure_cli_core-2.87.0 → azure_cli_core-2.89.0}/azure/cli/core/commands/arm.py +6 -1
  8. {azure_cli_core-2.87.0 → azure_cli_core-2.89.0}/azure/cli/core/helpIndex.latest.json +7 -11
  9. {azure_cli_core-2.87.0 → azure_cli_core-2.89.0}/azure/cli/core/profiles/_shared.py +0 -2
  10. {azure_cli_core-2.87.0 → azure_cli_core-2.89.0}/azure/cli/core/sdk/policies.py +12 -3
  11. {azure_cli_core-2.87.0 → azure_cli_core-2.89.0}/azure/cli/core/util.py +90 -12
  12. {azure_cli_core-2.87.0 → azure_cli_core-2.89.0/azure_cli_core.egg-info}/PKG-INFO +3 -2
  13. {azure_cli_core-2.87.0 → azure_cli_core-2.89.0}/azure_cli_core.egg-info/requires.txt +1 -1
  14. {azure_cli_core-2.87.0 → azure_cli_core-2.89.0}/setup.py +6 -2
  15. {azure_cli_core-2.87.0 → azure_cli_core-2.89.0}/LICENSE.txt +0 -0
  16. {azure_cli_core-2.87.0 → azure_cli_core-2.89.0}/MANIFEST.in +0 -0
  17. {azure_cli_core-2.87.0 → azure_cli_core-2.89.0}/README.rst +0 -0
  18. {azure_cli_core-2.87.0 → azure_cli_core-2.89.0}/azure/__init__.py +0 -0
  19. {azure_cli_core-2.87.0 → azure_cli_core-2.89.0}/azure/cli/__init__.py +0 -0
  20. {azure_cli_core-2.87.0 → azure_cli_core-2.89.0}/azure/cli/core/_breaking_change.py +0 -0
  21. {azure_cli_core-2.87.0 → azure_cli_core-2.89.0}/azure/cli/core/_completers.py +0 -0
  22. {azure_cli_core-2.87.0 → azure_cli_core-2.89.0}/azure/cli/core/_config.py +0 -0
  23. {azure_cli_core-2.87.0 → azure_cli_core-2.89.0}/azure/cli/core/_debug.py +0 -0
  24. {azure_cli_core-2.87.0 → azure_cli_core-2.89.0}/azure/cli/core/_environment.py +0 -0
  25. {azure_cli_core-2.87.0 → azure_cli_core-2.89.0}/azure/cli/core/_help.py +0 -0
  26. {azure_cli_core-2.87.0 → azure_cli_core-2.89.0}/azure/cli/core/_help_loaders.py +0 -0
  27. {azure_cli_core-2.87.0 → azure_cli_core-2.89.0}/azure/cli/core/_output.py +0 -0
  28. {azure_cli_core-2.87.0 → azure_cli_core-2.89.0}/azure/cli/core/_session.py +0 -0
  29. {azure_cli_core-2.87.0 → azure_cli_core-2.89.0}/azure/cli/core/aaz/__init__.py +0 -0
  30. {azure_cli_core-2.87.0 → azure_cli_core-2.89.0}/azure/cli/core/aaz/_arg.py +0 -0
  31. {azure_cli_core-2.87.0 → azure_cli_core-2.89.0}/azure/cli/core/aaz/_arg_action.py +0 -0
  32. {azure_cli_core-2.87.0 → azure_cli_core-2.89.0}/azure/cli/core/aaz/_arg_browser.py +0 -0
  33. {azure_cli_core-2.87.0 → azure_cli_core-2.89.0}/azure/cli/core/aaz/_base.py +0 -0
  34. {azure_cli_core-2.87.0 → azure_cli_core-2.89.0}/azure/cli/core/aaz/_client.py +0 -0
  35. {azure_cli_core-2.87.0 → azure_cli_core-2.89.0}/azure/cli/core/aaz/_command.py +0 -0
  36. {azure_cli_core-2.87.0 → azure_cli_core-2.89.0}/azure/cli/core/aaz/_command_ctx.py +0 -0
  37. {azure_cli_core-2.87.0 → azure_cli_core-2.89.0}/azure/cli/core/aaz/_content_builder.py +0 -0
  38. {azure_cli_core-2.87.0 → azure_cli_core-2.89.0}/azure/cli/core/aaz/_error_format.py +0 -0
  39. {azure_cli_core-2.87.0 → azure_cli_core-2.89.0}/azure/cli/core/aaz/_field_type.py +0 -0
  40. {azure_cli_core-2.87.0 → azure_cli_core-2.89.0}/azure/cli/core/aaz/_field_value.py +0 -0
  41. {azure_cli_core-2.87.0 → azure_cli_core-2.89.0}/azure/cli/core/aaz/_help.py +0 -0
  42. {azure_cli_core-2.87.0 → azure_cli_core-2.89.0}/azure/cli/core/aaz/_http_policy.py +0 -0
  43. {azure_cli_core-2.87.0 → azure_cli_core-2.89.0}/azure/cli/core/aaz/_operation.py +0 -0
  44. {azure_cli_core-2.87.0 → azure_cli_core-2.89.0}/azure/cli/core/aaz/_paging.py +0 -0
  45. {azure_cli_core-2.87.0 → azure_cli_core-2.89.0}/azure/cli/core/aaz/_poller.py +0 -0
  46. {azure_cli_core-2.87.0 → azure_cli_core-2.89.0}/azure/cli/core/aaz/_prompt.py +0 -0
  47. {azure_cli_core-2.87.0 → azure_cli_core-2.89.0}/azure/cli/core/aaz/_selector.py +0 -0
  48. {azure_cli_core-2.87.0 → azure_cli_core-2.89.0}/azure/cli/core/aaz/_utils.py +0 -0
  49. {azure_cli_core-2.87.0 → azure_cli_core-2.89.0}/azure/cli/core/aaz/exceptions.py +0 -0
  50. {azure_cli_core-2.87.0 → azure_cli_core-2.89.0}/azure/cli/core/aaz/utils.py +0 -0
  51. {azure_cli_core-2.87.0 → azure_cli_core-2.89.0}/azure/cli/core/api.py +0 -0
  52. {azure_cli_core-2.87.0 → azure_cli_core-2.89.0}/azure/cli/core/auth/__init__.py +0 -0
  53. {azure_cli_core-2.87.0 → azure_cli_core-2.89.0}/azure/cli/core/auth/agentic_session.py +0 -0
  54. {azure_cli_core-2.87.0 → azure_cli_core-2.89.0}/azure/cli/core/auth/binary_cache.py +0 -0
  55. {azure_cli_core-2.87.0 → azure_cli_core-2.89.0}/azure/cli/core/auth/constants.py +0 -0
  56. {azure_cli_core-2.87.0 → azure_cli_core-2.89.0}/azure/cli/core/auth/credential_adaptor.py +0 -0
  57. {azure_cli_core-2.87.0 → azure_cli_core-2.89.0}/azure/cli/core/auth/identity.py +0 -0
  58. {azure_cli_core-2.87.0 → azure_cli_core-2.89.0}/azure/cli/core/auth/landing_pages/error.html +0 -0
  59. {azure_cli_core-2.87.0 → azure_cli_core-2.89.0}/azure/cli/core/auth/landing_pages/success.html +0 -0
  60. {azure_cli_core-2.87.0 → azure_cli_core-2.89.0}/azure/cli/core/auth/msal_credentials.py +0 -0
  61. {azure_cli_core-2.87.0 → azure_cli_core-2.89.0}/azure/cli/core/auth/persistence.py +0 -0
  62. {azure_cli_core-2.87.0 → azure_cli_core-2.89.0}/azure/cli/core/auth/util.py +0 -0
  63. {azure_cli_core-2.87.0 → azure_cli_core-2.89.0}/azure/cli/core/azclierror.py +0 -0
  64. {azure_cli_core-2.87.0 → azure_cli_core-2.89.0}/azure/cli/core/azlogging.py +0 -0
  65. {azure_cli_core-2.87.0 → azure_cli_core-2.89.0}/azure/cli/core/breaking_change.py +0 -0
  66. {azure_cli_core-2.87.0 → azure_cli_core-2.89.0}/azure/cli/core/cloud.py +0 -0
  67. {azure_cli_core-2.87.0 → azure_cli_core-2.89.0}/azure/cli/core/command_recommender.py +0 -0
  68. {azure_cli_core-2.87.0 → azure_cli_core-2.89.0}/azure/cli/core/commands/__init__.py +0 -0
  69. {azure_cli_core-2.87.0 → azure_cli_core-2.89.0}/azure/cli/core/commands/client_factory.py +0 -0
  70. {azure_cli_core-2.87.0 → azure_cli_core-2.89.0}/azure/cli/core/commands/command_operation.py +0 -0
  71. {azure_cli_core-2.87.0 → azure_cli_core-2.89.0}/azure/cli/core/commands/constants.py +0 -0
  72. {azure_cli_core-2.87.0 → azure_cli_core-2.89.0}/azure/cli/core/commands/events.py +0 -0
  73. {azure_cli_core-2.87.0 → azure_cli_core-2.89.0}/azure/cli/core/commands/parameters.py +0 -0
  74. {azure_cli_core-2.87.0 → azure_cli_core-2.89.0}/azure/cli/core/commands/progress.py +0 -0
  75. {azure_cli_core-2.87.0 → azure_cli_core-2.89.0}/azure/cli/core/commands/sensitive.py +0 -0
  76. {azure_cli_core-2.87.0 → azure_cli_core-2.89.0}/azure/cli/core/commands/template_create.py +0 -0
  77. {azure_cli_core-2.87.0 → azure_cli_core-2.89.0}/azure/cli/core/commands/transform.py +0 -0
  78. {azure_cli_core-2.87.0 → azure_cli_core-2.89.0}/azure/cli/core/commands/validators.py +0 -0
  79. {azure_cli_core-2.87.0 → azure_cli_core-2.89.0}/azure/cli/core/credential_helper.py +0 -0
  80. {azure_cli_core-2.87.0 → azure_cli_core-2.89.0}/azure/cli/core/decorators.py +0 -0
  81. {azure_cli_core-2.87.0 → azure_cli_core-2.89.0}/azure/cli/core/extension/__init__.py +0 -0
  82. {azure_cli_core-2.87.0 → azure_cli_core-2.89.0}/azure/cli/core/extension/_homebrew_patch.py +0 -0
  83. {azure_cli_core-2.87.0 → azure_cli_core-2.89.0}/azure/cli/core/extension/_index.py +0 -0
  84. {azure_cli_core-2.87.0 → azure_cli_core-2.89.0}/azure/cli/core/extension/_resolve.py +0 -0
  85. {azure_cli_core-2.87.0 → azure_cli_core-2.89.0}/azure/cli/core/extension/dynamic_install.py +0 -0
  86. {azure_cli_core-2.87.0 → azure_cli_core-2.89.0}/azure/cli/core/extension/operations.py +0 -0
  87. {azure_cli_core-2.87.0 → azure_cli_core-2.89.0}/azure/cli/core/file_util.py +0 -0
  88. {azure_cli_core-2.87.0 → azure_cli_core-2.89.0}/azure/cli/core/intercept_survey.py +0 -0
  89. {azure_cli_core-2.87.0 → azure_cli_core-2.89.0}/azure/cli/core/keys.py +0 -0
  90. {azure_cli_core-2.87.0 → azure_cli_core-2.89.0}/azure/cli/core/local_context.py +0 -0
  91. {azure_cli_core-2.87.0 → azure_cli_core-2.89.0}/azure/cli/core/mock.py +0 -0
  92. {azure_cli_core-2.87.0 → azure_cli_core-2.89.0}/azure/cli/core/parser.py +0 -0
  93. {azure_cli_core-2.87.0 → azure_cli_core-2.89.0}/azure/cli/core/profiles/__init__.py +0 -0
  94. {azure_cli_core-2.87.0 → azure_cli_core-2.89.0}/azure/cli/core/sdk/__init__.py +0 -0
  95. {azure_cli_core-2.87.0 → azure_cli_core-2.89.0}/azure/cli/core/style.py +0 -0
  96. {azure_cli_core-2.87.0 → azure_cli_core-2.89.0}/azure/cli/core/telemetry.py +0 -0
  97. {azure_cli_core-2.87.0 → azure_cli_core-2.89.0}/azure_cli_core.egg-info/SOURCES.txt +0 -0
  98. {azure_cli_core-2.87.0 → azure_cli_core-2.89.0}/azure_cli_core.egg-info/dependency_links.txt +0 -0
  99. {azure_cli_core-2.87.0 → azure_cli_core-2.89.0}/azure_cli_core.egg-info/not-zip-safe +0 -0
  100. {azure_cli_core-2.87.0 → azure_cli_core-2.89.0}/azure_cli_core.egg-info/top_level.txt +0 -0
  101. {azure_cli_core-2.87.0 → azure_cli_core-2.89.0}/setup.cfg +0 -0
@@ -3,6 +3,15 @@
3
3
  Release History
4
4
  ===============
5
5
 
6
+ 2.89.0
7
+ ++++++
8
+ * Minor fixes
9
+
10
+ 2.88.0
11
+ ++++++
12
+ * Resolve CVE-2026-48526 (#33562)
13
+ * Update global policy argument `--acquire-policy-token` to pick up new api-version and propagate correlation-id (#33661)
14
+
6
15
  2.87.0
7
16
  ++++++
8
17
  * Resolve CVE-2026-44431 (#33351)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: azure-cli-core
3
- Version: 2.87.0
3
+ Version: 2.89.0
4
4
  Summary: Microsoft Azure Command-Line Tools Core Module
5
5
  Home-page: https://github.com/Azure/azure-cli
6
6
  Author: Microsoft Corporation
@@ -15,6 +15,7 @@ Classifier: Programming Language :: Python :: 3.10
15
15
  Classifier: Programming Language :: Python :: 3.11
16
16
  Classifier: Programming Language :: Python :: 3.12
17
17
  Classifier: Programming Language :: Python :: 3.13
18
+ Classifier: Programming Language :: Python :: 3.14
18
19
  Classifier: License :: OSI Approved :: MIT License
19
20
  Requires-Python: >=3.10.0
20
21
  License-File: LICENSE.txt
@@ -32,7 +33,7 @@ Requires-Dist: msal-extensions==1.3.1
32
33
  Requires-Dist: msal[broker]==1.36.0; sys_platform == "win32"
33
34
  Requires-Dist: msal==1.36.0; sys_platform != "win32"
34
35
  Requires-Dist: packaging>=20.9
35
- Requires-Dist: pkginfo>=1.5.0.1
36
+ Requires-Dist: pkginfo>=1.12.0
36
37
  Requires-Dist: psutil>=5.9; sys_platform != "cygwin"
37
38
  Requires-Dist: PyJWT>=2.1.0
38
39
  Requires-Dist: pyopenssl>=17.1.0
@@ -4,7 +4,7 @@
4
4
  # --------------------------------------------------------------------------------------------
5
5
  # pylint: disable=line-too-long
6
6
 
7
- __version__ = "2.87.0"
7
+ __version__ = "2.89.0"
8
8
 
9
9
  import os
10
10
  import sys
@@ -37,10 +37,6 @@ REFRESH_EXTENSION_HELP_OVERLAY_SENTINEL = '__refresh_extension_help_overlay__'
37
37
  ALWAYS_LOADED_MODULES = []
38
38
  # Extensions that will always be loaded if installed. They don't expose commands but hook into CLI core.
39
39
  ALWAYS_LOADED_EXTENSIONS = ['azext_ai_examples', 'azext_next']
40
- # Timeout (in seconds) for loading a single module. Acts as a safety valve to prevent indefinite hangs
41
- MODULE_LOAD_TIMEOUT_SECONDS = 60
42
- # Maximum number of worker threads for parallel module loading.
43
- MAX_WORKER_THREAD_COUNT = 4
44
40
 
45
41
 
46
42
  def _get_top_level_command(args):
@@ -322,6 +318,7 @@ class MainCommandsLoader(CLICommandsLoader):
322
318
 
323
319
  start_time = time.perf_counter()
324
320
  logger.debug("Loading command modules...")
321
+ logger.debug(self.header_mod)
325
322
  results = self._load_modules(args, command_modules)
326
323
 
327
324
  count, cumulative_group_count, cumulative_command_count = \
@@ -664,42 +661,14 @@ class MainCommandsLoader(CLICommandsLoader):
664
661
  loader._update_command_definitions() # pylint: disable=protected-access
665
662
 
666
663
  def _load_modules(self, args, command_modules):
667
- """Load command modules using ThreadPoolExecutor with timeout protection."""
668
- import concurrent.futures
669
- from concurrent.futures import ThreadPoolExecutor
664
+ """Load command modules sequentially."""
670
665
  from azure.cli.core.commands import BLOCKED_MODS
671
666
 
672
667
  results = []
673
- with ThreadPoolExecutor(max_workers=MAX_WORKER_THREAD_COUNT) as executor:
674
- future_to_module = {executor.submit(self._load_single_module, mod, args): mod
675
- for mod in command_modules if mod not in BLOCKED_MODS}
676
-
677
- try:
678
- for future in concurrent.futures.as_completed(future_to_module, timeout=MODULE_LOAD_TIMEOUT_SECONDS):
679
- try:
680
- result = future.result()
681
- results.append(result)
682
- except (ImportError, AttributeError, TypeError, ValueError) as ex:
683
- mod = future_to_module[future]
684
- logger.warning("Module '%s' load failed: %s", mod, ex)
685
- results.append(ModuleLoadResult(mod, {}, {}, 0, ex))
686
- except Exception as ex: # pylint: disable=broad-exception-caught
687
- mod = future_to_module[future]
688
- logger.warning("Module '%s' load failed with unexpected exception: %s", mod, ex)
689
- results.append(ModuleLoadResult(mod, {}, {}, 0, ex))
690
- except concurrent.futures.TimeoutError:
691
- for future, mod in future_to_module.items():
692
- if future.done():
693
- try:
694
- result = future.result()
695
- results.append(result)
696
- except Exception as ex: # pylint: disable=broad-exception-caught
697
- logger.warning("Module '%s' load failed: %s", mod, ex)
698
- results.append(ModuleLoadResult(mod, {}, {}, 0, ex))
699
- else:
700
- logger.warning("Module '%s' load timeout after %s seconds", mod, MODULE_LOAD_TIMEOUT_SECONDS)
701
- results.append(ModuleLoadResult(mod, {}, {}, 0,
702
- Exception(f"Module '{mod}' load timeout")))
668
+ for mod in command_modules:
669
+ if mod in BLOCKED_MODS:
670
+ continue
671
+ results.append(self._load_single_module(mod, args))
703
672
 
704
673
  return results
705
674
 
@@ -712,6 +681,8 @@ class MainCommandsLoader(CLICommandsLoader):
712
681
  module_command_table, module_group_table, command_loader = _load_module_command_loader(self, args, mod)
713
682
  import_module_breaking_changes(mod)
714
683
  elapsed_time = time.perf_counter() - start_time
684
+ logger.debug(self.item_format_string, mod, elapsed_time,
685
+ len(module_group_table), len(module_command_table))
715
686
  return ModuleLoadResult(mod, module_command_table, module_group_table, elapsed_time, command_loader=command_loader)
716
687
  except Exception as ex: # pylint: disable=broad-except
717
688
  tb_str = traceback.format_exc()
@@ -744,13 +715,9 @@ class MainCommandsLoader(CLICommandsLoader):
744
715
  self.command_table.update(result.command_table)
745
716
  self.command_group_table.update(result.group_table)
746
717
 
747
- logger.debug(self.item_format_string, result.module_name, result.elapsed_time,
748
- len(result.group_table), len(result.command_table))
749
-
750
718
  def _process_results_with_timing(self, results):
751
719
  """Process pre-loaded module results with timing and progress reporting."""
752
- logger.debug("Loaded command modules in parallel:")
753
- logger.debug(self.header_mod)
720
+ logger.debug("Loaded command modules:")
754
721
 
755
722
  count = 0
756
723
  cumulative_group_count = 0
@@ -441,6 +441,11 @@ class Profile:
441
441
  def get_msal_token(self, scopes, data):
442
442
  """Get VM SSH certificate. DO NOT use it for other purposes. To get an access token, use get_raw_token instead.
443
443
  """
444
+ account = self.get_subscription()
445
+ managed_identity_type, _ = Profile._parse_managed_identity_account(account)
446
+ if managed_identity_type or (in_cloud_console() and account[_USER_ENTITY].get(_CLOUD_SHELL_ID)):
447
+ raise AuthenticationError("VM SSH currently doesn't support managed identity or Cloud Shell.")
448
+
444
449
  credential, _, _ = self.get_login_credentials(sdk_credential=False)
445
450
  from .auth.constants import ACCESS_TOKEN
446
451
  certificate_string = credential.acquire_token(scopes, data=data)[ACCESS_TOKEN]
@@ -760,10 +760,19 @@ class AAZPaginationTokenArgFormat(AAZBaseArgFormat):
760
760
  raise AAZInvalidArgValueError("Decoded object is not a dictionary.")
761
761
 
762
762
  try:
763
- _, _ = obj["next_link"], obj["offset"]
763
+ next_link, _ = obj["next_link"], obj["offset"]
764
764
  except KeyError:
765
765
  raise AAZInvalidArgValueError("`next_link` or `offset` doesn't exist.")
766
766
 
767
+ # `next_link` is a URL that the next page request is sent to with an Azure access token.
768
+ # Validate it shares the same origin as a trusted endpoint of the active cloud to prevent
769
+ # the token from being sent to an attacker-controlled host such as
770
+ # `https://management.azure.com.attacker`.
771
+ if next_link is not None:
772
+ from azure.cli.core.util import is_trusted_cloud_endpoint
773
+ if not is_trusted_cloud_endpoint(next_link, ctx.cli_ctx):
774
+ raise AAZInvalidArgValueError("`next_link` '{}' is not a valid endpoint.".format(next_link))
775
+
767
776
  assert isinstance(value, AAZSimpleValue)
768
777
  data = value._data
769
778
  if data == AAZUndefined or data is None or value._is_patch:
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "2.87.0",
2
+ "version": "2.89.0",
3
3
  "cloudProfile": "latest",
4
4
  "commandIndex": {
5
5
  "account": [
@@ -15,9 +15,6 @@
15
15
  "advisor": [
16
16
  "azure.cli.command_modules.advisor"
17
17
  ],
18
- "afd": [
19
- "azure.cli.command_modules.cdn"
20
- ],
21
18
  "aks": [
22
19
  "azure.cli.command_modules.acs",
23
20
  "azure.cli.command_modules.serviceconnector"
@@ -61,9 +58,6 @@
61
58
  "capacity": [
62
59
  "azure.cli.command_modules.vm"
63
60
  ],
64
- "cdn": [
65
- "azure.cli.command_modules.cdn"
66
- ],
67
61
  "cloud": [
68
62
  "azure.cli.command_modules.cloud"
69
63
  ],
@@ -319,6 +313,9 @@
319
313
  "webapp": [
320
314
  "azure.cli.command_modules.appservice",
321
315
  "azure.cli.command_modules.serviceconnector"
316
+ ],
317
+ "stack-whatif": [
318
+ "azure.cli.command_modules.resource"
322
319
  ]
323
320
  }
324
321
  }
@@ -774,6 +774,11 @@ def create_role_assignment(cli_ctx, principal_id, identity_role=None, identity_s
774
774
  import time
775
775
  from azure.core.exceptions import HttpResponseError
776
776
 
777
+ # Coerce AAZSimpleValue/model values to plain strings for SDK 5.0.0b2 compatibility
778
+ principal_id = str(principal_id) if principal_id else principal_id
779
+ identity_role = str(identity_role) if identity_role else identity_role
780
+ identity_scope = str(identity_scope) if identity_scope else identity_scope
781
+
777
782
  identity_role_id = resolve_role_id(cli_ctx, identity_role, identity_scope)
778
783
  assignments_client = get_mgmt_service_client(cli_ctx, ResourceType.MGMT_AUTHORIZATION).role_assignments
779
784
  RoleAssignmentCreateParameters = get_sdk(cli_ctx, ResourceType.MGMT_AUTHORIZATION,
@@ -818,7 +823,7 @@ def resolve_role_id(cli_ctx, role, scope):
818
823
  except ValueError:
819
824
  pass
820
825
  if not role_id: # retrieve role id
821
- role_defs = list(client.list(scope, "roleName eq '{}'".format(role)))
826
+ role_defs = list(client.list(scope, filter="roleName eq '{}'".format(role)))
822
827
  if not role_defs:
823
828
  raise CLIError("Role '{}' doesn't exist.".format(role))
824
829
  if len(role_defs) > 1:
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "2.87.0",
2
+ "version": "2.89.0",
3
3
  "cloudProfile": "latest",
4
4
  "helpIndex": {
5
5
  "groups": {
@@ -19,10 +19,6 @@
19
19
  "summary": "Manage Azure Advisor.",
20
20
  "tags": ""
21
21
  },
22
- "afd": {
23
- "summary": "Manage Azure Front Door Standard/Premium.",
24
- "tags": ""
25
- },
26
22
  "aks": {
27
23
  "summary": "Azure Kubernetes Service.",
28
24
  "tags": ""
@@ -75,10 +71,6 @@
75
71
  "summary": "Manage capacity.",
76
72
  "tags": ""
77
73
  },
78
- "cdn": {
79
- "summary": "Manage Azure Content Delivery Networks (CDNs).",
80
- "tags": ""
81
- },
82
74
  "cloud": {
83
75
  "summary": "Manage registered Azure clouds.",
84
76
  "tags": ""
@@ -89,7 +81,7 @@
89
81
  },
90
82
  "compute-fleet": {
91
83
  "summary": "Manage for Azure Compute Fleet.",
92
- "tags": "[Preview]"
84
+ "tags": ""
93
85
  },
94
86
  "compute-recommender": {
95
87
  "summary": "Manage sku/zone/region recommender info for compute resources.",
@@ -366,6 +358,10 @@
366
358
  "webapp": {
367
359
  "summary": "Manage web apps.",
368
360
  "tags": ""
361
+ },
362
+ "stack-whatif": {
363
+ "summary": "A deployment stack What-If is a preview of an operation to be performed on a new or existing deployment stack.",
364
+ "tags": ""
369
365
  }
370
366
  },
371
367
  "commands": {
@@ -378,7 +374,7 @@
378
374
  "tags": ""
379
375
  },
380
376
  "find": {
381
- "summary": "I'm an AI robot, my advice is based on our Azure documentation as well as the usage patterns of Azure CLI and Azure ARM users. Using me improves Azure products and documentation.",
377
+ "summary": "I'm an AI assistant, my advice is based on Microsoft Learn documentation as well as the usage patterns of Azure CLI and Azure ARM users. Using me improves Azure products and documentation.",
382
378
  "tags": ""
383
379
  },
384
380
  "interactive": {
@@ -97,7 +97,6 @@ class ResourceType(Enum): # pylint: disable=too-few-public-methods
97
97
  MGMT_BATCHAI = ('azure.mgmt.batchai', None)
98
98
  MGMT_BILLING = ('azure.mgmt.billing', None)
99
99
  MGMT_BOTSERVICE = ('azure.mgmt.botservice', None)
100
- MGMT_CDN = ('azure.mgmt.cdn', None)
101
100
  MGMT_COGNITIVESERVICES = ('azure.mgmt.cognitiveservices', None)
102
101
  MGMT_CONTAINERINSTANCE = ('azure.mgmt.containerinstance', None)
103
102
  MGMT_COSMOSDB = ('azure.mgmt.cosmosdb', None)
@@ -165,7 +164,6 @@ AZURE_API_PROFILES = {
165
164
  'snapshots': '2023-10-02',
166
165
  'galleries': '2021-10-01',
167
166
  'gallery_images': '2021-10-01',
168
- 'gallery_image_versions': '2024-03-03',
169
167
  'gallery_applications': '2021-07-01',
170
168
  'gallery_application_versions': '2022-01-03',
171
169
  'shared_galleries': '2022-01-03',
@@ -6,6 +6,7 @@
6
6
  import logging
7
7
  import re
8
8
  import types
9
+ import uuid
9
10
 
10
11
  from azure.core.pipeline.policies import SansIOHTTPPolicy, UserAgentPolicy
11
12
  from knack.log import get_logger
@@ -111,7 +112,7 @@ def get_custom_hook_policy(cli_ctx):
111
112
  http_request = request.http_request
112
113
  if getattr(http_request, 'method', '') == 'GET':
113
114
  return
114
- ACQUIRE_POLICY_TOKEN_URL = '/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/acquirePolicyToken?api-version=2025-03-01'
115
+ ACQUIRE_POLICY_TOKEN_URL = '/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/acquirePolicyToken?api-version=2025-11-01'
115
116
  policy_token = None
116
117
 
117
118
  from azure.cli.core.azclierror import ServiceError
@@ -135,10 +136,18 @@ def get_custom_hook_policy(cli_ctx):
135
136
  },
136
137
  "changeReference": cli_ctx.data.get('_change_reference', None)
137
138
  }
139
+
140
+ # Reuse the original request's x-ms-correlation-request-id so the acquirePolicyToken call shares the same correlation ID as the operation it is gating.
141
+ headers = ['Content-Type=application/json', 'x-ms-force-sync=true']
142
+ correlation_id = http_request.headers.get('x-ms-correlation-request-id')
143
+ if not correlation_id:
144
+ correlation_id = str(uuid.uuid4())
145
+ http_request.headers['x-ms-correlation-request-id'] = correlation_id
146
+ headers.append('x-ms-correlation-request-id={}'.format(correlation_id))
147
+
138
148
  acquire_policy_token_response = send_raw_request(cli_ctx, 'POST',
139
149
  ACQUIRE_POLICY_TOKEN_URL,
140
- headers=['Content-Type=application/json',
141
- 'x-ms-force-sync=true'],
150
+ headers=headers,
142
151
  body=json.dumps(acquire_policy_token_body))
143
152
  if acquire_policy_token_response.status_code == 200 and acquire_policy_token_response.content:
144
153
  response_content = json.loads(acquire_policy_token_response.content)
@@ -1041,21 +1041,13 @@ def send_raw_request(cli_ctx, method, url, headers=None, uri_parameters=None, #
1041
1041
  if not skip_authorization_header and url.lower().startswith('https://'):
1042
1042
  # Prepare `resource` for `get_raw_token`
1043
1043
  if not resource:
1044
- # If url starts with ARM endpoint, like `https://management.azure.com/`,
1044
+ # If url's origin matches the ARM endpoint, like `https://management.azure.com/`,
1045
1045
  # use `active_directory_resource_id` for resource, like `https://management.core.windows.net/`.
1046
1046
  # This follows the same behavior as `azure.cli.core.commands.client_factory._get_mgmt_service_client`
1047
- if url.lower().startswith(endpoints.resource_manager.rstrip('/')):
1047
+ if is_same_origin(url, endpoints.resource_manager):
1048
1048
  resource = endpoints.active_directory_resource_id
1049
1049
  else:
1050
- from azure.cli.core.cloud import CloudEndpointNotSetException
1051
- for p in [x for x in dir(endpoints) if not x.startswith('_')]:
1052
- try:
1053
- value = getattr(endpoints, p)
1054
- except CloudEndpointNotSetException:
1055
- continue
1056
- if isinstance(value, str) and url.lower().startswith(value.lower()):
1057
- resource = value
1058
- break
1050
+ resource = match_cloud_endpoint(url, cli_ctx)
1059
1051
  if resource:
1060
1052
  # Prepare `subscription` for `get_raw_token`
1061
1053
  # If this is an ARM request, try to extract subscription ID from the URL.
@@ -1063,7 +1055,7 @@ def send_raw_request(cli_ctx, method, url, headers=None, uri_parameters=None, #
1063
1055
  # TODO: In the future when multi-tenant subscription is supported, we won't be able to uniquely identify
1064
1056
  # the token from subscription anymore.
1065
1057
  token_subscription = None
1066
- if url.lower().startswith(endpoints.resource_manager.rstrip('/')):
1058
+ if is_same_origin(url, endpoints.resource_manager):
1067
1059
  token_subscription = _extract_subscription_id(url)
1068
1060
  if token_subscription:
1069
1061
  logger.debug('Retrieving token for resource %s, subscription %s', resource, token_subscription)
@@ -1210,6 +1202,92 @@ def urlretrieve(url):
1210
1202
  return req.read()
1211
1203
 
1212
1204
 
1205
+ def is_same_origin(url, endpoint):
1206
+ """Check whether ``url`` and ``endpoint`` share the same origin (scheme + host + port).
1207
+
1208
+ This performs an exact origin comparison rather than substring or prefix matching, so a
1209
+ malicious host such as ``https://management.azure.com.attacker`` is not mistaken for
1210
+ the trusted endpoint ``https://management.azure.com``. It is intended for validating that a
1211
+ URL points to a trusted endpoint before sensitive data (e.g., an Azure access token) is sent
1212
+ to it.
1213
+
1214
+ :param url: The URL to validate, e.g., ``https://management.azure.com/subscriptions/...``.
1215
+ :param endpoint: The trusted endpoint to validate against, e.g., ``https://management.azure.com/``.
1216
+ :return: ``True`` if both share the same origin, otherwise ``False``.
1217
+ :rtype: bool
1218
+ """
1219
+ from urllib.parse import urlparse
1220
+
1221
+ if not isinstance(url, str) or not isinstance(endpoint, str):
1222
+ return False
1223
+
1224
+ try:
1225
+ url_parts = urlparse(url)
1226
+ endpoint_parts = urlparse(endpoint)
1227
+
1228
+ except (TypeError, ValueError):
1229
+ return False
1230
+
1231
+ # Require a real host on both sides to avoid false positives against non-URL endpoint values.
1232
+ # `hostname` (rather than `netloc`) is used so that userinfo tricks like
1233
+ # `https://management.azure.com@attacker` resolve to the actual host `attacker`.
1234
+ if not url_parts.hostname or not endpoint_parts.hostname:
1235
+ return False
1236
+
1237
+ def _effective_port(parts):
1238
+ # Treat a missing port as the scheme's default port so that, e.g.,
1239
+ # `https://management.azure.com:443/` and `https://management.azure.com/` are equivalent.
1240
+ if parts.port is not None:
1241
+ return parts.port
1242
+
1243
+ return {'http': 80, 'https': 443}.get(parts.scheme.lower())
1244
+
1245
+ try:
1246
+ if _effective_port(url_parts) != _effective_port(endpoint_parts):
1247
+ return False
1248
+
1249
+ except ValueError:
1250
+ return False
1251
+
1252
+ return (url_parts.scheme.lower() == endpoint_parts.scheme.lower() and
1253
+ url_parts.hostname.lower() == endpoint_parts.hostname.lower())
1254
+
1255
+
1256
+ def match_cloud_endpoint(url, cli_ctx):
1257
+ """Return the active cloud endpoint that shares the same origin as ``url``.
1258
+
1259
+ :param url: The URL to match, e.g., ``https://management.azure.com/subscriptions/...``.
1260
+ :param cli_ctx: The CLI context whose active cloud's endpoints are treated as trusted.
1261
+ :return: The matching endpoint value, or ``None`` if no endpoint shares ``url``'s origin.
1262
+ :rtype: str or None
1263
+ """
1264
+ from azure.cli.core.cloud import CloudEndpointNotSetException
1265
+
1266
+ endpoints = cli_ctx.cloud.endpoints
1267
+ for p in [x for x in dir(endpoints) if not x.startswith('_')]:
1268
+ try:
1269
+ value = getattr(endpoints, p)
1270
+
1271
+ except CloudEndpointNotSetException:
1272
+ continue
1273
+
1274
+ if isinstance(value, str) and is_same_origin(url, value):
1275
+ return value
1276
+
1277
+ return None
1278
+
1279
+
1280
+ def is_trusted_cloud_endpoint(url, cli_ctx):
1281
+ """Check whether ``url`` shares the same origin as any endpoint of the active cloud.
1282
+
1283
+ :param url: The URL to validate, e.g., ``https://management.azure.com/subscriptions/...``.
1284
+ :param cli_ctx: The CLI context whose active cloud's endpoints are treated as trusted.
1285
+ :return: ``True`` if ``url`` shares the same origin as any cloud endpoint, otherwise ``False``.
1286
+ :rtype: bool
1287
+ """
1288
+ return match_cloud_endpoint(url, cli_ctx) is not None
1289
+
1290
+
1213
1291
  def parse_proxy_resource_id(rid):
1214
1292
  """Parses a resource_id into its various parts.
1215
1293
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: azure-cli-core
3
- Version: 2.87.0
3
+ Version: 2.89.0
4
4
  Summary: Microsoft Azure Command-Line Tools Core Module
5
5
  Home-page: https://github.com/Azure/azure-cli
6
6
  Author: Microsoft Corporation
@@ -15,6 +15,7 @@ Classifier: Programming Language :: Python :: 3.10
15
15
  Classifier: Programming Language :: Python :: 3.11
16
16
  Classifier: Programming Language :: Python :: 3.12
17
17
  Classifier: Programming Language :: Python :: 3.13
18
+ Classifier: Programming Language :: Python :: 3.14
18
19
  Classifier: License :: OSI Approved :: MIT License
19
20
  Requires-Python: >=3.10.0
20
21
  License-File: LICENSE.txt
@@ -32,7 +33,7 @@ Requires-Dist: msal-extensions==1.3.1
32
33
  Requires-Dist: msal[broker]==1.36.0; sys_platform == "win32"
33
34
  Requires-Dist: msal==1.36.0; sys_platform != "win32"
34
35
  Requires-Dist: packaging>=20.9
35
- Requires-Dist: pkginfo>=1.5.0.1
36
+ Requires-Dist: pkginfo>=1.12.0
36
37
  Requires-Dist: psutil>=5.9; sys_platform != "cygwin"
37
38
  Requires-Dist: PyJWT>=2.1.0
38
39
  Requires-Dist: pyopenssl>=17.1.0
@@ -9,7 +9,7 @@ knack~=0.14.0
9
9
  microsoft-security-utilities-secret-masker~=1.0.0b4
10
10
  msal-extensions==1.3.1
11
11
  packaging>=20.9
12
- pkginfo>=1.5.0.1
12
+ pkginfo>=1.12.0
13
13
  PyJWT>=2.1.0
14
14
  pyopenssl>=17.1.0
15
15
  py-deviceid
@@ -8,7 +8,7 @@
8
8
  from codecs import open
9
9
  from setuptools import setup, find_packages
10
10
 
11
- VERSION = "2.87.0"
11
+ VERSION = "2.89.0"
12
12
 
13
13
  # If we have source, validate that our version numbers match
14
14
  # This should prevent uploading releases with mismatched versions.
@@ -39,6 +39,7 @@ CLASSIFIERS = [
39
39
  'Programming Language :: Python :: 3.11',
40
40
  'Programming Language :: Python :: 3.12',
41
41
  'Programming Language :: Python :: 3.13',
42
+ 'Programming Language :: Python :: 3.14',
42
43
  'License :: OSI Approved :: MIT License',
43
44
  ]
44
45
 
@@ -58,7 +59,10 @@ DEPENDENCIES = [
58
59
  'msal[broker]==1.36.0; sys_platform == "win32"',
59
60
  'msal==1.36.0; sys_platform != "win32"',
60
61
  'packaging>=20.9',
61
- 'pkginfo>=1.5.0.1',
62
+ # pkginfo>=1.12.0 reads the spec-defined wheel METADATA / unpacked .dist-info
63
+ # layout produced by modern wheel/setuptools (no metadata.json). Required so
64
+ # WheelExtension.get_metadata works without the legacy wheel==0.30.0 artifact.
65
+ 'pkginfo>=1.12.0',
62
66
  # psutil can't install on cygwin: https://github.com/Azure/azure-cli/issues/9399
63
67
  'psutil>=5.9; sys_platform != "cygwin"',
64
68
  'PyJWT>=2.1.0',