Problem to deploy Azure static web apps from Bitbucket

Infra Account 0 Reputation points

Hi everyone,

I made a bitbucket-pipelines.yml to deploy a React app to Azure static web apps from Bitbucket and it fail when try to get a variable API_TOKEN from $deployment_token added previously.

I made several test even paste directly the value and it not work.

Other users report to the same issue:

I contacted the Bitbuket support and they responded :

This pipe supported by Microsoft team, and seems like they stopped to maintain it:

This sample is provided “as is” and is not supported. Likewise, no commitments are made as to its longevity or maintenance. To discuss this sample with other users, please visit the Azure DevOps Services section of the Microsoft Developer Community

Here my pipelines:

image: node:18

   - step:
       name: Build
         - node
         - npm install
         - npm run lint
         - npm run build
   - step:
     name: Deploy to
     deployment: develop
       - pipe: microsoft/azure-static-web-apps-deploy:main
           SKIP_APP_BUILD: 'true'
           API_TOKEN: $deployment_token
Azure Static Web Apps
Azure Static Web Apps
An Azure service that provides streamlined full-stack web app development.
628 questions
{count} votes

1 answer

Sort by: Most helpful
  1. SnehaAgrawal-MSFT 16,026 Reputation points Microsoft Employee

    @Infra Account

    This happens in the very beginning of the swa deployment, which will occur if fail to check one of:

    1. The length of deployment_token is less than the legal value.
    2. The parsed characters stands for the slice or region in the token are illegal.

    The reporting of this error is even earlier than checking if the token equals to the one shown in portal.

    Could you please try below steps-

    1. Follow Reset deployment tokens in Azure Static Web Apps | Microsoft Learn to reset their token, this will ensure their token meet the above conditions.
    2. Then manually write the new token to the settings of their github repo or gitlab, this will ensure the action actually read the right token. Hope this helps.

    Let us know if you have any further issue here.

    0 comments No comments