Does the Azure CLI SDK use the Azure Rest API internally? And if so any further details on how these relate to each other internally would be great.
-
you cannot really do anything without talking to the api. so the question is pretty pointless ;) – 4c74356b41 Mar 15 '18 at 06:30
-
1This is off-topic, as it's really about documentation, and it's not a programming question. If you visit the CLI's github page, you can see every single API call being made. FYI any tool working against Azure is using the API (CLI, PowerShell, portal, etc). – David Makogon Mar 15 '18 at 08:15
2 Answers
Yes, you are right. Azure CLI uses Azure Rest APi.
If you use --debug
, you will find the API the command use. For example:
az vm list --debug
Yes, as Johan said, Azure Power Shell/CLI, SDK all call Azure Rest API. If you use debug mode, you could see the API. More information about Azure Rest API, you could check this link.

- 18,746
- 3
- 27
- 45
-
This should really be a comment - the question itself is off-topic. Also, this answer applies specifically to one version of the CLI. – David Makogon Mar 15 '18 at 08:15
-
2@DavidMakogon, why? I don't underestand your comment. I had the very same question, after landing here I learned about --debug option that is a big help for me. --debug applies to all recent version of Azure CLI. – Allan Xu Nov 01 '20 at 06:28
Each service in Azure exposes a set of APIs. For managing/creating/updating your resources (e.g. creating a Virtual Machine), these are REST calls. Note: Other services may use non-HTTP/REST APIs (e.g. AMQP for Azure Service Bus).
While you can use your favorite HTTP networking stack or utility (e.g. curl, postman etc.) to make HTTP/REST calls, Microsoft publishes a set of SDKs to make things easier to develop applicationsin various languages.
The Azure CLI happens to be implemented in python, and thus makes use of the Azure Python SDKs to get its work done.
There is no separate Azure CLI SDK, however.

- 51
- 3