製品をチェック

製品の情報と無償トライアル:

Azure Analysis Services 連携ソリューション

データ連携でお困りですか?

お問い合わせ

PowerShell Cmdlets でAzure Analysis Services データをCSV にエクスポート


標準PowerShell cmdlets を使ってAzure Analysis Services テーブルにアクセスして、CSV にエクスポート。


azureanalysisservices ロゴ画像
powershell ロゴ画像

Cmdlets

PowerShell ロゴ画像

CData Cmdlets Module for AAS は、直感的なAzure Analysis Services データ連携を提供する標準cmdlet です。 本記事では、AAS Cmdlets を使ったサンプルを提供します。

Azure Analysis Services への接続を設定

To connect to Azure Analysis Services, set the Url property to a valid server, for instance, asazure://southcentralus.asazure.windows.net/server, in addition to authenticating. Optionally, set Database to distinguish which Azure database on the server to connect to.

Azure Analysis Services uses the OAuth authentication standard. OAuth requires the authenticating user to interact with Azure Analysis Services using the browser. You can connect without setting any connection properties for your user credentials. See the Help documentation for more information.

$conn = Connect-AAS  -URL "$URL"

Azure Analysis Services データを取得してCSV にパイプライン

次の手順で、Customer テーブルデータを取得して、結果をCSV ファイルにエクスポートします:

Select-AAS -Connection $conn -Table Customer | Select -Property * -ExcludeProperty Connection,Table,Columns | Export-Csv -Path c:\myCustomerData.csv -NoTypeInformation

このように、Select-AAS から取得した結果を、Select-Object cmdlet に流し、Export-Csv cmdlet に渡す前にいくつかのプロパティを除外しています。これは、CData Cmdlets が接続情報、テーブル、およびカラム情報が結果セットのそれぞれの"行"に挿入されるためです。それらの情報を表示したくない場合に、Export-Csv cmdlet に渡す前に除外を先に行い、それからCSV ファイルにエクスポートします。。

CData Cmdlets から、次のCmdlets にデータをパイプラインするところでは、接続、テーブル、カラムの情報が必要です。

このように、CData Cmdlets でデータ連携をシンプルに構成できます。Cmdlets では、モジュールのインストール、接続プロパティの設定だけで、データ連携の構築を始めることができます。是非、CData PowerShell Cmdlets の無償試用版をダウンロードして、シンプルかつパワフルなデータ連携を体感してください。