Skip to content

azure-cli-2.51.0.msi upgrade from previous version 2.50.0 no longer non-interactive. #27053

@aluty

Description

@aluty

Describe the bug

  1. Package name change.

BEFORE:
PS> Get-Package -ProviderName msi -Name 'Microsoft Azure CLI'

AFTER:
Get-Package -ProviderName msi -Name 'Microsoft Azure CLI (32-bit)'

Name Version Source ProviderName


Microsoft Azure CLI 2.50.0 msi
Microsoft Azure CLI (32-bit) 2.51.0 msi

  1. Upgrade from previous version 2.50.0 no longer non-interactive.
    CMD> az upgrade --all --yes

Related command

az upgrade --all --yes

Errors

No error, just change in update behavior.

Issue script & Debug output

<#
.SYNOPSIS
Installs Azure CLI (Command Line Interface).
.NOTES
How to install the Azure CLI
& Start-Process https://learn.microsoft.com/en-us/cli/azure/install-azure-cli
#>

Import-Module -Name PackageManagement -ErrorAction Stop

$az = "${env:ProgramFiles(x86)}\Microsoft SDKs\Azure\CLI2\wbin\az.cmd"
$msiFile = "${env:USERPROFILE}\Downloads\AzureCLI.msi"
if (-not (Test-Path -Path $az -PathType Leaf))
{
# Write-Warning -Message "Install Azure CLI?" -WarningAction Inquire
Invoke-WebRequest -Uri 'https://aka.ms/installazurecliwindows' -OutFile $msiFile -Verbose
Install-Package -ProviderName msi -Name $msiFile -Verbose
}
Get-Package -ProviderName msi -Name 'Microsoft Azure CLI' -Verbose | Format-Table -AutoSize

$azDevopsInstalled = & $az extension list --query "[? name == 'azure-devops']" | ConvertFrom-Json | Select-Object -First 1
if (-not $azDevopsInstalled)
{
# Add the Azure DevOps extension
& $az extension add --name azure-devops
}

NOTE: Avoid stop on error due to stderr: This command is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus

$ErrorActionPreferenceBackup = $ErrorActionPreference
try
{
$ErrorActionPreference = [System.Management.Automation.ActionPreference]::SilentlyContinue
& $az upgrade --all --yes
}
finally
{
$ErrorActionPreference = $ErrorActionPreferenceBackup
}

& $az version

Expected behavior

Silent upgrade from 2.50.0 to 2.51.0

az upgrade --all --yes

Environment Summary

CMD> az --version

azure-cli                         2.51.0

core                              2.51.0
telemetry                          1.1.0

Extensions:
azure-devops                      0.26.0

Dependencies:
msal                            1.24.0b1
azure-mgmt-resource             23.1.0b2

Python location 'C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\python.exe'
Extensions directory 'C:\Users\Administrator\.azure\cliextensions'

Python (Windows) 3.10.10 (tags/v3.10.10:aad5f6a, Feb  7 2023, 17:05:00) [MSC v.1929 32 bit (Intel)]

Legal docs and information: aka.ms/AzureCliLegal

Your CLI is up-to-date.

Additional context

No response

Metadata

Metadata

Assignees

Labels

Auto-AssignAuto assign by botAzure CLI TeamThe command of the issue is owned by Azure CLI teamInstallationOKR CandidateThis label is used to track how many GitHub issues we have resolved for OKR purpose.Upgradeaz upgradefeature-request

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions