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.

Azure Advisor vs Azure Monitor
Direct Connect Pricing
Subscribe To Our YouTube Channel Subscribe to AzureLessons YouTube Channel

Recent Posts

  • Azure Function TypeScript
  • Azure DevOps Pricing
  • Why is Azure So Expensive? The Areas You Are Neglecting and Their Solutions
  • Azure Active Directory Basic for Education
  • Azure Stack Edge
  • About Us
  • Contact Us
  • Privacy Policy
  • Sitemap
© 2026 Azure Lessons
Azure
Virtual
Machine
By: Rajkishore
Azure Consultant
PDF

Free 25+ page PDF

Download free Azure Virtual Machine PDF

Download our free 25+ page Azure Virtual Machine guide and master cloud deployment today!

No spam, ever. You will also get new Azure tutorials by email. Unsubscribe any time. Privacy policy

Check your inbox

Your Azure Virtual Machine PDF is on its way to . Can't find it in a few minutes? Look in your Promotions or Spam folder.