-
Notifications
You must be signed in to change notification settings - Fork 3.2k
{Packaging} Add warning message for Azure Linux 2.0 #31545
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
️✔️AzureCLI-FullTest
|
Hi @jiasli, |
️✔️AzureCLI-BreakingChangeTest
|
Thank you for your contribution! We will review the pull request and get back to you soon. |
The git hooks are available for azure-cli and azure-cli-extensions repos. They could help you run required checks before creating the PR. Please sync the latest code with latest dev branch (for azure-cli) or main branch (for azure-cli-extensions). pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Adds a deprecation warning for Azure Linux 2.0 users and a toggle via environment variable
- Introduces a new constant
AZURELINUX2_WARNING_MESSAGE
with migration guidance - Imports
os
and checksAZURE_CLI_DISABLE_AZURELINUX2_WARNING
to conditionally log the warning - Emits the warning on every CLI run when not disabled
Comments suppressed due to low confidence (1)
src/azure-cli/azure/cli/main.py:125
- The warning is logged unconditionally on every platform; add a check to detect Azure Linux 2.0 (e.g., via /etc/os-release or platform library) so it only appears for that OS.
if 'AZURE_CLI_DISABLE_AZURELINUX2_WARNING' not in os.environ:
src/azure-cli/azure/cli/__main__.py
Outdated
AZURELINUX2_WARNING_MESSAGE = ( | ||
"Azure CLI 2.74.0 is the last version available on Azure Linux (Mariner) 2.0 and will not receive updates. " | ||
"Consider migrating to Azure Linux 3.0 to use newer versions of Azure CLI. " | ||
"To disable this warning message, set AZURE_CLI_DISABLE_AZURELINUX2_WARNING environment variable to any value." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#29628 has a sentence:
For more information: https://go.microsoft.com/fwlink/?linkid=2282203
But there is no public document for Azure Linux 2.0's EOL. https://github.com/microsoft/azurelinux doesn't mention this. There is only an internal document: https://eng.ms/docs/products/azure-linux/overview/20eol. microsoft/azurelinux#13555 was raised for this issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Azure Linux confirmed there will be no public announcement for Azure Linux 2.0's EOL.
if 'AZURE_CLI_DISABLE_AZURELINUX2_WARNING' not in os.environ: | ||
logger.warning(AZURELINUX2_WARNING_MESSAGE) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The warning can also be disabled by az config set core.only_show_errors=true
, but as #29628 (comment) mentioned, this will disable other warning messages too.
Introducing an environment variable AZURE_CLI_DISABLE_AZURELINUX2_WARNING
will make it possible to disable only this warning message.
Adding a config option core.disable_azurelinux2_warning
is also possible but a little bit too heavy and formal, an requires official documentation. AZURE_CLI_DISABLE_AZURELINUX2_WARNING
is only a one-time feature and will not exist in the dev
branch of Azure CLI.
564ad75
to
048f978
Compare
048f978
to
9250779
Compare
Verified this PR in
And in
|
Description
According to microsoft/azurelinux#13555, Azure Linux 2.0 will reach its End of Life (EOL) on July 2025.
Azure CLI 2.74.0 (release date: 2025-06-03) will be the last version that supports Azure Linux 2.0. Azure CLI 2.75.0 (release date: 2025-07-01) will not be released for Azure Linux 2.0.
Similar to #29628, this PR displays a warning message solely for Azure Linux 2.0 RPMs:
Note
This PR will not be merged into
dev
branch. Instead, after 2.74.0 is released, a separate branchrelease-2.74-azurelinux2
will be created and this PR will be merged into it. Then a separate release pipeline will be triggered specifically for Azure Linux 2.0.Azure Linux 2.0 support will be fully dropped by #31533
Testing Guide