Power BI を使えば会社のデータを美しいビジュアルに変換して収集および整理することができるため、重要なことだけに集中できます。CData Connect Server と組み合わせると、ビジュアライゼーションやダッシュボードなどのためにAzure Data Lake Storage データを使用できます。この記事では、Power BI のAzure Data Lake Storage データからデータセットをデータ構築して公開し、Power BI サービスのAzure Data Lake Storage データに関するレポートを作成する方法について説明します。
CData Connect Server は、Azure Data Lake Storage に純粋なSQL インターフェースを提供し、データベースにデータを複製することなくPower BI のライブAzure Data Lake Storage データから簡単にレポートを作成できるようにします。ビジュアライゼーションを作成する際には、Power BI がデータを収集するためのSQL クエリを生成します。CData Connect Server は、最適化されたデータ処理を使用してサポートされているすべてのSQL 操作(フィルタ、JOIN など)をAzure Data Lake Storage に直接プッシュし、サーバーサイドの処理を利用して、Azure Data Lake Storage データを素早く返します。
注意:(オンプレミスゲートウェイを使用する代わりに)Connect Server を介してAzure Data Lake Storage データをPower BI にインポートすることもできます。詳細については、関連するKnowledge Base の記事を参照してください。
Azure Data Lake Storage データの仮想SQL データベースを作成
CData Connect Server は、簡単なポイントアンドクリックインターフェースを使用してAPI を生成します。
- Connect Server にログインし、「Databases」をクリックします。
- 「Available Data Sources」から「Azure Data Lake Storage」を選択します。
-
必要な認証プロパティを入力し、Azure Data Lake Storage に接続します。
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.
- 「 Test Database」をクリックします。
- 「Permission」->「 Add」とクリックし、適切な権限を持つ新しいユーザー(または既存のユーザー)を追加します。
Power BI からConnect Server に接続
Power BI サービスでライブAzure Data Lake Storage データに接続してビジュアライズするには、オンプレミスデータゲートウェイをインストールしてPower BI サービスからゲートウェイにデータソースを追加し、Power BI Desktop からサービスにデータセットを公開します。
オンプレミスデータゲートウェイをインストール
Microsoft オンプレミスデータゲートウェイは、接続されたデータソースとさまざまなMicrosoft ツールおよびプラットフォーム間の安全なデータ転送を提供します。ゲートウェイの詳細については、Microsoft のドキュメントを参照してください。
Power BI サービスからゲートウェイをダウンロードし、インストールできます。
- PowerBI.com にログインします。
- 「Download」メニューをクリックし、「Data Gateway」をクリックします。
![Download the Data Gateway]()
- インストールの手順に従ってゲートウェイの名前をメモします。
Azure Data Lake Storage をデータソースとしてPower BI サービスに追加
データゲートウェイをインストールしたら、Connect Server をデータソースとしてPower BI サービスに追加します。
- PowerBI.com にログインします。
- 「Settings」メニューをクリックして「Manage gateways」をクリックします。
![Settings -> Manage gateways]()
- 「ADD DATA SOURCE」をクリックしてConnect Server への接続を構成します。
- Data Source Name をConnect_ADLS に設定します。
- Data Source Type としてSQL Server を選択します。
- Server をConnect Server インスタンスのアドレスに設定します。(例:CONNECT_SERVER_URL)
- Database を仮想Azure Data Lake Storage データベースの名前に設定します。(例:azuredatalakedb)
- Authentication Method をBasic に設定します。
- Username とPassword をConnect Server 資格情報に設定します。
Power BI デスクトップから、データセットを公開
ゲートウェイをインストールし、Connect Server をデータソースとしてPower BI サービスに追加すると、Power BI Desktop からサービスにデータセットを公開できます。
- Power BIを開いて「Get Data」->「More」とクリックし、SQL Server データベースを選択して「Connect」をクリックします。
- 接続プロパティを設定設定し、「OK」をクリックします。
- Server をConnect Server インスタンスのアドレスに設定します。(例:CONNECT_SERVER_URL)
- Database を仮想Azure Data Lake Storage データベースの名前に設定します。(例:azuredatalakedb)
- Data Connectivity mode をDirectQuery* に設定します。
* DirectQuery は、Azure Data Lake Storage データのライブクエリ処理とリアルタイムのビジュアライゼーションを可能にします。
- 「authentication」ウィザードで「Database」を選択してUser name とPassword のプロパティを設定し、「Connect」をクリックします。
- 「Navigator」ダイアログでテーブルを選択し、ビジュアライズします。
「Query Editor」では、Azure Data Lake Storage カラムをフィルタリング、並べ替え、要約することでデータセットをカスタマイズできます。「Edit」をクリックしてクエリエディタを開きます。行をフィルターするには、行を右クリックします。カラムヘッダーを右クリックして、次のようなアクションを実行します。
- カラムのデータタイプを変更
- カラムの削除
- カラムをグループ化
Power BI は、Connect Server によって報告されたAzure Data Lake Storage メタデータから、各カラムのデータタイプを検出します。
Power BI は、クエリへの変更を「Applied Steps」セクションに記録し、リモートAzure Data Lake Storage データに対して実行される、基礎となるデータ取得クエリを調整します。「Close and Apply」をクリックすると、Power BI はデータ取得クエリを実行します。
もしくは、「Load」をクリックしてデータをPower BI にプルします。
- 「Relationships」タブで選択したエンティティ間の関係性を定義します。
- 「Home」メニューから「Publish」をクリックして「Workspace」を選択します。
Power BI Service のAzure Data Lake Storage データでレポートとダッシュボードを作成
Power BI サービスにデータセットを公開したので、公開されたデータに基づいて新しいレポートとダッシュボードを作成できます。
- PowerBI.com にログインします。
- 「Workspaces」をクリックし、ワークスペースを選択します。
- 「Create」をクリックし、「Report」を選択します。
- レポートに使用する公開済みデータセットを選択します。
![Select a dataset]()
- フィールドとビジュアライゼーションを選択してレポートを追加します。
![Visualizing Azure Data Lake Storage data in the Power BI service]()
アプリケーションからAzure Data Lake Storage データへSQL アクセス
Power BI サービスからライブAzure Data Lake Storage データへの直接接続ができるようになりました。これで、Azure Data Lake Storage を複製せずにより多くのデータソースや新しいビジュアライゼーション、レポートを作成することができます。
アプリケーションから直接240+ SaaS 、Big Data 、NoSQL ソースへのSQL データアクセスを取得するには、CData Connect Server を参照してください。