From 8b0a0ce064eb3e8f674a8af589f89375945fd0f0 Mon Sep 17 00:00:00 2001 From: John Date: Fri, 8 Jul 2022 13:46:40 +0200 Subject: [PATCH] Fixed for correct output id, added example command for search on name (#281) Co-authored-by: Jack Tracey <41163455+jtracey93@users.noreply.github.com> --- .../bicep/modules/roleAssignments/README.md | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/infra-as-code/bicep/modules/roleAssignments/README.md b/infra-as-code/bicep/modules/roleAssignments/README.md index 7bbb7bee5..e182e4975 100644 --- a/infra-as-code/bicep/modules/roleAssignments/README.md +++ b/infra-as-code/bicep/modules/roleAssignments/README.md @@ -30,13 +30,19 @@ az identity show --resource-group --name --quer # Identify Object Id for Service Principal (App Registration) # Require read permission to query Azure Active Directory -# Example: az ad sp show --id c705dc53-7c95-42bc-b1d5-75e172571370 --query objectId -az ad sp show --id --query objectId +# Example: az ad sp show --id c705dc53-7c95-42bc-b1d5-75e172571370 --query id +az ad sp show --id --query id + +# Identify Object Id for Service Principal (App Registration) +# Require read permission to query Azure Active Directory +# Beware of duplicates, since app registation names are not unique. +# Example: az ad sp list --filter "displayName eq ''" --query '[].{name:appDisplayName, objectId:id}' +az ad sp list --filter "displayName eq ''" --query '[].{name:appDisplayName, objectId:id}' # Identify Object Id for Security Group # Require read permission to query Azure Active Directory -# Example: az ad group show --group SG_ALZ_SECURITY --query objectId -az ad group show --group --query objectId +# Example: az ad group show --group SG_ALZ_SECURITY --query id +az ad group show --group --query id ``` ### PowerShell - Find Object ID