Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion deployment/hooks/predeploy.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ try {
$acrBuildArgs = @("--build-arg", "ENTRA_SPA_CLIENT_ID=$clientId", "--build-arg", "ENTRA_TENANT_ID=$tenantId")
if ($backendClientId) { $acrBuildArgs += @("--build-arg", "ENTRA_BACKEND_CLIENT_ID=$backendClientId") }
if ($appInsightsConnStrEscaped) { $acrBuildArgs += @("--build-arg", "APPLICATIONINSIGHTS_FRONTEND_CONNECTION_STRING=$appInsightsConnStrEscaped") }
$buildOutput = az acr build --registry $acrName --image "web:$imageTag" `
$buildOutput = az acr build --registry $acrName --resource-group $env:AZURE_RESOURCE_GROUP_NAME --image "web:$imageTag" `

Copilot AI Apr 9, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

az acr build is now using $env:AZURE_RESOURCE_GROUP_NAME directly, but this script already resolves the resource group via Get-AzdValue into $resourceGroup (with a fallback when env vars aren’t present). Using the env var here can make ACR cloud builds fail when the hook is run without injected env vars even though azd env get-value works. Use $resourceGroup (and fail fast if it’s empty) for consistency with the rest of the script.

Suggested change
$buildOutput = az acr build --registry $acrName --resource-group $env:AZURE_RESOURCE_GROUP_NAME --image "web:$imageTag" `
if ([string]::IsNullOrWhiteSpace($resourceGroup)) { throw "AZURE_RESOURCE_GROUP_NAME is required for ACR cloud build" }
$buildOutput = az acr build --registry $acrName --resource-group $resourceGroup --image "web:$imageTag" `

Copilot uses AI. Check for mistakes.
@acrBuildArgs `
--file deployment/docker/frontend.Dockerfile . `
--no-logs --only-show-errors 2>&1
Expand Down
Loading