I'm newbie in these topics. I have a free account in azure and azure devops, both are the same account (email). My projects are in azure devops, one of them that is facing issues is an angular v17 app. I'm trying to create a static web app by using as source: Azure DevOps. Here's some config:
When I click on create, it throws the following error:
It couldn't create a personal token (PAT) for the user in Azure DevOps. I have personal tokens created in Azure DevOps, and I checked the branch policies to see if some related with permissions is causing the issue, but not success.
I had to create the static web app by using "other" as source, but it generated another problem for me. The site keeps waiting for implementing:
so, I copied the implementation token provided in the static web app page and I created a pipeline in azure devops to use the PAT in azure_static_web_apps_api_token entry:
but, when I run the pipeline, it throws errors related with nodejs version because Microsoft uses Oryx by default for building and deploying. I'm not sure if Oryx provides its own version of nodejs, however here's the log:
##[section]Starting: Deploy to Azure Static Web Apps
==============================================================================
Task : Deploy Azure Static Web App
Description : [PREVIEW] Build and deploy an Azure Static Web App
Version : 0.228.0
Author : Microsoft Corporation
Help : https://aka.ms/swadocs
==============================================================================
[command]/usr/bin/bash /home/vsts/work/_tasks/AzureStaticWebApp_18aad896-e191-4720-88d6-8ced4806941a/
stable: Pulling from appsvc/staticappsclient
d1da99c2f148: Already exists
577ff23cfe55: Already exists
4f4fb700ef54: Pulling fs layer
8ad0174b54d1: Pulling fs layer
...
Status: Downloaded newer image for mcr.microsoft.com/appsvc/staticappsclient:stable
DeploymentId: f9c20861-ef35-401b-81e3-620ad25e416d
...
Running 'npm install'...
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE package: '@angular-devkit/architect@0.1700.8',
npm WARN EBADENGINE required: {
npm WARN EBADENGINE node: '^18.13.0 || >=20.9.0',
npm WARN EBADENGINE npm: '^6.11.0 || ^7.5.6 || >=8.0.0',
npm WARN EBADENGINE yarn: '>= 1.13.0'
npm WARN EBADENGINE },
npm WARN EBADENGINE current: { node: 'v16.20.2', npm: '8.19.4' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE package: '@angular-devkit/build-angular@17.0.8',
npm WARN EBADENGINE required: {
npm WARN EBADENGINE node: '^18.13.0 || >=20.9.0',
npm WARN EBADENGINE npm: '^6.11.0 || ^7.5.6 || >=8.0.0',
npm WARN EBADENGINE yarn: '>= 1.13.0'
npm WARN EBADENGINE },
...
4 moderate severity vulnerabilities
To address all issues (including breaking changes), run:
npm audit fix --force
Run `npm audit` for details.
Running 'npm run build'...
> vitalix-client@0.1.0 build
> ng build
Node.js version v16.20.2 detected.
The Angular CLI requires a minimum Node.js version of v18.13.
Please update your Node.js version or visit https://nodejs.org/ for additional instructions.
---End of Oryx build logs---
Oryx has found build steps, but identified unsupported platform versions. Failing build.
For further information, please visit the Azure Static Web Apps documentation at https://docs.microsoft.com/en-us/azure/static-web-apps/
If you believe this behavior is unexpected, please raise a GitHub issue at https://github.com/azure/static-web-apps/issues/
Exiting
##[error]Error: The process '/usr/bin/bash' failed with exit code 1
So, I'm not able to deploy the app to azure static web app service.
I tried by adding oryx-manifest.yml to my project to set the nodejs version, but not sucess.
Azure Static Web App throws an error related with PAT when creating. It couldn't create a personal token (PAT) for the user in Azure DevOps. I have personal tokens created in Azure DevOps, and I checked the branch policies to see if some related with permissions is causing the issue, but not success.
For this error, I can reproduce it when I tried to create a Static Web App with the organization which is not linked to the Microsoft Entra ID (The old name is Azure Active Directory).
It is an organization in the Microsoft account Directory. You can check it in Azure DevOps Profile Page.
To connect your organization to Microsoft Entra ID, you can refer this document for the detailed steps. Please be careful with this action and check the prerequisites first, so that users in the organization will not be affected.
After the organization is linked to the Microsoft Entra ID, this error Failed to create a Personal Access Token for this user in Azure DevOps
will not be there anymore.
As for the steps after selecting Source as Other, please refer to SiddheshDesai's answer.