Skip to content

Commit 71769a9

Browse files
author
Mark Dalton Gray
committed
reduce number of steps
1 parent 3502b83 commit 71769a9

File tree

1 file changed

+2
-18
lines changed

1 file changed

+2
-18
lines changed

articles/operator-nexus/howto-set-up-defender-for-cloud-security.md

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ The required permission is ```Microsoft.Security/mdeOnboardings/read```. Assign
6666

6767
> [!IMPORTANT]
6868
> The user or identity creating the role assignment must have the ```Microsoft.Authorization/roleAssignments/write``` permission at the subscription level.
69-
> Executing the commands to show the principal ID object ID requires the Microsoft Entra role assignment of Directory Reader or equivalent.
7069
7170
Below is an example bash script using the Azure CLI for granting the nc-platform-extension identity permission to onboard the MDE agent on your behalf.
7271

@@ -107,27 +106,12 @@ PRINCIPAL_ID=$(az k8s-extension show \
107106
--output tsv)
108107
echo "Extension Principal ID: $PRINCIPAL_ID"
109108

110-
# 5. Show the full service principal object
111-
echo "Showing service principal details"
112-
az ad sp show --id "$PRINCIPAL_ID"
113-
114-
# 6. Show just the object ID
115-
OBJECT_ID=$(az ad sp show --id "$PRINCIPAL_ID" --query "id" --output tsv)
116-
echo "Service Principal Object ID: $OBJECT_ID"
117-
118-
# 7. Show additional properties (ObjectID, AppID, DisplayName) in a table
119-
echo "Service principal summary:"
120-
az ad sp show \
121-
--id "$PRINCIPAL_ID" \
122-
--query "{ObjectID:id, AppID:appId, DisplayName:displayName}" \
123-
--output table
124-
125-
# 8. Create a Security Reader role assignment at subscription level
109+
# 5. Create a Security Reader role assignment at subscription level
126110
echo "Creating Security Reader role assignment at subscription level"
127111
az role assignment create \
128112
--role "Security Reader" \
129113
--subscription "$SUBSCRIPTION_ID" \
130-
--assignee-object-id "$OBJECT_ID" \
114+
--assignee-object-id "$PRINCIPAL_ID" \
131115
--assignee-principal-type ServicePrincipal \
132116
--scope "/subscriptions/$SUBSCRIPTION_ID"
133117

0 commit comments

Comments
 (0)