In this article, let us learn to get an access token quickly using the az account get-access-token Azure CLI command.
Az account get-access-token
This command helps to get an access token quickly.
Syntax
Below is the syntax of the Az account get-access-token command.
Az account get-access-tokenaz account get-access-token [--tenant]az account get-access-token [--subscription]az account get-access-token [--resource-type {aad-graph, arm, batch, data-lake, media, ms-graph, oss-rdbms}]Examples
Let’s discuss a few examples of how to use the Az account get-access-token command.
Example-1:
You can execute the below command to get an access token quickly for the current account.
Az account get-access-tokenAfter executing the above command, I got the below output.

Example-2:
You can execute the below command to get an access token to use with the MS Graph API.
az account get-access-token --resource-type ms-graphAfter executing the above command, I got the below output as expected.

You may also like following the articles below.
Wrapping Up
This article discussed how to get an access token quickly using the az account get-access-token Azure CLI command.

I am Rajkishore, and I am a Microsoft Certified IT Consultant. I have over 14 years of experience in Microsoft Azure and AWS, with good experience in Azure Functions, Storage, Virtual Machines, Logic Apps, PowerShell Commands, CLI Commands, Machine Learning, AI, Azure Cognitive Services, DevOps, etc. Not only that, I do have good real-time experience in designing and developing cloud-native data integrations on Azure or AWS, etc. I hope you will learn from these practical Azure tutorials. Read more.
