Skip to content

{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

Merged
merged 1 commit into from
Jun 3, 2025

Conversation

jiasli
Copy link
Member

@jiasli jiasli commented May 23, 2025

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:

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.

Note

This PR will not be merged into dev branch. Instead, after 2.74.0 is released, a separate branch release-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

az version

# Disable the warning message
export AZURE_CLI_DISABLE_AZURELINUX2_WARNING=1
az version

@Copilot Copilot AI review requested due to automatic review settings May 23, 2025 08:25
Copy link

azure-client-tools-bot-prd bot commented May 23, 2025

️✔️AzureCLI-FullTest
️✔️acr
️✔️latest
️✔️3.12
️✔️3.9
️✔️acs
️✔️latest
️✔️3.12
️✔️3.9
️✔️advisor
️✔️latest
️✔️3.12
️✔️3.9
️✔️ams
️✔️latest
️✔️3.12
️✔️3.9
️✔️apim
️✔️latest
️✔️3.12
️✔️3.9
️✔️appconfig
️✔️latest
️✔️3.12
️✔️3.9
️✔️appservice
️✔️latest
️✔️3.12
️✔️3.9
️✔️aro
️✔️latest
️✔️3.12
️✔️3.9
️✔️backup
️✔️latest
️✔️3.12
️✔️3.9
️✔️batch
️✔️latest
️✔️3.12
️✔️3.9
️✔️batchai
️✔️latest
️✔️3.12
️✔️3.9
️✔️billing
️✔️latest
️✔️3.12
️✔️3.9
️✔️botservice
️✔️latest
️✔️3.12
️✔️3.9
️✔️cdn
️✔️latest
️✔️3.12
️✔️3.9
️✔️cloud
️✔️latest
️✔️3.12
️✔️3.9
️✔️cognitiveservices
️✔️latest
️✔️3.12
️✔️3.9
️✔️compute_recommender
️✔️latest
️✔️3.12
️✔️3.9
️✔️computefleet
️✔️latest
️✔️3.12
️✔️3.9
️✔️config
️✔️latest
️✔️3.12
️✔️3.9
️✔️configure
️✔️latest
️✔️3.12
️✔️3.9
️✔️consumption
️✔️latest
️✔️3.12
️✔️3.9
️✔️container
️✔️latest
️✔️3.12
️✔️3.9
️✔️containerapp
️✔️latest
️✔️3.12
️✔️3.9
️✔️core
️✔️latest
️✔️3.12
️✔️3.9
️✔️cosmosdb
️✔️latest
️✔️3.12
️✔️3.9
️✔️databoxedge
️✔️latest
️✔️3.12
️✔️3.9
️✔️dls
️✔️latest
️✔️3.12
️✔️3.9
️✔️dms
️✔️latest
️✔️3.12
️✔️3.9
️✔️eventgrid
️✔️latest
️✔️3.12
️✔️3.9
️✔️eventhubs
️✔️latest
️✔️3.12
️✔️3.9
️✔️feedback
️✔️latest
️✔️3.12
️✔️3.9
️✔️find
️✔️latest
️✔️3.12
️✔️3.9
️✔️hdinsight
️✔️latest
️✔️3.12
️✔️3.9
️✔️identity
️✔️latest
️✔️3.12
️✔️3.9
️✔️iot
️✔️latest
️✔️3.12
️✔️3.9
️✔️keyvault
️✔️latest
️✔️3.12
️✔️3.9
️✔️lab
️✔️latest
️✔️3.12
️✔️3.9
️✔️managedservices
️✔️latest
️✔️3.12
️✔️3.9
️✔️maps
️✔️latest
️✔️3.12
️✔️3.9
️✔️marketplaceordering
️✔️latest
️✔️3.12
️✔️3.9
️✔️monitor
️✔️latest
️✔️3.12
️✔️3.9
️✔️mysql
️✔️latest
️✔️3.12
️✔️3.9
️✔️netappfiles
️✔️latest
️✔️3.12
️✔️3.9
️✔️network
️✔️latest
️✔️3.12
️✔️3.9
️✔️policyinsights
️✔️latest
️✔️3.12
️✔️3.9
️✔️privatedns
️✔️latest
️✔️3.12
️✔️3.9
️✔️profile
️✔️latest
️✔️3.12
️✔️3.9
️✔️rdbms
️✔️latest
️✔️3.12
️✔️3.9
️✔️redis
️✔️latest
️✔️3.12
️✔️3.9
️✔️relay
️✔️latest
️✔️3.12
️✔️3.9
️✔️resource
️✔️latest
️✔️3.12
️✔️3.9
️✔️role
️✔️latest
️✔️3.12
️✔️3.9
️✔️search
️✔️latest
️✔️3.12
️✔️3.9
️✔️security
️✔️latest
️✔️3.12
️✔️3.9
️✔️servicebus
️✔️latest
️✔️3.12
️✔️3.9
️✔️serviceconnector
️✔️latest
️✔️3.12
️✔️3.9
️✔️servicefabric
️✔️latest
️✔️3.12
️✔️3.9
️✔️signalr
️✔️latest
️✔️3.12
️✔️3.9
️✔️sql
️✔️latest
️✔️3.12
️✔️3.9
️✔️sqlvm
️✔️latest
️✔️3.12
️✔️3.9
️✔️storage
️✔️latest
️✔️3.12
️✔️3.9
️✔️synapse
️✔️latest
️✔️3.12
️✔️3.9
️✔️telemetry
️✔️latest
️✔️3.12
️✔️3.9
️✔️util
️✔️latest
️✔️3.12
️✔️3.9
️✔️vm
️✔️latest
️✔️3.12
️✔️3.9

Copy link

Hi @jiasli,
Since the current milestone time is less than 7 days, this pr will be reviewed in the next milestone.

Copy link

azure-client-tools-bot-prd bot commented May 23, 2025

️✔️AzureCLI-BreakingChangeTest
️✔️Non Breaking Changes

@yonzhan
Copy link
Collaborator

yonzhan commented May 23, 2025

Thank you for your contribution! We will review the pull request and get back to you soon.

Copy link

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).
After that please run the following commands to enable git hooks:

pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>

Copy link

@Copilot Copilot AI left a 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 checks AZURE_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:

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."
Copy link
Member Author

@jiasli jiasli May 23, 2025

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.

Copy link
Member Author

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.

Comment on lines +125 to +127
if 'AZURE_CLI_DISABLE_AZURELINUX2_WARNING' not in os.environ:
logger.warning(AZURELINUX2_WARNING_MESSAGE)
Copy link
Member Author

@jiasli jiasli May 23, 2025

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.

bebound
bebound previously approved these changes May 26, 2025
@jiasli jiasli changed the base branch from dev to release-2.74-cm2 May 28, 2025 06:26
@jiasli jiasli force-pushed the azurelinux2-warning branch from 564ad75 to 048f978 Compare May 28, 2025 06:49
@jiasli jiasli force-pushed the azurelinux2-warning branch from 048f978 to 9250779 Compare June 3, 2025 03:41
@jiasli jiasli merged commit cf2257d into Azure:release-2.74-cm2 Jun 3, 2025
46 checks passed
@jiasli jiasli deleted the azurelinux2-warning branch June 3, 2025 07:23
@jiasli
Copy link
Member Author

jiasli commented Jun 3, 2025

Verified this PR in mcr.microsoft.com/azure-cli:2.74.0-cbl-mariner2.0 docker image (https://mcr.microsoft.com/en-us/artifact/mar/azure-cli/tags):

> docker run --rm -it mcr.microsoft.com/azure-cli:2.74.0-cbl-mariner2.0
# az version
# export AZURE_CLI_DISABLE_AZURELINUX2_WARNING=1
# az version

image

And in mcr.microsoft.com/cbl-mariner/base/core:2.0 docker image:

> docker run --rm -it mcr.microsoft.com/cbl-mariner/base/core:2.0
# tdnf install -y azure-cli
# az version
# export AZURE_CLI_DISABLE_AZURELINUX2_WARNING=1
# az version

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Auto-Assign Auto assign by bot Packaging
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants