Skip to content

File Transfer: Azure Blob Storage to Amazon S3

Deprecated

This tutorial is kept for reference. It may not match the current Eclipse Tractus-X release. All tutorials

1. Description

This tutorial illustrates the process through which a provider participant can transfer a file stored in its Azure Blob Storage to Amazon S3 belonging to a consumer participant.
For this tutorial, we assume Alice as a provider participant and Bob as consumer participant.

  • We use a self-contained version of Amazon S3 named MinIO, and we deploy two instances, one each for Alice and Bob.
  • We also use a self-contained version of Azure Blob Storage named Azurite, and we deploy single Azurite instance for both connectors, due to a limitation in overriding endpoints during trasfer process.

2. Prerequisites

This tutorial is similar to existing tutorial File Transfer: Azure Blob Storage to Azure Blob Storage. Only difference is in the initiate transfer process. So please follow existing tutorial to initiate negotiation.

3. Initiate Transfer

While initiating transfer, we need to provide a data destination, so in this case we will be providing an Amazon S3 destination.

curl --location 'http://localhost/bob/management/v2/transferprocesses' \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: password' \
--data-raw '{
  "@context": {
    "odrl": "http://www.w3.org/ns/odrl/2/"
  },
  "assetId": "<Asset Id>",
  "connectorAddress": "http://alice-controlplane:8084/api/v1/dsp",
  "connectorId": "BPNL000000000001",
  "contractId": "<Contract Agreement Id from Get Negotiation Response>",
  "dataDestination": {
    "type": "AmazonS3",
    "keyName": "alice-test-document.txt",
    "bucketName": "bob-bucket",
    "region": "us-east-1",
    "endpointOverride": "http://bob-minio:9000",
    "accessKeyId": "bobawsclient",
    "secretAccessKey": "bobawssecret"
  },
  "protocol": "dataspace-protocol-http"
}'

This API should return below response.

{
  "@type": "IdResponse",
  "@id": "b227dc51-8108-44cb-bc62-dea7bea56482",
  "createdAt": 1700740670220,
  "@context": {
    "@vocab": "https://w3id.org/edc/v0.0.1/ns/",
    "edc": "https://w3id.org/edc/v0.0.1/ns/",
    "tx": "https://w3id.org/tractusx/v0.0.1/ns/",
    "odrl": "http://www.w3.org/ns/odrl/2/"
  }
}

Please take note of the transfer process id (@id field) in the response.

4. Get Transfer

Just wait for few seconds and check the transfer state. Please replace transfer process id before running command.

curl --location 'http://localhost/bob/management/v2/transferprocesses/<TRANSFER_PROCESS_ID>' \
--header 'X-Api-Key: password'

It should return below response:

{
  "@id": "b227dc51-8108-44cb-bc62-dea7bea56482",
  "@type": "TransferProcess",
  "correlationId": "b227dc51-8108-44cb-bc62-dea7bea56482",
  "state": "COMPLETED",
  "stateTimestamp": 1704173831187,
  "type": "CONSUMER",
  "assetId": "30",
  "contractId": "e0b386a4-c46f-4d38-bbe0-6db2dfccf0e2",
  "callbackAddresses": [],
  "dataDestination": {
    "@type": "DataAddress",
    "secretAccessKey": "bobawssecret",
    "accessKeyId": "bobawsclient",
    "endpointOverride": "http://bob-minio:9000",
    "region": "us-east-1",
    "type": "AmazonS3",
    "keyName": "alice-test-document.txt",
    "bucketName": "bob-bucket"
  },
  "connectorId": "BPNL000000000001",
  "@context": {
    "@vocab": "https://w3id.org/edc/v0.0.1/ns/",
    "edc": "https://w3id.org/edc/v0.0.1/ns/",
    "tx": "https://w3id.org/tractusx/v0.0.1/ns/",
    "odrl": "http://www.w3.org/ns/odrl/2/"
  }
}

Please note, state should be COMPLETED. If it is TERMINATED, it means, transfer has failed. Please check logs for more details.

Once transfer has completed, the asset file should be available in bob-bucket.

About this tutorial

Version
v2.2
Added
Aug 2023
Updated
Mar 2025

Authors

Versions

  1. 1.0 Aug 2023 First published.
  2. 2.0 Nov 2024 IdentityHub and STS replace MIW and Keycloak.
  3. 2.1 Jan 2025 IdentityHub upgrade.
  4. 2.2 Mar 2025 DCP issuance, Tractus-X EDC 0.9.