This article will explain the syntax and usage of the az login –identity command.
Az login –identity
This command can sign in with a managed identity using Azure CLI.
Syntax of az login –identity
Below is the syntax of the az login –identity Azure CLI command.
az login --identityaz login --identity --username <client_id|object_id|resource_id>Az login –identity Examples
Let us discuss an example of how to use the AZ login –identity command.
You can execute the below Azure CLI command to sign in with a managed identity
az login --identityAfter executing the above command, I got the expected output as below
{
"environmentName": "AzureCloud",
"homeTenantId": "5d9d690a-0310-474d-ae8b-42df2d549228",
"id": "1cdf4300-dee5-4518-9c9c-fexx72a5cbd1",
"isDefault": true,
"managedByTenants": [],
"name": "Visual Studio Enterprise",
"state": "Enabled",
"tenantId": "5d9d690a-0310-474e-ae8b-42df2d549228",
"user": {
"cloudShellID": true,
"name": "live.com#fewlines4biju@hotmail.com",
"type": "user"
}
}You can check out the same output in the screenshot below.

You may also like following the articles below.
Conclusion
This article discussed the syntax and usage of the az login –identity Azure CLI command with an example of how to use az login –identity. Thanks for reading this article !!!

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.
