Skip to content

cannot use azure-cli #31428

@yiqimicrosoft

Description

@yiqimicrosoft

Describe the bug

when I use az login --scope https://graph.microsoft.com//.default command in my linux terminal, I cannot login this website successfully.

They give me the back info is 'yiqiwang@microsoft.com
Sorry, a security policy is preventing access
An organization security policy requiring token protection is preventing this application from accessing the resource. You may be able to use a different application.'

what should I do for this?

Related command

az login --scope https://graph.microsoft.com//.default

az ad signed-in-user show --query id -o tsv also does not work.

the feedback is shown as follow:

yiqi@DESKTOP-EMKPP5S:~$ az ad signed-in-user show --query id -o tsv
AADSTS530084: Access has been blocked by conditional access token protection policy configured by this orgnization. To learn more, see https://aka.ms/TBCADocs. Trace ID: 687dcce5-c2d5-4ec0-999a-f8a0f4e21200 Correlation ID: 4adc6ab0-3934-46a6-9658-89b9181a6e3f Timestamp: 2025-05-08 06:39:23Z
Interactive authentication is needed. Please run:
az login --scope https://graph.microsoft.com//.default

Errors

yiqi@DESKTOP-EMKPP5S:~$ az ad signed-in-user show --query id -o tsv
AADSTS530084: Access has been blocked by conditional access token protection policy configured by this orgnization. To learn more, see https://aka.ms/TBCADocs. Trace ID: 687dcce5-c2d5-4ec0-999a-f8a0f4e21200 Correlation ID: 4adc6ab0-3934-46a6-9658-89b9181a6e3f Timestamp: 2025-05-08 06:39:23Z
Interactive authentication is needed. Please run:
az login --scope https://graph.microsoft.com//.default

Issue script & Debug output

yiqi@DESKTOP-EMKPP5S:~$ az ad signed-in-user show --query id -o tsv
AADSTS530084: Access has been blocked by conditional access token protection policy configured by this orgnization. To learn more, see https://aka.ms/TBCADocs. Trace ID: 687dcce5-c2d5-4ec0-999a-f8a0f4e21200 Correlation ID: 4adc6ab0-3934-46a6-9658-89b9181a6e3f Timestamp: 2025-05-08 06:39:23Z
Interactive authentication is needed. Please run:
az login --scope https://graph.microsoft.com//.default

Expected behavior

when I use ' az ad signed-in-user show --query id -o tsv'
there should be shown my Object ID

Environment Summary

azure-cli 2.72.0

core 2.72.0
telemetry 1.1.0

Dependencies:
msal 1.32.3
azure-mgmt-resource 23.1.1

Python location '/opt/az/bin/python3'
Config directory '/home/yiqi/.azure'
Extensions directory '/home/yiqi/.azure/cliextensions'

Python (Linux) 3.12.8 (main, Apr 28 2025, 09:24:33) [GCC 13.3.0]

Legal docs and information: aka.ms/AzureCliLegal

Your CLI is up-to-date.

Additional context

No response

Metadata

Metadata

Assignees

Labels

Accountaz login/accountAuto-AssignAuto assign by botAzure CLI TeamThe command of the issue is owned by Azure CLI teamGraph(doesn't work with label-triggered comments; use Graph.Microsoft instead) az adcustomer-reportedIssues that are reported by GitHub users external to the Azure organization.questionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions