2017-12-04 11 views
1

あるフォルダから別のフォルダに、一定数のAzureブロブをコピーして、ダウンストリームサービスがそれらを使用できるようにする必要があります。私はAzure Data Factory(ADF)のアクティビティ "Copy"を使ってこれを行っています。コピー中にAzure Blobストレージ内に複数のファイルを連結する

要件は最近変更され、他のサービスはファイルを1つのファイルに連結することを期待しています(フォルダ内のすべてのファイルは同じレイアウトのテキストファイルです)。これを行うためにADFコピー・アクティビティ内にオプションが表示されませんでした。 PowerShellなどでスクリプトを作成する以外のADFアクティビティを使用する方法はありますか?

答えて

0

これは絶対に可能です。カスタムADFパイプラインコンポーネントを作成し、IDotNetActivityインタフェース、より正確な

public IDictionary<string, string> Execute(IEnumerable<LinkedService> linkedServices, 
       IEnumerable<Dataset> datasets, Activity activity, IActivityLogger logger) 
      { 
//PipelineConfiguration(...) // configure your pipeline/activity 
// some code if needed 
      do 
      { 
       BlobResultSegment blobList; 
       // Get the list of input blobs from the input storage client object. 
       blobList = prodAzureStorageClient.ListBlobsSegmented($"{fileContainer}/{fileMask_ifAny}", 
                     true, // Use flat blob listing 
                     BlobListingDetails.Metadata, 
                     null, // Max results, null = 5000 
                     continuationToken, 
                     null, // Blob request options 
                     null // Operation context 
                    ); 
       blobs.AddRange(blobList.Results); 

       continuationToken = blobList.ContinuationToken; 
      } while (continuationToken != null); 

// Read files here and concatenate them by you rules 

// Upload concatenated file to Azure Blob Storage 
    } 

挨拶

を実装する必要があります
関連する問題