Share via

Github failed to sync with Azure Static Web Apps

Shun Ming 5 Reputation points
2025-08-24T03:12:36.5333333+00:00

Hi,

I keep getting the error message below when try to build Static Web Apps with Github:

++++++++++++++++++++++++++++++++++++++++++++++++++++++++

The content server has rejected the request with: BadRequest

Reason: No matching Static Web App was found or the api key was invalid.

++++++++++++++++++++++++++++++++++++++++++++++++++++++++

I checked the Secret created is the same at both Github Workflow and Azure Management Secret.

I did recreate a new Static Web Apps but still the sam.

Could you please kindly assist?

THanks,
Shun Ming

Azure Static Web Apps
Azure Static Web Apps

An Azure service that provides streamlined full-stack web app development.

0 comments No comments
{count} vote

2 answers

Sort by: Most helpful
  1. Maxim Ivashkov 1 Reputation point
    2026-02-25T20:15:10.4933333+00:00

    i have the same problem, today a few deployements went ok, suddenly this error.

    so your explanations is wrong, microsoft has a bug somewhere

    do not use static web apps until it is fixed

    bug in github integration

    0 comments No comments

  2. Anonymous
    2025-08-25T05:43:07.14+00:00

    Hello Shun Ming,

    Thank you for submitting your question on Microsoft Q&A.

    The Problem

    The error message "No matching Static Web App was found or the api key was invalid" comes from the Azure content server. This indicates that while the GitHub Action initiated correctly, the deployment failed because the Azure Static Web App either couldn't be found or the API key was invalid. Essentially, you have a key, but it's not opening the right door.

    Solutions

    1. Regenerate and Re-add the Deployment Token
      • In the Azure Portal, access your Static Web App.
        • On the Overview page, select "Manage deployment token".
          • Click "Reset token" and copy the new token.
            • In your GitHub repository, navigate to Settings > Secrets and variables > Actions.
              • Locate the AZURE_STATIC_WEB_APPS_API_TOKEN_... secret, edit it, and paste the new token.
                • Save your changes and re-run the GitHub Action.
    2. Verify the Token in the Workflow File Ensure your workflow YAML file (.github/workflows/azure-static-web-apps-<...>.yml) references the correct secret:
         jobs:
           build_and_deploy_job:
             runs-on: ubuntu-latest
             name: Build and Deploy Job
             steps:
               - uses: actions/checkout@v2
                 with:
                   submodules: true
               - name: Build And Deploy
                 id: builddeploy
                 uses: Azure/static-web-apps-deploy@v1
                 with:
                   azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_YOUR_APP_NAME_HERE }}
      
      Double-check that the secret name matches exactly.
    3. Consider Other Causes
      • Renaming the Static Web App in Azure invalidates the deployment token, so you must regenerate it.
      • Changing the repository branch name (e.g., from master to main) may require updating secrets or recreating the Static Web App for the new branch.
    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.