Skip to content
Azure Lessons
Azure Lessons
  • Home
  • AWS
  • Azure
    • Azure Virtual Machine
    • Azure Active Directory
    • Azure CLI
    • Azure CLI Commands List
    • Azure Cognitive Services
    • Azure Cosmos DB
    • Azure DevOps
    • Azure Functions
    • Azure PowerShell Commands
    • Azure Sentinel
    • Azure SQL
    • Azure Storage
    • Azure Synapse
  • Blogs
  • FREE EBOOK

Az account get-access-token

January 30, 2024 by Rajkishore

In this article, let us learn to get an access token quickly using the az account get-access-token Azure CLI command.

Table of Contents

  • Az account get-access-token
    • Syntax
    • Examples
      • Example-1:
      • Example-2:
  • Wrapping Up

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-token
az 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-token

After executing the above command, I got the below output.

Az account get-access-token

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-graph

After executing the above command, I got the below output as expected.

az account get-access-token --resource

You may also like following the articles below.

  • az account set subscription
  • az account show

Wrapping Up

This article discussed how to get an access token quickly using the az account get-access-token Azure CLI command.

Microsoft Azure
Rajkishore

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.

Which task can you perform by using Azure Advisor
Direct Connect Pricing
Subscribe To Our YouTube Channel Subscribe to AzureLessons YouTube Channel

Recent Posts

  • How to Set Default Subscription in Azure CLI (Step-by-Step)
  • How to Update Azure Functions Core Tools (Step-by-Step)
  • Func Command Not Found Azure Functions Core Tools
  • How to Fix az login Not Working
  • Where Does az login Store Credentials
  • About Us
  • Contact Us
  • Privacy Policy
  • Sitemap
© 2026 Azure Lessons