`az ad group member list` does not list service principals
Related command az ad group member list
Describe the bug
az ad group member list does not list service principals.
To Reproduce
Run az ad group member list --group <group_name> on a group with members of type Service Principal.
Expected behavior Returns all members of the group, including Service Principals.
Additional context
{
"azure-cli": "2.37.0",
"azure-cli-core": "2.37.0",
"azure-cli-telemetry": "1.0.6",
"extensions": {
"account": "0.2.1",
"aks-preview": "0.5.10",
"application-insights": "0.1.13",
"datafactory": "0.5.0"
}
}
@jiasli for awareness
Please also see https://github.com/Azure/azure-cli/issues/16123#issuecomment-1060321911
According to List members API's documentation:
https://docs.microsoft.com/en-us/graph/api/group-list-members?view=graph-rest-1.0&tabs=http
Currently service principals are not listed as group members due to staged roll-out of service principals on Graph V1.0 endpoint.
This is a feature gap between AD Graph and Microsoft Graph.
As a workaround, you may use az rest to call beta API: https://docs.microsoft.com/en-us/graph/api/group-list-members?view=graph-rest-beta&tabs=http
Hi, we're sending this friendly reminder because we haven't heard back from you in a while. We need more information about this issue to help address it. Please be sure to give us your input within the next 7 days. If we don't hear back from you within 14 days of this comment the issue will be automatically closed. Thank you!
bump
We've discovered that if we log into azure cloud shell (azure-cli v2.48.1) as the service principal behind our Azure DevOps service connection, we can't use az cli to add, list, or check group members of a security group, even though our service principal owns the group. (Yields Insufficient privileges to complete the operation.)
We've also discovered that if we add a managed identity to said group manually, the managed identity isn't listed as a group member by az ad group list --group '...' (no matter who you run as)
#!/bin/bash
# running as the service principal behind an ADO service connection
principal="xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" # where $principal is a system managed identity from a linux web app
group="yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy" # where $group is an AAD security group with nobody in it owned by a service principal
echo "##[command]az ad group member check --group \"$group\" --member-id \"$principal\""
is_member=$(az ad group member check --group "$group" --member-id "$principal" | jq -r '.value')
if [ "$is_member" = "false" ]; then
echo "##[command]az ad group member add --group \"$group\" --member-id \"$principal\""
az ad group member add --group "$group" --member-id "$principal"
else
echo "##[warning]principal \"$principal\" is already a member of group \"$group\""
fi
echo "##[command]az ad group member list --group \"$group\""
az ad group member list --group "$group"
Is there a plan to fix this issue?
Currently I'm using:
GROUP_ID="GROUP_UUID"
az rest \
--method get \
--url https://graph.microsoft.com/beta/groups/$GROUP_ID/members |\
jq '.value[] | select(.["@odata.type"] == "#microsoft.graph.servicePrincipal") | .id'
Could this be reopened @jiasli ? Thank you
Another google search that brings me to a posting of yet another quietly broken part of the API that requires using the beta duct tape endpoint workaround. Same issue for retrieving last login times. There are many examples of such cases that have been open for years. When they charge $6 per user per month, something seems very wrong here. I loathe this API and the surprise breakages that occur every few months.
Hi @jiasli, can this be reopened please?
I am facing the same issue
Can't believe such a basic check on a group membership for ANY type of member, is not possible...
I can't believe it too. I just faced the same issue, Google led me here. More than 3 years and no action from Microsoft...
Wow, this is incredible. Almost 4 years now and still facing this issue. Absolutely mental for such a basic action...! 🤣
This is a joke, right?!? What a dumpsterfire...
I know this is not a solution but many people will find this page so just sharing a workaround to use:
az rest --uri https://graph.microsoft.com/beta/groups/[GROUPID]/members | jq .value[].displayName
az rest --uri https://graph.microsoft.com/beta/groups/a123b4cd-efg5-678h-9ijk-7392b165e6d5/members | jq .value[].displayName
Hi, we're sending this friendly reminder because we haven't heard back from you in a while. We need more information about this issue to help address it. Please be sure to give us your input within the next 7 days. If we don't hear back from you within 14 days of this comment the issue will be automatically closed. Thank you!
please don't close it, it seems like a fairly reasonable request
I hate "+1" and "bump" messages like the next guy, but this ^ type of automation pushes users to create unnecessary noise just to keep issues opened.
Feels like the goal is to auto close the ticket and never fix the graphiapi. Azure/entra has a captive user base. What are they going to do, switch to something else over the lack of robust features?Sent from my iPhoneOn Mar 10, 2026, at 14:52, Florent Tatard @.***> wrote:FlorentATo left a comment (Azure/azure-cli#22664) I hate "+1" and "bump" messages like the next guy, but this ^ type of automation pushes users to create unnecessary noise just to keep issues opened.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.***>
I guess ms wants me to hear from myself. Is anyone working this bug? Why are you trying to close it every week?Sent from my iPadOn Mar 17, 2026, at 16:26, microsoft-github-policy-service[bot] @.***> wrote:microsoft-github-policy-service[bot] left a comment (Azure/azure-cli#22664) Hi, we're sending this friendly reminder because we haven't heard back from you in a while. We need more information about this issue to help address it. Please be sure to give us your input within the next 7 days. If we don't hear back from you within 14 days of this comment the issue will be automatically closed. Thank you!
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.***>
I guess it's easier to "act" like nothing happens and close this, instead of actually working on it, from Microsoft's/the Assignee's perspective. The time that's passed so far and the attitude towards the resolution of this issue, even with all of the people trying to raise the awareness on this thread, sincerely tells us that there is no desire at all to fix it. What a shame of an attitude, of a product quality and an overall experience towards such a small ask.