Skip to content

Allow non-interactive app selection in init (e.g. --app-id) so PWA publishing works in CI/CD #146

Description

@Haulund-ATP

Summary

Please add a non-interactive way to select the target application in msstore init (e.g. an --app-id / --product-id option) so that PWA packaging and publishing can run in CI/CD (GitHub Actions, Azure DevOps). Today it is effectively impossible to publish a PWA to the Microsoft Store from a headless pipeline.

Why this is blocking

For a PWA, the documented publish path is msstore init <url> (optionally --package / --publish). This is the only command that produces the artifacts a PWA publish needs:

  • It calls the PWABuilder API to build the MSIX bundle (*_PWABuilderExtractedBundle), and
  • it writes pwaAppInfo.json (containing AppId + Uri).

Running msstore publish <url> --appId <id> on its own does not work — it fails with:

💥 Error while loading pwaAppInfo.json file.
'...\https:\my.app.example\pwaAppInfo.json'

because PWAProjectConfigurator.PublishAsync loads pwaAppInfo.json from a directory derived from the URL, and that file only exists after init. --appId locates the Store app for the API call but does not create the file.

So init is mandatory. But init always prompts interactively:

  • InitCommand.SelectAppAsync always calls _consoleReader.SelectionPromptAsync("Which application should we use to configure your project?", ...).
  • ConsoleReader.SelectionPromptAsync creates a Spectre.Console SelectionPrompt with no single-item auto-select and no non-interactive/CI detection.
  • There is no --app-id / --product-id option on init to supply the app up front.

On a GitHub-hosted runner (no TTY) this throws:

Cannot show selection prompt since the current terminal isn't interactive.

Net result: a PWA cannot be published to the Microsoft Store from GitHub Actions at all. The Store ID is already known (it is reserved in Partner Center), so the interactive selection is pure friction in CI.

Repro

# GitHub Actions, windows-latest
- uses: microsoft/microsoft-store-apppublisher@v1.1
- run: |
    msstore reconfigure --tenantId ... --sellerId ... --clientId ... --clientSecret ...
    msstore init "https://my.pwa.example" --publish --publisherDisplayName "My Publisher"

→ fails at the app-selection prompt with "Cannot show selection prompt since the current terminal isn't interactive."

Proposed solution

Add an option to init to specify the application non-interactively, e.g.:

msstore init "https://my.pwa.example" --app-id 9PXXXXXXXXXX --publish

When --app-id is provided, resolve the app via the Store API (GetApplicationAsync) and skip SelectAppAsync entirely.

Nice-to-haves (any of these would also help):

  • Auto-select when the account has exactly one app.
  • Detect a non-interactive console and fail fast with a clear message that points to --app-id, instead of the generic Spectre error.

Environment

  • microsoft/microsoft-store-apppublisher@v1.1, windows-latest GitHub-hosted runner.
  • App type: PWA (publishing from a public URL).

Related

Thanks — being able to supply the app id to init would make headless PWA publishing possible and would let the existing GitHub Action actually be used end-to-end for PWAs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions