この記事では、CData BizTalk アダプターを使用して取得したAzure Data Lake Storage を処理するスキーマを作り出す方法を紹介します。SELECT コマンド用のスキーマを作成します。
CData BizTalk Adapter for ADLS を使用して、Azure Data Lake Storage に標準のSQL コマンドを実行できます。
プロジェクトのAzure Data Lake Storage 用アダプターを追加する
以下のステップに従って、アダプターをBizTalk サーバープロジェクトに追加します。
- 未作成の場合は、Visual Studio で新規のBizTalk サーバープロジェクトを作成します。
- [Solution Explorer] の[project] で右クリックし、[Add] -> [Add Generated Items] と進みます。
- [resulting dialog box] の[Add Adapter Metadata] を選択します。
- 表示される[Add Adapter] ウィザードで、リストからアダプターを選択します。
- [Port menu] では、選択を空白のままにします。そのトランスポートタイプに合わせて構成されたアダプターを持つ受信場所や送信ポートを選択することもできます。
SQL コマンド用のスキーマを作り出す
[Add Adapter] ウィザードでアダプターを選択すると、[Schema] ウィザードが表示されます。以下のステップに従って接続プロパティを構成し、コマンドの結果のメタデータを取得します。
- BizTalk アプリで構成済みのアダプターを選択しなかった場合は、[Connection String] ページで、認証資格情報とその他の接続プロパティを入力します。下は一般的な接続文字列です。
Schema=ADLSGen2;Account=myAccount;FileSystem=myFileSystem;AccessKey=myAccessKey;
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.
- 次ページ[Schema Information] の[General Options] セクションで、アダプターの構成に応じて[Send Port] または[Receive Location] を選択します。
- 結果セット全体のスキーマを作成するには、[Message Mode]メニューの[Single Message] オプションを選択します。結果セットの行ごとに1つずつのスキーマを作成したい場合は、[Message Per Row] オプションを選択し、メッセージのルート要素が[row] であることを確認します。
- [Command Type] メニューで、SQL コマンドを選択します。
[Statement Information] ページの[SQL Command Text box] に、SQL コマンドを入力します。(受信場所や送信ポートが構成してある場合は、そのSQL コマンドがボックスに入力されます。)ここでは、下のクエリを使用します。
SELECT * FROM Resources
- ウィザードで表示される概要の設定を確認し、[Finish] をクリックしてschema.xsd ファイルを作成します。
スキーマの処理
簡易版BizTalk アプリでスキーマを利用する場合、 こちらのチュートリアルをご覧ください。