Skip to content

Commit ada1441

Browse files
robgrameCopilot
andcommitted
feat(deploy): add -HybridAgentPrincipalId param to Deploy-Azure.ps1
Wires the on-prem HybridAgent SPN/UAMI object ID through to the Bicep parameter so the producer pivot RBAC (queue-scoped SB Data Sender + key-scoped KV Crypto User on agent-seal) is applied in a single idempotent deploy. Usage: .\Deploy-Azure.ps1 -EnvironmentName dev3 \` -HybridAgentPrincipalId <agent-sp-object-id> Verified on dev3: agent SP c1460adb-... now has Sender on dek-sealed-batches queue and Crypto User on the blkmon-agent-seal key (both least-privilege scoped). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 2f5a25c commit ada1441

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

Deploy-Azure.ps1

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ param(
7373
[string]$EnvironmentName = 'dev',
7474
[string]$SqlAdminPrincipalId,
7575
[string]$SqlAdminLoginName,
76+
[string]$HybridAgentPrincipalId,
7677
[switch]$SkipPreview,
7778
[switch]$SkipDeploy,
7879
[switch]$PublishApps,
@@ -157,6 +158,9 @@ $paramObj = @{
157158
sqlAdminLoginName = @{ value = $SqlAdminLoginName }
158159
}
159160
}
161+
if ($HybridAgentPrincipalId) {
162+
$paramObj.parameters.hybridAgentPrincipalId = @{ value = $HybridAgentPrincipalId }
163+
}
160164
$paramFile = Join-Path $env:TEMP "blkmon-params-$EnvironmentName.json"
161165
$paramObj | ConvertTo-Json -Depth 10 | Set-Content -Path $paramFile -Encoding utf8
162166

@@ -165,6 +169,9 @@ Write-Host " location = $Location"
165169
Write-Host " principalId = $principalId"
166170
Write-Host " sqlAdminPrincipalId = $SqlAdminPrincipalId"
167171
Write-Host " sqlAdminLoginName = $SqlAdminLoginName"
172+
if ($HybridAgentPrincipalId) {
173+
Write-Host " hybridAgentPrincipalId = $HybridAgentPrincipalId"
174+
}
168175
Write-Host " parameters file = $paramFile"
169176

170177
# --- 4. Bicep build (lint + compile) -----------------------------------------

0 commit comments

Comments
 (0)