Resetting token static website failed

Arend 20 Reputation points
2026-06-18T09:31:34.5466667+00:00

Not able to reset the Deployment token for a Static Website anymore. Message: Resetting token failed.

Azure Static Web Apps
Azure Static Web Apps

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

0 comments No comments

Answer accepted by question author

AI answer

2026-06-18T09:31:48.8633333+00:00

The deployment token for an Azure Static Web App can be reset in several supported ways. If the portal action “Resetting token” fails, use one of the programmatic options and then update the token in the repository secret.

  1. Try resetting the token from the Azure portal again
    1. In Azure Portal, open the Static Web App.
    2. On the Overview page, select Manage deployment token.
    3. Select Reset token.
    4. When a new token appears in Deployment token, copy it.
    5. If this still fails with “Resetting token failed”, use CLI or PowerShell as below.
  2. Reset the deployment token using Azure CLI
    1. Ensure Azure CLI is installed and logged in.
    2. Run:
            az staticwebapp secrets reset-api-key \
              --name <static-site-name> \
              --resource-group <resource-group-name>
      
    3. This command resets the deployment token for the static app. If needed, add --no-wait or global arguments as per the documentation.
  3. Reset the deployment token using PowerShell
    1. Ensure the Az.Websites module is installed and connected to the subscription.
    2. Run:
            Reset-AzStaticWebAppApiKey -ResourceGroupName <resource-group-name> -Name <static-site-name>
      
    3. This resets the API key (deployment token) for the existing static site.
  4. If using SDKs (automation scenarios)
    • .NET: Use StaticSiteResource.ResetApiKey or StaticSiteResource.ResetApiKeyAsync with a StaticSiteResetContent instance to reset the API key via the ARM SDK.
  5. Update the token in the GitHub repository secret After a successful reset (by portal, CLI, PowerShell, or SDK):
    1. Go to the GitHub repository used by the Static Web App.
    2. Open Settings → under Security, select Actions.
    3. In Repository secrets, locate the secret named AZURE_STATIC_WEB_APPS_API_TOKEN... that corresponds to this Static Web App.
    4. Select the edit (pen) icon.
    5. Paste the new deployment token into Value.
    6. Select Update secret.

If all reset methods (portal, CLI, PowerShell) fail, this indicates a backend issue with the Static Web App resource; in that case, raise a support ticket with the error details and the Static Web App name and resource group.


References:

AI-generated content may be incorrect. Read our transparency notes for more information.

Was this answer helpful?

1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

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.