Issues with Azure Pipeline for ABP Angular Frontend Deployment

The deployment of an ASP.NET Core application consists of a backend using the ABP framework and a frontend built with Angular, stored in a single repository on Azure DevOps. A YAML pipeline has been configured to deploy both components to separate Azure Web Apps (Windows). The backend app deploys successfully, but the frontend app fails to build and release correctly.
Key Requirement: Before building the Angular app, the proxy must be generated using the ABP CLI. The pipeline does not generate this proxy during execution, which is essential for type safety and IntelliSense support in Angular when handling API calls.
Below is the YAML script configuration for the pipeline:
# ASP.NET
# Build and test ASP.NET projects.
# Add steps that publish symbols, save build artifacts, deploy, and more:
trigger:
branches:
include:
- develop
variables:
solution: '**/*.sln'
buildPlatform: 'Any CPU'
buildConfiguration: 'Release'
angularDir: 'angular'
outputDir: 'dist/ClientPortal'
stages:
- stage: BuildAndDeploy
jobs:
- job: BuildJob
pool:
vmImage: 'windows-latest'
steps:
- task: UseDotNet@2
displayName: 'Use .NET 8 SDK'
inputs:
version: '8.0.x'
includePreviewVersions: true
- task: NuGetCommand@2
displayName: 'Restore NuGet packages'
inputs:
restoreSolution: '$(solution)'
- task: VSBuild@1
displayName: 'Build with Visual Studio'
inputs:
solution: '$(solution)'
msbuildArgs: '/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:PackageLocation="$(Build.ArtifactStagingDirectory)"'
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact'
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
- task: AzureRmWebAppDeployment@5
displayName: 'Deploy to Azure Web App'
inputs:
ConnectionType: 'AzureRM'
azureSubscription: 'Visual Studio(********************************)'
appType: 'webApp'
WebAppName: 'abp-backend-cicd'
package: '$(Build.ArtifactStagingDirectory)/**/*.zip'
# Frontend Deployment tasks
- task: NodeTool@0
inputs:
versionSpec: '20.x'
displayName: 'Install Node.js'
- script: |
cd angular
npm install -g yarn
displayName: 'Install Yarn'
# Run ABP CLI from cmd.exe to generate Angular proxy
- task: CmdLine@2
inputs:
script: |
cd angular
echo Installing ABP CLI and generating proxy...
call dotnet tool install -g Volo.Abp.Cli --version 8.1.2
abp generate-proxy -t ng -u
displayName: 'Load ABP Proxy with CLI'
- script: |
cd angular
echo "Installing Angular dependencies via npm..."
ng config -g cli.packageManager yarn
yarn add @angular/cli
yarn add install-peers
ng build --configuration production
workingDirectory: '$(angularDir)'
displayName: 'NPM Build Angular App'
- task: CopyFiles@2
displayName: 'Copy web.config to dist folder'
inputs:
sourceFolder: '$(Build.SourcesDirectory)/Deployment-Materials/Dev'
contents: 'web.config'
targetFolder: '$(Build.SourcesDirectory)/$(angularDir)/$(outputDir)'
- task: CopyFiles@2
inputs:
sourceFolder: '$(angularDir)/$(outputDir)'
contents: '**'
targetFolder: '$(Build.ArtifactStagingDirectory)'
displayName: 'Prepare Artifact for Publishing'
- task: PublishBuildArtifacts@1
inputs:
pathToPublish: '$(Build.ArtifactStagingDirectory)'
artifactName: 'angular-clientportal'
displayName: 'Publish Angular Build Artifact'
Assistance is required to resolve the issue of the frontend app not building and releasing successfully in the Azure Pipeline.