Configure Azure DevOps for JFrog
Summarize
Summary of Configure Azure DevOps for JFrog
This guide explains how to configure your Azure DevOps environment to integrate with JFrog Artifactory, enabling seamless upload and download of artifacts. By setting up this integration, you can automate artifact management within your CI/CD pipelines, ensuring efficient and consistent build processes.
Show less
Configuring Azure DevOps for JFrog
- Install the JFrog Artifactory plugin in your Azure DevOps instance.
- Create a new service connection in your project by navigating to Project settings > Pipelines > Service connections, selecting the JFrog Artifactory plugin, and entering your JFrog instance details, including username and password credentials.
Uploading Artifacts from Azure DevOps to JFrog
- In your pipeline stage for uploading artifacts, add the Artifactory Generic Upload task.
- Select the JFrog service connection and provide a file spec defining the artifacts to upload.
- Enable Collect build info and set the build number to the Azure DevOps
BuildIdparameter. - Add the Artifactory Publish Build Info task to publish build metadata, linking it to the same build number.
A sample YAML pipeline snippet demonstrates these steps, including specifying the artifact pattern, target repository, and build identifiers.
Downloading Artifacts from JFrog to Azure DevOps
- In your pipeline stage for downloading artifacts, add the Artifactory Generic Download task.
- Use the JFrog service connection and enter a file spec to define which artifacts to download and their target location.
- Enable Collect build info and configure the build number with the Azure DevOps
BuildId. - Add the Artifactory Publish Build Info task to record build information.
A sample YAML pipeline example is included, showing how to specify the artifact path in JFrog and the local target directory.
Benefits for ServiceNow Customers
By integrating Azure DevOps with JFrog Artifactory using this configuration, ServiceNow customers can automate artifact handling within their DevOps workflows. This ensures reliable artifact storage, traceability through build info, and simplifies managing dependencies for ServiceNow application deployments and custom development.
Configure your Azure DevOps instance to enable upload and download of JFrog artifacts.
- Install the plugin JFrog Artifactory.
- Select your project and navigate to .
- Select New service connection, search and select the installed JFrog Artifactory plugin, and select Next.
- Enter your JFrog instance details and create a service connection for JFrog.Note:The Username and Password fields must contain the credentials to your JFrog instance entered in the Server URL field.
Upload artifacts from Azure DevOps to JFrog
- Navigate to your project pipeline.
- In your stage for uploading, add the task Artifactory Generic Upload for uploading artifacts.
- For the Artifactory Generic Upload task:
- Select the service connection you created for JFrog.
- In the Spec field, entire your file spec.
- Select the Collect build info check box.
- The Build number field should contain the BuildId parameter.
- Select Add.
- Add the task Artifactory Publish Build Info for publishing build info.
- For the Artifactory Publish Build Info task:
- Select the service connection you created for JFrog.
- The Build number field should contain the BuildId parameter.
- Select Add.
Sample pipeline to upload artifacts from Azure DevOps to JFrog
trigger:
- none
pool:
vmImage: ubuntu-latest
variables:
- group: Variable Group
stages:
- stage: upload_artifact
jobs:
- job: 'upload'
steps:
- script: echo Hello, world!
displayName: 'Run a one-line script'
- task: ArtifactoryGenericUpload@2
inputs:
artifactoryService: 'JFrogCloud'
specSource: 'taskConfiguration'
fileSpec: |
{
"files": [
{
"pattern": "servicenow-app-devops.zip",
"target": "local-repo"
}
]
}
collectBuildInfo: true
buildName: '$(Build.DefinitionName)'
buildNumber: '$(Build.BuildId)'
failNoOp: true'
- task: ArtifactoryPublishBuildInfo@1
inputs:
artifactoryService: 'JFrogCloud'
buildName: '$(Build.DefinitionName)'
buildNumber: '$(Build.BuildId)'
Download artifacts from JFrog to Azure DevOps
- Navigate to your project pipeline.
- In your stage for downloading, add the task Artifactory Generic Download for downloading artifacts.
- For the Artifactory Generic Download task:
- Select the service connection you created for JFrog.
- In the Spec field, entire your file spec.
- Select the Collect build info check box.
- The Build number field should contain the BuildId parameter.
- Select Add.
- Add the task Artifactory Publish Build Info for publishing build info.
- For the Artifactory Publish Build Info task:
- Select the service connection you created for JFrog.
- The Build number field should contain the BuildId parameter.
- Select Add.
Sample pipeline to download artifacts from Azure DevOps to JFrog
trigger:
- none
pool:
vmImage: ubuntu-latest
variables:
- group: Variable Group
stages:
- stage: download_artifact
jobs:
- job: 'download'
steps:
- task: ArtifactoryGenericDownload@3
inputs:
connection: 'JFrogCloud'
specSource: 'taskConfiguration'
fileSpec: |
{
"files": [
{
"pattern": "local-repo/servicenow-app-devops.zip",
"target": "/tmp/"
}
]
}
collectBuildInfo: true
buildName: '$(Build.DefinitionName)'
buildNumber: '$(Build.BuildId)'
failNoOp: true
- task: ArtifactoryPublishBuildInfo@1
inputs:
artifactoryService: 'JFrogCloud'
buildName: '$(Build.DefinitionName)'
buildNumber: '$(Build.BuildId)'