Azure / Azure/azure-cli-extensions

Azure Firewall Extension Using deprecated pkg_resources in pip package SetupTools

Open
#9,403 1 comment 0 reactions 1 assignee Claimed by @necusjz View on GitHub
Auto-Assign Azure CLI Team customer-reported Network question
Dominant language
Python
Stars
454
Forks
1.7k
Avg merge
2d 19h
Merged PRs (30d)
64

Description

### Describe the bug

Whenever any az network firewall commands are run a warning is displayed about using a deprecated API

### Related command

az network firewall list -g $firewallRg

### Errors

.azure\cliextensions\azure-firewall\azext_firewall\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__)

### Issue script & Debug output

cli.knack.cli: Command arguments: ['network', 'firewall', 'list', '-g', 'My-Firewall-Rg', '--debug']
cli.knack.cli: __init__ debug log:
Enable color in terminal.
cli.knack.cli: Event: Cli.PreExecute []
cli.knack.cli: Event: CommandParser.OnGlobalArgumentsCreate [, , ]
cli.knack.cli: Event: CommandInvoker.OnPreCommandTableCreate []
cli.azure.cli.core: Modules found from index for 'network': ['azure.cli.command_modules.network', 'azure.cli.command_modules.privatedns', 'azext_firewall']
cli.azure.cli.core: Loading command modules:
cli.azure.cli.core: Name Load Time Groups Commands
cli.azure.cli.core: network 2.419 120 480
cli.azure.cli.core: privatedns 0.109 14 60
cli.azure.cli.core: Total (2) 2.528 134 540
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: azure-firewall 0.221 21 67 C:\Users\user\.azure\cliextensions\azure-firewall
cli.azure.cli.core: Total (1) 0.221 21 67
cli.azure.cli.core: Loaded 153 groups, 607 commands.
cli.azure.cli.core: Found a match in the command table.
cli.azure.cli.core: Raw command : network firewall list
cli.azure.cli.core: Command table: network firewall list
cli.knack.cli: Event: CommandInvoker.OnPreCommandTableTruncate []
cli.azure.cli.core.azlogging: metadata file logging enabled - writing logs to 'C:\Users\user\.azure\commands\2025-11-07.16-24-49.network_firewall_list.36744.log'.
az_command_data_logger: command args: network firewall list -g {} --debug
cli.knack.cli: Event: CommandInvoker.OnPreArgumentLoad [.add_subscription_parameter at 0x0000027B27F025C0>]
C:\Users\user\.azure\cliextensions\azure-firewall\azext_firewall\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 []

### Expected behavior

No warnings are shown

### Environment Summary

azure-cli 2.79.0

core 2.79.0
telemetry 1.1.0

Extensions:
account 0.2.5
azure-devops 1.0.2
azure-firewall 2.0.0
connectedmachine 2.0.0b2
scheduled-query 1.0.0b1
ssh 2.0.6

Dependencies:
msal 1.34.0b1
azure-mgmt-resource 23.3.0

Python location 'C:\Program Files\Microsoft SDKs\Azure\CLI2\python.exe'
Config directory 'C:\Users\user\.azure'
Extensions directory 'C:\Users\user\.azure\cliextensions'

Python (Windows) 3.13.9 (tags/v3.13.9:8183fa5, Oct 14 2025, 14:09:13) [MSC v.1944 64 bit (AMD64)]

Legal docs and information: aka.ms/AzureCliLegal

### Additional context

I'm aware of similar tickets with the same error for other extensions. It looks like it needs to be fixed in all extensions that use setuptools

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.