Skip to content

blueprint: UserWarning: pkg_resources is deprecated as an API #9257

@kongou-ae

Description

@kongou-ae

Describe the bug

The following error raised when I use az blueprint like az blueprint list and az blueprint artifact delete .

root@proxy01:~# az blueprint list
/root/.azure/cliextensions/blueprint/azext_blueprint/vendored_sdks/__init__.py:6: UserWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools<81.
  __import__('pkg_resources').declare_namespace(__name__)
This command group has been deprecated and will be removed in next breaking change release(2.79.0) scheduled for Nov 2025.

Related command

I can find that the following command raised the same error.

  • az blueprint artifact delete
  • az blueprint list
  • az blueprint artifact list

Errors

root@proxy01:~# az blueprint list
/root/.azure/cliextensions/blueprint/azext_blueprint/vendored_sdks/__init__.py:6: UserWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools<81.
  __import__('pkg_resources').declare_namespace(__name__)
This command group has been deprecated and will be removed in next breaking change release(2.79.0) scheduled for Nov 2025.

Issue script & Debug output

root@proxy01:~# az blueprint list --debug
cli.knack.cli: Command arguments: ['blueprint', 'list', '--debug']
cli.knack.cli: __init__ debug log:
Enable color in terminal.
cli.knack.cli: Event: Cli.PreExecute []
cli.knack.cli: Event: CommandParser.OnGlobalArgumentsCreate [<function CLILogging.on_global_arguments at 0x7f902762cfe0>, <function OutputProducer.on_global_arguments at 0x7f90273a8cc0>, <function CLIQuery.on_global_arguments at 0x7f90273d2de0>]
cli.knack.cli: Event: CommandInvoker.OnPreCommandTableCreate []
cli.azure.cli.core: Modules found from index for 'blueprint': ['azext_blueprint']
cli.azure.cli.core: Loading command modules:
cli.azure.cli.core: Name                  Load Time    Groups  Commands
cli.azure.cli.core: Total (0)                 0.000         0         0
cli.azure.cli.core: These extensions are not installed and will be skipped: ['azext_ai_examples', 'azext_next']
cli.azure.cli.core: Loading extensions:
cli.azure.cli.core: Name                  Load Time    Groups  Commands  Directory
cli.azure.cli.core: blueprint                 0.103         9        34  /root/.azure/cliextensions/blueprint
cli.azure.cli.core: Total (1)                 0.103         9        34
cli.azure.cli.core: Loaded 9 groups, 34 commands.
cli.azure.cli.core: Found a match in the command table.
cli.azure.cli.core: Raw command  : blueprint list
cli.azure.cli.core: Command table: blueprint list
cli.knack.cli: Event: CommandInvoker.OnPreCommandTableTruncate [<function AzCliLogging.init_command_file_logging at 0x7f90266322a0>]
cli.azure.cli.core.azlogging: metadata file logging enabled - writing logs to '/root/.azure/commands/2025-09-30.07-01-06.blueprint_list.40463.log'.
az_command_data_logger: command args: blueprint list --debug
cli.knack.cli: Event: CommandInvoker.OnPreArgumentLoad [<function register_global_subscription_argument.<locals>.add_subscription_parameter at 0x7f9026667560>]
/root/.azure/cliextensions/blueprint/azext_blueprint/vendored_sdks/__init__.py:6: UserWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools<81.
  __import__('pkg_resources').declare_namespace(__name__)
cli.knack.cli: Event: CommandInvoker.OnPostArgumentLoad []
cli.knack.cli: Event: CommandInvoker.OnPostCommandTableCreate [<function register_ids_argument.<locals>.add_ids_arguments at 0x7f90266918a0>, <function register_cache_arguments.<locals>.add_cache_arguments at 0x7f9026691a80>, <function register_upcoming_breaking_change_info.<locals>.update_breaking_change_info at 0x7f9026691b20>]
cli.knack.cli: Event: CommandInvoker.OnCommandTableLoaded []
cli.knack.cli: Event: CommandInvoker.OnPreParseArgs []
cli.knack.cli: Event: CommandInvoker.OnPostParseArgs [<function OutputProducer.handle_output_argument at 0x7f90273a8d60>, <function CLIQuery.handle_query_parameter at 0x7f90273d2e80>, <function register_ids_argument.<locals>.parse_ids_arguments at 0x7f9026691940>]
az_command_data_logger: extension name: blueprint
az_command_data_logger: extension version: 1.0.0b1
This command group has been deprecated and will be removed in next breaking change release(2.79.0) scheduled for Nov 2025.
Blueprints and associated commands will be deprecated
as early as July 2026. Customers are encouraged to transition to
Template Specs and Deployments Stacks to support their scenarios beyond that date.
Migration documentation is available at
https://learn.microsoft.com/en-us/azure/azure-resource-manager/bicep/migrate-blueprint.
This command is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus
cli.azure.cli.core.azclierror: Traceback (most recent call last):
  File "/opt/az/lib/python3.13/site-packages/knack/cli.py", line 233, in invoke
    cmd_result = self.invocation.execute(args)
  File "/opt/az/lib/python3.13/site-packages/azure/cli/core/commands/__init__.py", line 666, in execute
    raise ex
  File "/opt/az/lib/python3.13/site-packages/azure/cli/core/commands/__init__.py", line 734, in _run_jobs_serially
    results.append(self._run_job(expanded_arg, cmd_copy))
                   ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/az/lib/python3.13/site-packages/azure/cli/core/commands/__init__.py", line 716, in _run_job
    result = list(result)
  File "/opt/az/lib/python3.13/site-packages/azure/cli/core/aaz/_paging.py", line 87, in __next__
    return next(self._page_iterator)
  File "/opt/az/lib/python3.13/site-packages/azure/cli/core/aaz/_paging.py", line 43, in __next__
    self._executor(self._next_link)
    ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
  File "/opt/az/lib/python3.13/site-packages/azure/cli/core/aaz/_command.py", line 250, in executor_wrapper
    executor()
    ~~~~~~~~^^
  File "/root/.azure/cliextensions/blueprint/azext_blueprint/aaz/latest/blueprint/_list.py", line 60, in _execute_operations
    self.pre_operations()
    ~~~~~~~~~~~~~~~~~~~^^
  File "/root/.azure/cliextensions/blueprint/azext_blueprint/custom.py", line 218, in pre_operations
    _blueprint_validator(self)
    ~~~~~~~~~~~~~~~~~~~~^^^^^^
  File "/root/.azure/cliextensions/blueprint/azext_blueprint/custom.py", line 103, in _blueprint_validator
    args.resource_scope = '/subscriptions/{}'.format(get_subscription_id(cmd.cli_ctx))
                                                     ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
  File "/opt/az/lib/python3.13/site-packages/azure/cli/core/commands/client_factory.py", line 294, in get_subscription_id
    cli_ctx.data['subscription_id'] = Profile(cli_ctx=cli_ctx).get_subscription_id()
                                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/opt/az/lib/python3.13/site-packages/azure/cli/core/_profile.py", line 575, in get_subscription_id
    return self.get_subscription(subscription)[_SUBSCRIPTION_ID]
           ~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^
  File "/opt/az/lib/python3.13/site-packages/azure/cli/core/_profile.py", line 558, in get_subscription
    raise CLIError(_AZ_LOGIN_MESSAGE)
knack.util.CLIError: Please run 'az login' to setup account.

cli.azure.cli.core.azclierror: Please run 'az login' to setup account.
az_command_data_logger: Please run 'az login' to setup account.
cli.knack.cli: Event: Cli.PostExecute [<function AzCliLogging.deinit_cmd_metadata_logging at 0x7f9026632520>]
az_command_data_logger: exit code: 1
cli.__main__: Command ran in 0.282 seconds (init: 0.094, invoke: 0.188)
telemetry.main: Begin splitting cli events and extra events, total events: 1
telemetry.client: Accumulated 0 events. Flush the clients.
telemetry.main: Finish splitting cli events and extra events, cli events: 1
telemetry.save: Save telemetry record of length 3792 in cache file under /root/.azure/telemetry/20250930070106708
telemetry.main: Begin creating telemetry upload process.
telemetry.process: Creating upload process: "/opt/az/bin/python3 /opt/az/lib/python3.13/site-packages/azure/cli/telemetry/__init__.py /root/.azure /root/.azure/telemetry/20250930070106708"
telemetry.process: Return from creating process 40469
telemetry.main: Finish creating telemetry upload process.
root@proxy01:~#

Expected behavior

No warning should be raised. Customers will be confused by this message. Customer may misunderstand that they can't use az blueprint after Nov 2025, not July 2026.

Environment Summary

root@proxy01:~# az --version
azure-cli                         2.77.0

core                              2.77.0
telemetry                          1.1.0

Extensions:
azure-firewall                     1.3.0
bastion                            1.4.2
blueprint                        1.0.0b1

Dependencies:
msal                            1.34.0b1
azure-mgmt-resource               23.3.0

Python location '/opt/az/bin/python3'
Config directory '/root/.azure'
Extensions directory '/root/.azure/cliextensions'

Python (Linux) 3.13.7 (main, Aug 26 2025, 08:46:54) [GCC 11.4.0]

Legal docs and information: aka.ms/AzureCliLegal


Your CLI is up-to-date.

Additional context

No response

Metadata

Metadata

Assignees

Labels

Auto-AssignAuto assign by botBlueprintService AttentionThis issue is responsible by Azure service team.bugThis issue requires a change to an existing behavior in the product in order to be resolved.customer-reportedIssues that are reported by GitHub users external to the Azure organization.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions