The Azure Common Python module is a collection of utility functions to make it easier to work with Azure services.
This module is a dependency of many other Azure Python SDKs, including Azure Storage and Azure Data Lake.
To get started with the Azure Common Python module, you'll need to install it using pip, the Python package manager.
The module can be installed using the command pip install azure-common.
Installation and Setup
To install the azure-common library, you'll need to use pip or conda, depending on your environment. pip install azure-common is a simple command that works on Windows, Linux, and MacOS.
If you're using an older version of pip, you'll need to update it first. You can do this with two simple commands: pip install --upgrade pip and pip install --upgrade setuptools.
To find the correct version of a package, such as azure-storage-blob, you can check the package index on PyPI. Look for the Name column and find the functionality you need, then select the PyPI link in the Package column.
The version number for the desired package can be found in the Files tab on the Microsoft channel on anaconda.org. For example, to install a version of azure-storage, you can use conda install azure-storage=2023.09.01.
Release and History
The azure-common python module has a rich release history, with several notable updates that have improved its functionality.
One of the major updates was the deprecation of JSON and auth file client factory, which was done to improve the overall stability of the module.
The addition of 2020-09-01-hybrid profile definition was a significant improvement, allowing for more flexibility in how the module handles client profiles.
The azure-common module now supports Azure Stack, enabling users to utilize get_client_from_auth_file and get_client_from_json_dict.
The creation of KeyVaultClient has been fixed when using get_client_from_cli_profile.
The get_azure_cli_credentials function now has a new parameter called "with_tenant" to retrieve the default CLI tenant ID.
Here are some of the key updates in the azure-common module's release history:
- Deprecate JSON and auth file client factory #15075
- Add 2020-09-01-hybrid profile definition #14642
- Azure Stack support for get_client_from_auth_file and get_client_from_json_dict
- Fix KeyVaultClient creation with get_client_from_cli_profile
- get_azure_cli_credentials has a new parameter "with_tenant" to get default CLI tenant ID
- Add support for "resource" in "get_azure_cli_credentials"
- Adds azure.common.client_factory.get_client_from_auth_file
- Adds azure.common.client_factory.get_client_from_json_dict
- Adds azure.common.client_factory.get_client_from_cli_profile
Release History
In the release history of Azure CLI, you'll notice a few key updates that have improved its functionality.
Deprecation of the JSON and auth file client factory was done in #15075, marking a significant change in the way clients are created.
The addition of the 2020-09-01-hybrid profile definition in #14642 has expanded the options for users.
Azure Stack support was added for get_client_from_auth_file and get_client_from_json_dict, allowing for more flexibility in client creation.
Fixing the KeyVaultClient creation with get_client_from_cli_profile has resolved a long-standing issue.
The get_azure_cli_credentials function now has a new parameter "with_tenant" to get the default CLI tenant ID.
Support for "resource" was added to the get_azure_cli_credentials function, making it easier to obtain the required information.
Here are the key updates in the release history:
These updates have significantly improved the functionality and usability of Azure CLI, making it a more powerful tool for users.
1.1.25 (2020-03-09)
In this release, the get_client_from_cli_profile function no longer requires "azure-core" if not necessary.
This change was made in the 1.1.25 release, which occurred on March 9, 2020.
The get_client_from_cli_profile function has undergone some significant changes over the years, but this one is particularly notable for its impact on development efficiency.
Here's a brief summary of the changes made to the get_client_from_cli_profile function:
- get_client_from_cli_profile no longer requires "azure-core" if not necessary
This update can help simplify code and reduce dependencies, making it easier to work with the Azure library.
1.1.24 (2019-12-18)
In December 2019, a notable update was released, version 1.1.24.
This update occurred on December 18, 2019.
One key feature added in this update was support for get_client_from_cli_profile, which now works with KV 4.x, Storage 12.x, AppConfig, and all packages based on azure-core.
Here are the specific packages that gained support:
- KV 4.x
- Storage 12.x
- AppConfig
- All packages based on azure-core
1.1.15 (2018-09-13)
In the 1.1.15 release, dated 2018-09-13, two significant changes were made.
get_client_from_cli_profile now supports the "azure-graphrbac" package, which was a welcome addition for developers.
Similarly, get_client_from_auth_file also gained support for the "azure-graphrbac" package in this release.
The autorest "extra_requires" feature is now deprecated and should no longer be used.
This release saw the wheel package built with the azure wheel extension, a change that improved the overall build process.
Here are the specific changes made in this release:
- get_client_from_cli_profile now supports the "azure-graphrbac" package #2867
- get_client_from_auth_file now supports the "azure-graphrbac" package #2867
- "extra_requires" autorest is deprecated and should not be used anymore
- This wheel package is now built with the azure wheel extension
Sources
- https://azure.github.io/azure-sdk/releases/latest/all/python.html
- https://learn.microsoft.com/en-us/azure/developer/python/sdk/azure-sdk-install
- https://snyk.io/advisor/python/azure-common
- https://blog.finxter.com/fixed-modulenotfounderror-no-module-named-azure-common/
- https://learn.microsoft.com/en-us/python/api/overview/azure/ai-ml-readme
Featured Images: pexels.com