Chapter 5 of 6
Implement#
1. Complete the records and run preflight#
Resolve the Defender, Sentinel, and shadow AI decisions in the private implementation copy.
PowerShell
$targetScope = "<approved scope alias>"
$targetSubscriptionId = $env:AZURE_SUBSCRIPTION_ID
$sentinelResourceGroupName = "<approved Sentinel resource group>"
$sentinelWorkspaceName = "<approved Sentinel workspace>"
$deploymentLocation = "<approved Azure region>"
.\scripts\preflight.ps1 `
-TargetScope $targetScope `
-TargetSubscriptionId $targetSubscriptionId `
-SentinelResourceGroupName $sentinelResourceGroupName `
-SentinelWorkspaceName $sentinelWorkspaceName `
-DeploymentLocation $deploymentLocation
Bash
target_scope="<approved scope alias>"
target_subscription_id="${AZURE_SUBSCRIPTION_ID}"
sentinel_resource_group_name="<approved Sentinel resource group>"
sentinel_workspace_name="<approved Sentinel workspace>"
deployment_location="<approved Azure region>"
./scripts/preflight.sh \
--target-scope "$target_scope" \
--target-subscription-id "$target_subscription_id" \
--sentinel-resource-group-name "$sentinel_resource_group_name" \
--sentinel-workspace-name "$sentinel_workspace_name" \
--deployment-location "$deployment_location"
Preflight checks required files, every decision sentinel, JSON syntax, Bicep and bicepparam syntax, the approved target scope, the Sentinel workspace binding, and both read-only deployment previews. It does not preview Defender for Cloud Apps portal changes; shadow AI remains portal-led and monitor-first.
2. Deploy the Defender and Sentinel definitions#
Deploy only after the owners approve both what-if results.
PowerShell
az deployment sub create `
--subscription $targetSubscriptionId `
--location $deploymentLocation `
--template-file .\artifacts\defender\defender-ai-plan.bicep `
--parameters .\artifacts\defender\defender-ai-plan.bicepparam `
--only-show-errors
az deployment group create `
--subscription $targetSubscriptionId `
--resource-group $sentinelResourceGroupName `
--template-file .\artifacts\sentinel\copilot-threat-detections.bicep `
--parameters .\artifacts\sentinel\copilot-threat-detections.bicepparam `
--only-show-errors
Bash
az deployment sub create \
--subscription "$target_subscription_id" \
--location "$deployment_location" \
--template-file ./artifacts/defender/defender-ai-plan.bicep \
--parameters ./artifacts/defender/defender-ai-plan.bicepparam \
--only-show-errors
az deployment group create \
--subscription "$target_subscription_id" \
--resource-group "$sentinel_resource_group_name" \
--template-file ./artifacts/sentinel/copilot-threat-detections.bicep \
--parameters ./artifacts/sentinel/copilot-threat-detections.bicepparam \
--only-show-errors
3. Apply shadow AI monitor-mode decisions#
In the Microsoft Defender portal, open Cloud apps > Cloud discovery > Discovered apps. Filter Category = Generative AI. Compare the portal list with artifacts/shadow-ai/shadow-ai-sanction-decisions.json.
Apply the recorded Sanctioned or Unsanctioned tag. Keep enforcement in monitor mode until the security operations owner approves block or warn behavior through the change path. If an Unsanctioned tag automatically blocks on Defender for Endpoint-onboarded devices in this tenant, stop and use the recorded restore reference before tagging business-critical apps.
4. Share the operating queries#
Give the SOC owner artifacts/defender/defender-ai-alerts.kql for weekly alert-family reporting. Tune artifacts/sentinel/copilot-external-ip-hunting.kql to the organization's egress ranges before using it for recurring review.