---
title: "カスタムストレージプロバイダーとプロファイル"
slug: "custom-storage-provider-and-profile"
abstract: "xConnect Data Exportツールでカスタムストレージプロバイダーとそのプロファイルを作成・設定する方法。"
---
# カスタムストレージプロバイダーとプロファイル

xConnect Data Export Toolを使ってカスタムストレージプロバイダーやプロファイルを作成できます。カスタムプロバイダーを使って、Sitecoreがデフォルトで含んでいないNASやクラウドプロバイダーなどのストレージ環境にデータをエクスポートします。

カスタムセットを作成するには:

1.  Visual Studioで新しいプロジェクトを作成します。 IStorageProviderインターフェースを継承していることを確認してください。データファイルが意図されたストレージにどのように保存されるかのロジックを定義します。例えば:
    
    /// <summary>
    /// Defines an interface for data storage providers.
    /// All the new storage providers must be inherited from this interface.
    /// </summary>
    public interface IStorageProvider
    {
     /// <summary>
     /// Gets the profile names that linked to the storage provider.
     /// Profile is named set of specific provider properties, for instance
     /// path to specific folder, credentials to establish connection to the storage, etc.
     /// </summary>
     IReadOnlyCollection<string> ProfileNames { get; }
     /// <summary>
     /// Uploads file with specified file name and content to the storage defined in
     /// the profile asynchronously.
     /// </summary>
     /// <param name="fileName">The file name.</param>
     /// <param name="fileContent">The file content.</param>
     /// <param name="profileName">The profile name.</param>
     /// <param name="cancellationToken">The cancellation token.</param>
     /// <returns>The task.</returns>
     Task UploadAsync(string fileName, string fileContent, string profileName, CancellationToken cancellationToken);
    }
    
2.  ストレージプロファイルを作成します。ストレージプロファイルは、プロファイル名プロパティのみを指定する必要があるIStorageProfileインターフェースを継承しなければなりません。例えば:
    
    internal interface IStorageProfile
    {
     string ProfileName { get; }
    }
    
3.  ストレージプロファイルで、ストレージプロバイダータイプに必要なプロパティを追加します。
    
4.  [新しいストレージプロバイダーとプロファイルを設定してください](https://doc.sitecore.com/xp/ja/developers/103/sitecore-experience-platform/configuring-a-storage-provider.html "Configuring a storage provider")。
    

プロファイルはストレージプロバイダーに注入しなければならず、UploadAsyncメソッドは指定されたプロファイル名で適切なプロファイルを取得し、ストレージ設定を取得する役割を担っています。