diff --git a/scripts/deploy/deploy-app.ps1 b/scripts/deploy/deploy-app.ps1 index 29cb316..822f42c 100644 --- a/scripts/deploy/deploy-app.ps1 +++ b/scripts/deploy/deploy-app.ps1 @@ -47,10 +47,6 @@ $configPath = Join-Path $repoRoot 'power.config.json' if (-not (Test-Path $configPath)) { throw "power.config.json not found at $configPath. Run scripts/ci/render-power-config.ps1 first." } -$environmentId = (Get-Content -Path $configPath -Raw | ConvertFrom-Json).environmentId -if ([string]::IsNullOrWhiteSpace($environmentId)) { - throw "power.config.json has no environmentId." -} # These variables make the CLI sign in as the service principal instead of # using a cached interactive account. They live only in this process. @@ -64,9 +60,12 @@ Write-Host "Publishing Code App using $configPath as service principal $($env:PP Push-Location $repoRoot try { # --no: use the version npm ci installed; never download another one. + # No --environment-id: the CLI reads the environment from + # power.config.json and rejects the flag as an unknown option when that + # file exists (found live 2026-10-06). # The earlier CLI could print an HTTP error and still exit 0 (found live # 2026-07-02), so the output is checked as well as the exit code. - npx --no -- pa app push --non-interactive --no-color --environment-id $environmentId 2>&1 | + npx --no -- pa app push --non-interactive --no-color 2>&1 | Tee-Object -Variable capturedOutput | ForEach-Object { Write-Host $_ } $exitCode = $LASTEXITCODE } finally { diff --git a/specs/003-github-actions-cicd/tasks.md b/specs/003-github-actions-cicd/tasks.md index e5158d9..a280711 100644 --- a/specs/003-github-actions-cicd/tasks.md +++ b/specs/003-github-actions-cicd/tasks.md @@ -325,4 +325,6 @@ What changed here: **Prerequisite before the next deploy** (checked 2026-10-05: neither service principal has a permission on its environment's app yet, only the owner does): the owner shares the dev app with the dev service principal and the production app with the production one, each with edit access. -**Not yet verified**: a pipeline run with the new step. The runner stays `windows-latest`; the reason it was chosen (the `pac auth` profile on Linux) no longer applies, but a Linux runner has not been tried with the new CLI. +**First pipeline run (2026-10-06, after merging PR #21)**: the dev app had been shared with the dev service principal (edit access confirmed on the app). "Deploy Code App" failed with `error: unknown option '--environment-id'`. The script passed that flag; the CLI accepts it only when there is no `power.config.json`, and otherwise takes the environment from that file. The flag was removed. Every earlier step of that run passed, and the app's content in dev was already current from the previous deploy. + +**Not yet verified**: a pipeline run with the corrected step. The runner stays `windows-latest`; the reason it was chosen (the `pac auth` profile on Linux) no longer applies, but a Linux runner has not been tried with the new CLI.