I am trying to integrate JFROG artifactory with Azure webapps using CICD in AzureDevOps. So the workflow will be like this
- User pushes code to github
- Azure DevOps runs CI and send the artifact/code to JFROG artifactory
- JFROG updates the application on Azure Web App
The application is all in C# . I have already managed it to integrate with AKS but cant find and tutorial or guide for integrating JFROG with Azure App. Any idea? Thanks
CodePudding user response:
As you are looking to integrate Artifactory with Azure DevOps, this can be achieved by installing the JFrog Artifactory extension Visual Studio Marketplace, and then configuring the build script accordingly.
You can refer to below JFrog wiki pages which helps you to achieve your use case: https://www.jfrog.com/confluence/display/JFROG/Artifactory Azure DevOps Extension
https://jfrog.com/screencast/jfrog-artifactory-on-azure/
https://jfrog.com/webinar/effective-ci-cd-with-azure-devops-and-the-jfrog-platform/
https://www.youtube.com/watch?v=E4_veZaFDmQ
CodePudding user response:
As mentioned in the above post, this can be achieved by installing the JFrog Artifactory extension in your Azure DevOps Organization, but in your pipeline you will need tasks to upload (ArtifactoryUpload) and download (ArtifactoryDownload). so basically, here is what you will do:
- task: DotNetCoreCLI@2
displayName: Build WebApp
inputs:
projects: '**/*.csproj'
arguments: '--configuration Release --no-restore'
- task: ArtifactoryGenericUpload@2
displayName: Publish webapp
inputs:
artifactoryService: 'artifactory'
specSource: 'taskConfiguration'
fileSpec: |
{
"files": [
{
"pattern": "$(Build.ArtifactStagingDirectory)/$(Build.BuildNumber)/*.zip",
"target": "$(artifactory)/$(Build.BuildNumber)"
}
]
}
collectBuildInfo: false
buildName: '$(Build.DefinitionName)'
buildNumber: '$(Build.BuildNumber)'
failNoOp: true
- task: ArtifactoryGenericDownload@3
displayName: Download artifact
inputs:
connection: 'artifactory'
specSource: 'taskConfiguration'
fileSpec: |
{
"files": [
{
"pattern": "$(artifactory)/$(Build.BuildNumber)/*.zip",
"target": "$(Build.ArtifactStagingDirectory)/"
}
]
}
failNoOp: true
- task: AzureRmWebAppDeployment@4
displayName: Deploy AppService
inputs:
ConnectionType: 'AzureRM'
azureSubscription: 'Azure Subscription'
appType: 'webAppLinux'
WebAppName: 'webapp'
packageForLinux: '$(Build.ArtifactStagingDirectory)/$(Build.BuildNumber)/webapp.zip'