I have a repository with my angular app. It works fine local.
I created pipline with yaml file in azure devops.
# Node.js with Angular
# Build a Node.js project that uses Angular.
# Add steps that analyze code, save build artifacts, deploy, and more:
# https://learn.microsoft.com/azure/devops/pipelines/languages/javascript
trigger:
- masters
pool:
vmImage: ubuntu-latest
steps:
- task: NodeTool@0
inputs:
versionSpec: '16.x'
displayName: 'Install Node.js'
- script: |
npm install -g @angular/cli
npm install
npm outdated
npm run build:ssr --prod
displayName: 'npm install and build'
- task: CopyFiles@2
inputs:
targetFolder: '$(Build.ArtifactStagingDirectory)'
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: 'dist'
ArtifactName: 'dist'
I have a release with this pipeline to my web app server in azure. This server with windows OS. I didn’t have a problem with it when my yaml file was with vmImage: ubuntu-latest
.
Pipeline builds good and deploy to app server was going good too.
No I have a problem with this in my browser when I try to open my app.
I heard that I need to change path mappings in configuration.
I tried a lot of many cases. sitewwwroot
, sitewwwrootmyappname
, sitewwwrootmyappnamedist
.
And instead You do not have permission to view this directory or page
I have now this
My Angular app was created with default command ng new test
and have all configs.
I really don’t know what to do.
2
Answers
The problem was in my folder assets. I use server render and I need to set folder path such way
sitewwwrootapp-name-from-package.jsonbrowser
and add
web.config
tosrc
and set him inangular.json
in assets"assets": ["src/web.config"]
SCM_DO_BUILD_DURING_DEPLOYMENT
with valuetrue
And in
Path Mappings
, check whether Virtual Path is added or not.Navigate to KUDU Console from portal
Azure Portal => Your Web App => Advanced Settings => Go => Debug Console, check whether the files and folder structures are correct and are under
wwwroot
directoryNow Iam able to access my Web App without any issues.
Output :