-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Facing issue connecting azure using service principle over Azure CLI while works with Powershell #31980
Copy link
Copy link
Closed
Labels
ARMaz resource/group/lock/tag/deployment/policy/managementapp/account management-groupaz resource/group/lock/tag/deployment/policy/managementapp/account management-groupAccountaz login/accountaz login/accountAuto-AssignAuto assign by botAuto assign by botAzure CLI TeamThe command of the issue is owned by Azure CLI teamThe command of the issue is owned by Azure CLI teamManaged IdentityFor `az identity` onlyFor `az identity` onlyOKR CandidateThis label is used to track how many GitHub issues we have resolved for OKR purpose.This label is used to track how many GitHub issues we have resolved for OKR purpose.Possible-SolutionSimilar-Issuecustomer-reportedIssues that are reported by GitHub users external to the Azure organization.Issues that are reported by GitHub users external to the Azure organization.needs-author-feedbackMore information is needed from author to address the issue.More information is needed from author to address the issue.no-recent-activityThere has been no recent activity on this issue.There has been no recent activity on this issue.questionThe issue doesn't require a change to the product in order to be resolved. Most issues start as thatThe issue doesn't require a change to the product in order to be resolved. Most issues start as that
Metadata
Metadata
Assignees
Labels
ARMaz resource/group/lock/tag/deployment/policy/managementapp/account management-groupaz resource/group/lock/tag/deployment/policy/managementapp/account management-groupAccountaz login/accountaz login/accountAuto-AssignAuto assign by botAuto assign by botAzure CLI TeamThe command of the issue is owned by Azure CLI teamThe command of the issue is owned by Azure CLI teamManaged IdentityFor `az identity` onlyFor `az identity` onlyOKR CandidateThis label is used to track how many GitHub issues we have resolved for OKR purpose.This label is used to track how many GitHub issues we have resolved for OKR purpose.Possible-SolutionSimilar-Issuecustomer-reportedIssues that are reported by GitHub users external to the Azure organization.Issues that are reported by GitHub users external to the Azure organization.needs-author-feedbackMore information is needed from author to address the issue.More information is needed from author to address the issue.no-recent-activityThere has been no recent activity on this issue.There has been no recent activity on this issue.questionThe issue doesn't require a change to the product in order to be resolved. Most issues start as thatThe issue doesn't require a change to the product in order to be resolved. Most issues start as that
Describe the bug
Facing issuing using it over Azure CLI
az login --service-principal -u <APP_ID> -p <CLIENT_SECRET> --tenant <TENANT_ID>
Works with Powershell
$credentials = Get-Credential
Connect-AzAccount -ServicePrincipal -Credential $credentials -Tenant
Related command
az login --service-principal -u <APP_ID> -p <CLIENT_SECRET> --tenant <TENANT_ID> by using the facing issue that app is not under subscription even everything in the right manner.
Errors
No subscription found for mentioned app
Issue script & Debug output
az account clear
az identity list
Expected behavior
should be worked but not
Environment Summary
azure-cli 2.76.0
core 2.76.0
telemetry 1.1.0
Dependencies:
msal 1.33.0b1
azure-mgmt-resource 23.3.0
Python location '/opt/az/bin/python3'
Config directory '/home/edgedevice/.azure'
Extensions directory '/home/edgedevice/.azure/cliextensions'
Python (Linux) 3.12.10 (main, Jul 29 2025, 09:26:29) [GCC 11.4.0]
Legal docs and information: aka.ms/AzureCliLegal
Your CLI is up-to-date.
Additional context
No response