Skip to content

UserWarning: pkg_resources is deprecated as an API #31591

@MmAtBosch

Description

@MmAtBosch

Describe the bug

With the newest version of azure cli 2.74.0, our pipelines fail, as there is a warning printed to standard error:

Related command

az storage account show-connection-string --name "$saName" --resource-group "$saGroupName" -o tsv

Errors

/opt/az/lib/python3.12/site-packages/azure/multiapi/storagev2/fileshare/__init__.py:1: 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.

Issue script & Debug output

/opt/az/lib/python3.12/site-packages/azure/multiapi/storagev2/fileshare/init.py:1: 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)
##[debug]Agent environment resources - Disk: / Available 106948.53 MB out of 148675.55 MB, Memory: Used 2788.00 MB out of 15990.00 MB, CPU: Usage 28.51%
Storage connection string successfully retrieved, saving it to keyvault
##[debug]Agent environment resources - Disk: / Available 106948.32 MB out of 148675.55 MB, Memory: Used 2808.00 MB out of 15990.00 MB, CPU: Usage 4.72%

##[debug]Process exited with code 0 and signal null for tool '/usr/bin/bash'
##[debug]STDIO streams have closed and received exit code 0 and signal null for tool '/usr/bin/bash'
##[error]/opt/az/lib/python3.12/site-packages/azure/multiapi/storagev2/fileshare/init.py:1: 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)
##[debug]Processed: ##vso[task.issue type=error;source=CustomerScript;correlationId=xxx;]/opt/az/lib/python3.12/site-packages/azure/multiapi/storagev2/fileshare/init.py:1: 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)
##[debug]task result: Failed

Expected behavior

if a command works, there should be no output to stderr

Environment Summary

Azure CLI:
azure-cli: 2.74.0
azure-cli-core: 2.74.0
azure-cli-telemetry: 1.1.0
extensions:
azure-devops: 1.0.1
log-analytics: 1.0.0b1

Additional context

No response

Metadata

Metadata

Labels

Auto-AssignAuto assign by botAzure CLI TeamThe command of the issue is owned by Azure CLI teamStorageaz storagecustomer-reportedIssues that are reported by GitHub users external to the Azure organization.questionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions