As of now we are using Azure Devops server for our Angular application build and deployment to Azure Appservice.
Here is our current structure and step of our CICD pipeline in ADO server.
- bash: |
echo "Running npm lint:"
npm run lint$subProject
echo "Running npm build:"
npm run build$subProject
echo "Running npm test:"
npm run test$subProject
Once the build is performed, there is build pipeline task for creating and publishing the release bundle and the final output of the build pipeline is a build artifact in .zip
format.
After the build task, we have a release pipeline, where the above published artifact will be downloaded first and, after replacing certain variables (environment specific) in the extracted directory, again it will be bundled to zip directory, and using the "webapp deployment" task to deploy the the .zip bundle to the Azure webapp service.
steps:
- task: AzureRmWebAppDeployment@4
inputs:
azureSubscription: '$(Subscription)'
appType: webAppLinux
WebAppName: '$(appService)'
deployToSlotOrASE: true
ResourceGroupName: '$(ResourceGroup)'
SlotName: '$(SlotName)'
packageForLinux: '$(Agent.ReleaseDirectory)/my-artifact/$(Build.BuildNumber).zip'
RuntimeStack: NODE|16-lts
StartupCommand: 'pm2 start /home/site/wwwroot/xxxxxx.config.js --no-daemon'
So now we are planning to use Azure Static Webapp to deploy the Angular apps to instead of Azure App Service and looking for the ADO server task replacements accordingly with Azure Devops server.
Since "Static Webapp Deployment" task is not supported in Azure Devops server, we have installed SWA CLI in our build agents.
So how can we directly deploy the build pipeline artifacts (.zip
) files to static webapp using SWA cli in Azure Devops?
In release pipeline how can we replace the deployment command with swa cli ?