Azure / Azure/static-web-apps

SWA Deployment Fails with BadRequest in Production Environment

Open
#1,517 0 comments 0 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**

I am currently unable to deploy my SWA to a production environment, as it fails with the following error:

```
---End of Oryx build logs---
Web App Runtime Information. OS: linux, node version: 20
...
The content server has rejected the request with: BadRequest
Reason: The Static Web App does not support managed functions since there are user provided functions registered with the static web app. Please either detach the user provided functions from the static web app or remove or rename the functions folder to stop uploading to the managed functions.
```

I have verified that the SWA does not include any code in the `/api` path that might get picked up as a managed backend.

This error does not appear when deploying to a preview environment via pull request.

**To Reproduce**
Steps to reproduce the behavior:
1. Commit a change to the SWA GitHub repo
2. GitHub action is triggered
3. Deployment fails with the above error during the Build and Deploy step

Workflow .yml and staticwebapp.config.json attached.

**Expected behavior**
SWA deploys successfully and uses the linked backend. In the event of a deployment failure, useful error messages that reference the issue should be provided.

[azure-staticwebapp-prod.yml.txt](https://github.com/user-attachments/files/16336900/azure-staticwebapp-prod.yml.txt)
[staticwebapp.config.json](https://github.com/user-attachments/files/16336941/staticwebapp.config.json)

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reading azure-staticwebapp-prod.yml.txt and staticwebapp.config.json, then compare the production workflow with the pull-request preview deployment. Reproduce the GitHub Actions Build and Deploy failure and trace the managed-functions configuration; done means production deploys successfully with the linked backend or reports a useful, issue-specific error.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, github-actions
Domain
cloud, devops
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.