Skip to content

[AzureCLIV2] Replaces az --version with az version #19039

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

Closed
wants to merge 4 commits into from

Conversation

jessehouwing
Copy link
Contributor

@jessehouwing jessehouwing commented Sep 28, 2023

az version doesn't perform an update check and is faster.

Fixes: #19006

Task name: AzureCLI

Description: Replaces the call to az --version with az version.

Documentation changes required: N

Added unit tests: N

Attached related issue: #19006

Checklist:

  • Task version was bumped - please check instruction how to do it
  • Checked that applied changes work as expected

`az version` doesn't perform an update check and is faster.

Fixes: microsoft#19006
@v-mohithgc
Copy link
Contributor

Hi @jessehouwing , thanks for creating this PR, will take a look.

@jessehouwing jessehouwing changed the title Replaces az --version with az version [AzureCLIV2] Replaces az --version with az version Nov 4, 2023
@mindingdata
Copy link

Can I ask where this one is at currently? I can see the simple version check is incredibly slow, for example :

2024-04-19T00:13:37.4098274Z [command]C:\Windows\system32\cmd.exe /D /S /C ""C:\Program Files\Microsoft SDKs\Azure\CLI2\wbin\az.cmd" --version"
2024-04-19T00:14:13.2414888Z azure-cli                         2.59.0

Even if we were able to opt out of running the version check every single time, that would be incredibly helpful.

@jessehouwing
Copy link
Contributor Author

jessehouwing commented Apr 19, 2024 via email

@mindingdata
Copy link

Be sure to check out https://jessehouwing.net/recommendations-for-using-azure-cli-in-your-workflow/

I did :) how do you think I found this!

Unfortunately most of the other tips aren’t as applicable to my use case. Whereas because we use the az cli across a number of different (small) jobs, this particular issue kills us.

@jessehouwing
Copy link
Contributor Author

jessehouwing commented Apr 19, 2024

If you were able to set the useGlobalConfig: true that is the most likely thing to give you an enormous boost.

- task: AzureCLI@2
  inputs:
    useGlobalConfig: true

@margani
Copy link

margani commented Oct 10, 2024

Can we merge this PR?

@mindingdata
Copy link

@rvairavelu @manolerazvan @v-mohithgc You are marked as approvers on this and it's been a year.

When a pipeline is made up of many smaller Powershell tasks, this absolutely kills a pipeline. Adding 30 seconds to each step. This really needs to be merged.

@Deekshitha981
Copy link
Collaborator

Deekshitha981 commented Jan 3, 2025

Hi
We have tested this, but replacing with az version is throwing regression for pipelines using lower version of az cli. so we are trying to introduce a flag to overcome this issue. will provide the update asap.

@EshitaD
Copy link
Contributor

EshitaD commented Apr 22, 2025

Hi @jessehouwing, we have made the necessary code changes. Please find the PR below. I’ll let you know once the deployments are complete.
PR: #20986

@EshitaD EshitaD self-assigned this May 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[enhancement]: Remove az --version from AzureCLI
7 participants