Azure / Azure/azure-cli

`az repos` take 100+ seconds to run

Open
#17,490 9 comments 1 reaction 0 assignees View on GitHub
act-platform-engineering-squad DevOps Service Attention
Dominant language
Python
Stars
4.6k
Forks
3.5k
Avg merge
3d 2h
Merged PRs (30d)
60

Description

Hi,

I am running some az-cli commands that are taking forever to complete.
My python script logs the user in ADO by: cat ~/.ssh/ado.pat | az devops login;

Following are the commands that are a part of my script and get called multiple times in a loop:
**az repos list --org https://dev.azure.com/my-org/ --project my_project --query ‘[\*].name’;
az repos show --org https://dev.azure.com/my-org/ --project my_project --repository my_repo–query ‘sshUrl’;
az repos ref list --org https://dev.azure.com/my-org/ --project my_project --repository my_repo–query ‘[*].{Name: name, ObjectId: objectId}’ --filter heads/**

These commands have variable execution times when I timed my script:
Mostly, these take 1 - 1.5 seconds each as expected.
But randomly, all 3 commands also take 100+ seconds each causing the total run time to go through the roof.
Is this a known problem and can someone help debug this? I am not able to figure out what is causing this issue.

This is on CentOS 7 machines
% az --version
azure-cli 2.18.0 *

core 2.18.0 *
telemetry 1.0.6

Extensions:
azure-devops 0.18.0

_Originally posted by @PushkarVaity in https://github.com/Azure/azure-cli/issues/7447#issuecomment-793964195_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.