Azure / Azure/azure-cli

az rest performance issues

Open
#17,944 1 comment 0 reactions 1 assignee Claimed by @jiasli View on GitHub
feature-request rest
Dominant language
Python
Stars
4.6k
Forks
3.5k
Avg merge
3d 2h
Merged PRs (30d)
60

Description

### **This is autogenerated. Please review and update as needed.**

## Describe the bug

**Command Name**
`az rest`

## To Reproduce:

```pwsh
PS>$ApplicationId = "1c062b7f-5422-441e-92a9-a9437f05b357"
PS>Measure-Command -Expression {az rest --method get --url "https://graph.microsoft.com/beta/applications/$ApplicationId"}

Days : 0
Hours : 0
Minutes : 0
Seconds : 1
Milliseconds : 186
Ticks : 11868773
TotalDays : 1.3737005787037E-05
TotalHours : 0.000329688138888889
TotalMinutes : 0.0197812883333333
TotalSeconds : 1.1868773
TotalMilliseconds : 1186.8773

PS>Measure-Command -Expression { (Invoke-RestMethod "https://graph.microsoft.com/beta/applications/$ApplicationId" -Headers $MSGraphAuthHeader).value}

Days : 0
Hours : 0
Minutes : 0
Seconds : 0
Milliseconds : 271
Ticks : 2715343
TotalDays : 3.14275810185185E-06
TotalHours : 7.54261944444444E-05
TotalMinutes : 0.00452557166666667
TotalSeconds : 0.2715343
TotalMilliseconds : 271.5343
```

## Expected Behavior

I expect the az rest command to perform similar to invoke-restmethod. I understand there should be a little bit of overhead for checking the authorization token before sending but almost a full second overhead is quite a bit.

## Environment Summary
```
Windows-10-10.0.19041-SP0
Python 3.6.8
Installer: MSI

azure-cli 2.20.0 *

Extensions:
azure-devops 0.18.0
interactive 0.4.4

```
## Additional Context

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.