Azure Static Web Apps deployment fails with invalid API key despite token rotation

Aperta
#1,825 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
42/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
azure, github-actions
Ambito
ci-cd, cloud

Direzione di ricerca

Start with the repository’s GitHub Actions deployment workflow and the Azure/static-web-apps-deploy@v1 action inputs, then correlate the failed authentication step with the Static Web App resource configuration. Inspect whether deploymentAuthPolicy: GitHub permits the azure_static_web_apps_api_token flow and whether Azure documents a repository-token update path. Done would mean identifying the supported policy/token configuration and demonstrating a successful deployment without recreating the resource or losing its custom domain.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

:::writing{variant="standard" id="58321"}

Problem

My Azure Static Web App was deploying successfully through GitHub Actions until November 22, 2026. Subsequent deployments fail with:

The content server has rejected the request with: BadRequest
Reason: No matching Static Web App was found or the api key was invalid.

Environment

  • Azure Static Web Apps Free plan
  • Resource: azure-resume
  • Resource group: azure-resume-rg
  • GitHub repository: swiswach/azure-resume
  • Branch: main
  • Deployment action: Azure/static-web-apps-deploy@v1
  • Application directory: site
  • Deployment authorization policy: GitHub

Troubleshooting performed

  1. Confirmed the last successful deployment on November 22, 2026.
  2. Confirmed the application directory exists and the build completes.
  3. Verified the GitHub Actions secret name matches the workflow.
  4. Reset the Azure deployment token and updated the GitHub repository secret.
  5. Reran the deployment; the same authentication error occurred.
  6. Removed unused OIDC steps and the unsupported github_id_token input from the workflow.
  7. Inspected the Azure resource using Resource Explorer and Azure CLI.

The resource configuration contains:

"deploymentAuthPolicy": "GitHub"

Attempts to change this to DeploymentToken using Azure CLI and the Azure management API fail with:

DeploymentAuthPolicy is invalid.
Cannot update policy without providing repository token.

The deployment authorization controls in Azure Portal are grayed out.

Expected behavior

GitHub Actions should successfully deploy the website using the current Azure Static Web Apps deployment token, or Microsoft should provide a supported method for configuring the appropriate deployment authorization policy.

Questions

  1. Why is the deployment token rejected even after rotation?
  2. Is deploymentAuthPolicy: GitHub compatible with Azure/static-web-apps-deploy@v1 when using azure_static_web_apps_api_token?
  3. What is the supported method for changing the deployment authorization policy without recreating the Static Web App?

I would like to preserve the existing Free-tier resource and custom domain.

Lingua principale
Nessun dato sulla lingua
Stelle
347
Fork
68
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di Azure/static-web-apps

Tutte le issue di Azure/static-web-apps

Issue simili

Altre issue su DevOps

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.