ARTIFACTORY: Cheat Sheet to configure Azure Blob Storage with Artifactory using Direct and Eventual Upload method

Prakriti Vishwakarma
2022-09-18 09:32

Artifactory supports storing and managing Artifactory filestore on the cloud with Azure Blob Storage via two options.

  1. Direct upload mechanism
  2. Eventual upload mechanism

The direct Upload mechanism enables to upload of artifacts to the Azure cloud without the need to maintain persistent storage.

  • Client uploads artifacts to Artifactory
  • Artifactory receives and simultaneously uploads it to Azure cloud storage
  • After Artifactory finishes uploading to Azure cloud, returns 201 success to the client 
  • Database entry for artifact is created 

The Eventual Upload mechanism also allows to upload of artifacts when Azure is down or experiencing network issues. 

  • Client uploads artifacts to Artifactory
  • Artifacrtory receives full upload and returns 201 success to the client
  • Database entry for artifact is created 
  • Artifactory uploads Artifactory to Azure cloud storage
  • The binary is deleted from the eventual directory

Following is the example configuration of Azure Blob Storage with Artifactory

  1. Create an Azure Account
  2. Go to Storage Account and create an Azure Blob Storage Container

User-added image

 

3. The name and key of the Storage Account can be found in Access Keys section.

User-added image
 

4. Stop the Artifactory Instance
5. Go to binary.xml path and edit the file

For applying the Direct Upload V1 mechanism 

<config version="3">
    <chain template="azure-blob-storage-direct"/>
    <provider type="cache-fs" id="cache-fs">
        <maxCacheSize>10000000000</maxCacheSize>
        <cacheProviderDir>/var/opt/jfrog/artifactory/data/cache</cacheProviderDir>
    </provider>
    <provider type="azure-blob-storage" id="azure-blob-storage">
        <endpoint>https://<ACCOUNT_NAME>.blob.core.windows.net/</endpoint>
        <multipartElementSize>100000000</multipartElementSize>
        <binariesDir>data/filestore</binariesDir>
        <accountName>XXXXX Copy from step 3 XXXXX</accountName>
        <containerName>testblob</containerName>
        <tempDir>temp</tempDir>
        <accountKey>XXXXXX Copy from step 3 XXXXXX</accountKey>
        <multiPartLimit>256000000</multiPartLimit>
    </provider>
</config>
 

For using the Eventual Upload mechanism

<config version="1">
    <chain template="azure-blob-storage"/>
    <provider type="azure-blob-storage" id="azure-blob-storage">
        <endpoint>https://<ACCOUNT_NAME>.blob.core.windows.net/</endpoint>
        <accountName>XXXXX Copy from step 3 XXXXX</accountName>
        <containerName>mytestblob1</containerName>
        <accountKey>XXXXX Copy from step 3 XXXXX</accountKey>
    </provider>
</config>

6. Restart the Artifactory Instance.

Check out this document to learn more about Azure Blob Storage with Artifactory.