Azure / Azure/static-web-apps

Internal Server Error On Deploy

Open
#1,725 7 comments 4 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
346
Forks
67
PR merge metrics
No merged PRs in 30d

Description

## Describe the bug

Deploys to Azure Static Web Apps get stuck in **Uploading** state and fail with `InternalServerError` during the **Uploading build artifacts** phase.

The issue happens consistently, even when:
- Using a **small build artifact**
- Regenerating the **deployment token**
- Deploying via **Bitbucket Pipelines** and also via **local SWA CLI**
- Skipping the build step (`--no-build`)

The Static Web App remains indefinitely in **Uploading** status in the Azure Portal, while traffic continues to point to the previous version (100%).

---

## To Reproduce

Steps to reproduce the behavior:

1. Build a SPA locally (output folder: `dist`)
2. Deploy to Azure Static Web Apps using one of the following methods:
- Bitbucket Pipelines using `StaticSitesClient`
- Local machine using `swa deploy` (SWA CLI)
3. Observe the deploy logs reaching:
- `Zipping App Artifacts`
- `Uploading build artifacts`
4. Deployment fails with:
- `InternalServerError`
5. In Azure Portal → Static Web App → Environments:
- Production environment remains stuck in **Uploading**

---

## Expected behavior

The deployment should either:
- Complete successfully and switch traffic to the new version, or
- Fail gracefully and mark the deployment as **Failed**, without leaving the environment stuck in **Uploading** state.

---

## Screenshots

- Azure Portal showing Production environment stuck in **Uploading**

Image

- Bitbucket Pipelines logs showing `InternalServerError` after "Uploading build artifacts"

Image

---

## Device info

- OS: macOS
- Node.js version: 20 LTS (also reproduced on Node 22)
- Deployment method:
- Bitbucket Pipelines
- Local machine via SWA CLI
- Static Web Apps CLI version: `@azure/static-web-apps-cli": "^1.1.6`

---

## Additional context

- The issue persists even after:
- Regenerating the deployment token
- Reducing build size
- Disabling sourcemaps
- Cleaning environments / retries
- Local deploy via SWA CLI reproduces the same error, ruling out CI-specific issues.
- The behavior suggests a **stuck or corrupted deployment state** in the Static Web Apps content ingestion backend.

Deployment IDs (examples):
- `87fc065c-bce2-4cdc-8c14-eec0746bf4c6`
- `6214d82c-4af4-4bed-b930-2e7347592674`

Plan: `FREE`

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.