FLEXSCHE はあらゆる生産ルールに対応可能な柔軟性と拡張性を備えた生産スケジューラで、さまざまな業界・業種へ導入実績があります。
この記事では、FLEXSCHE と CData ADO.NET Provider を使って、FLEXSCHE へAzure Data Lake Storage からデータを取り込む方法を紹介します。
CData ADO.NET Provider
まずCData ADO.NET Provider を対象の環境にセットアップします。
- 30日の無償評価版のページからダウンロードし、FLEXSCHE と同じマシンでセットアップします。
データソース接続の設定
それでは、ここからFLEXSCHE 上でデータを取り込むための設定を行います。
- 「ファイル」メニューから「外部データソース」の「EDIF構成ツールを起動」を選択し、「EDIF構成ツール」を開きます。
- メニューの「マッピング」から「テーブルマッピングを追加」を選択し、「テーブルのマッピング設定」ダイアログを開きます。 対象とするFLEXSCHE テーブルを選択します。
- ここでマッピングの外部テーブルとしてAzure Data Lake Storage のデータを参照する設定を行います。「外部テーブル」で「<<新規>>」を選択すると「データソース設定」ダイアログが開きます。
- 「種類」を「.NET Frameworkデータ接続(ADO.NET)」にします。「プロバイダー」をインストールしたADO.NETドライバーにします。
- 続いて接続の詳細設定を行います。「接続文字列」の横にあるボタンを押下すると「接続文字列」ダイアログが開きます。 この画面で認証やプロキシ、ログ出力などの設定を行います。
Authenticating to a Gen 1 DataLakeStore Account
Gen 1 uses OAuth 2.0 in Azure AD for authentication.
For this, an Active Directory web application is required. You can create one as follows:
- Sign in to your Azure Account through the
[.
]- Select "Azure Active Directory".
- Select "App registrations".
- Select "New application registration".
- Provide a name and URL for the application. Select Web app for the type of application you want to create.
- Select "Required permissions" and change the required permissions for this app. At a minimum, "Azure Data Lake" and "Windows Azure Service Management API" are required.
- Select "Key" and generate a new key. Add a description, a duration, and take note of the generated key. You won't be able to see it again.
To authenticate against a Gen 1 DataLakeStore account, the following properties are required:
- Schema: Set this to ADLSGen1.
- Account: Set this to the name of the account.
- OAuthClientId: Set this to the application Id of the app you created.
- OAuthClientSecret: Set this to the key generated for the app you created.
- TenantId: Set this to the tenant Id. See the property for more information on how to acquire this.
- Directory: Set this to the path which will be used to store the replicated file. If not specified, the root directory will be used.
Authenticating to a Gen 2 DataLakeStore Account
To authenticate against a Gen 2 DataLakeStore account, the following properties are required:
- Schema: Set this to ADLSGen2.
- Account: Set this to the name of the account.
- FileSystem: Set this to the file system which will be used for this account.
- AccessKey: Set this to the access key which will be used to authenticate the calls to the API. See the property for more information on how to acquire this.
- Directory: Set this to the path which will be used to store the replicated file. If not specified, the root directory will be used.
- 「接続文字列」画面でプロパティを編集したら「テスト接続」を押下して接続を確認してください。 「接続に成功しました。」というメッセージが表示されれば接続設定は完了です。
データソースの対象テーブルの選択
次に接続先のテーブルを選択します。
- 「データソース設定」ダイアログの「テーブル名」の右のボタンを押下し「テーブルの検索」画面を開いてください。 検索対象が「Tables」になっていることを確認し「検索」ボタンを押下します。
Azure Data Lake Storage のテーブル一覧が表示されるので、対象のテーブルを選択します。
- 「データソース設定」ダイアログの「OK」を押下すると、外部テーブルへの接続情報が「テーブルのマッピング設定」画面の「外部テーブル」に反映されます。
- 「OK」を押下し「テーブルのマッピング設定」画面を閉じます。
フィールドマッピングの設定
続いてフィールドマッピングを行います。
- マッピングするテーブル情報の設定が完了すると、「EDIF構成ツール」ダイアログにフィールドマッピングを設定するタブが表示されます。
FLEXSCHE のテーブルとAzure Data Lake Storage のテーブルのカラムをそれぞれ対応付けます。
- 設定が完了しましたらマッピングを保存し、「EDIF構成ツール」を閉じてください。
データのインポートと確認
それでは実際にFLEXSCHE にデータが取り込めるか確認してみましょう。
- 「ファイル」メニューの「外部データソース」にある「EDIFインポート」をクリックするとデータのインポートが実行されます。 FLEXSCHE のデータを確認し、Azure Data Lake Storage にあるデータが表示されれば成功です。
このようにCData ODBC Driver for ADLS とFLEXSCHE を組み合わせることで、簡単にAzure Data Lake Storage データを活用した連携を実現できます。ぜひ、30日の無償評価版をお試しください。