I am trying to get a build and release pipeline for the this sample chatbot -> https://github.com/microsoft/BotBuilder-Samples/tree/main/samples/javascript_nodejs/49.qnamaker-all-features
I already have all the infrastructure resources in place. I plan to automate this later. But the for the moment I just need to deploy the code. Can I get some help on this?
The Azure Project has the Repo with the code checked in.
What does the Build Pipeline need to look like?
- I think I need to do an npm install for packages
- generate the web.config using az bot prepare-deploy --code-dir "." --lang Javascript
- generate a zip file.
What does the Release Pipeline need to look like?
- I think I neeed to run az webapp deployment source config-zip --resource-group "" --name "" --src "<zipfile_from_build>"
This is how far I have gotten:
trigger:
- master
pool:
vmImage: 'ubuntu-latest'
steps:
- task: NodeTool@0
inputs:
versionSpec: '10.x'
displayName: 'Install Node.js 10.x'
- script: |
npm install
displayName: 'Install all modules'
Any help appreciated!
Thanks in advance, Jake.
UPDATE: Here is my final yaml
trigger:
- main
pool:
vmImage: 'ubuntu-latest'
steps:
- task: NodeTool@0
inputs:
versionSpec: '10.x'
displayName: 'Install Node.js'
- script: |
npm install
displayName: 'npm install and build'
- task: ArchiveFiles@2
inputs:
rootFolderOrFile: '$(Build.SourcesDirectory)'
includeRootFolder: false
archiveType: 'zip'
archiveFile: '$(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip'
replaceExistingArchive: true
- task: AzureRmWebAppDeployment@4
displayName: 'Azure App Service Deploy: myTestBot'
inputs:
ConnectedServiceName: 'Release-Service-Connection'
azureSubscription: 'subscriptionName'
WebAppName: 'BotName'
ResourceGroupName: 'rgName'
packageForLinux: '$(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip'
WebConfigParameters: '-Handler iisnode -NodeStartFile index.js -appType node'