Ready to get started?

Download a free trial of the Azure Analysis Services Data Provider to get started:

 Download Now

Learn more:

Azure Analysis Services Icon Azure Analysis Services ADO.NET Provider

Rapidly create and deploy powerful .NET applications that integrate with Azure Analysis Services.

Automate Azure Analysis Services Integration Tasks from PowerShell

Are you in search of a quick and easy way to access Azure Analysis Services data from PowerShell? This article demonstrates how to utilize the Azure Analysis Services Cmdlets for tasks like connecting to Azure Analysis Services data, automating operations, downloading data, and more.

The CData ADO.NET Provider for Azure Analysis Services is a standard ADO.NET Provider that make it easy to accomplish data cleansing, normalization, backup, and other integration tasks by enabling real-time access to Azure Analysis Services.

ADO.NET Provider

The ADO.NET Provider provides a SQL interface for Azure Analysis Services; this tutorial shows how to use the Provider to retrieve Azure Analysis Services data.

Once you have acquired the necessary connection properties, accessing Azure Analysis Services data in PowerShell can be enabled in three steps.

To connect to Azure Analysis Services, set the Url property to a valid server, for instance, asazure://, 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.

  1. Load the provider's assembly:

    [Reflection.Assembly]::LoadFile("C:\Program Files\CData\CData ADO.NET Provider for Azure Analysis Services\lib\System.Data.CData.AAS.dll")
  2. Connect to Azure Analysis Services:

    $conn= New-Object System.Data.CData.AAS.AASConnection("URL=asazure://;InitiateOAuth=GETANDREFRESH") $conn.Open()
  3. Instantiate the AASDataAdapter, execute an SQL query, and output the results:

    $sql="SELECT Country, Education from Customer" $da= New-Object System.Data.CData.AAS.AASDataAdapter($sql, $conn) $dt= New-Object System.Data.DataTable $da.Fill($dt) $dt.Rows | foreach { Write-Host $ $ }