Connect to Azure Analysis Services
This document provides comprehensive guidance on various methods to connect to your Azure Analysis Services (AAS) instance from different client applications and tools.
Connection Strings
The primary way to connect to Azure Analysis Services is by using a connection string. The general format is:
"Provider=MSOLAP;Data Source=asazure://.asazure.windows.net/;Initial Catalog=;"
Key Components:
- Provider: Typically
MSOLAP
for Analysis Services. - Data Source: The fully qualified server name. The format is
asazure://<region>.asazure.windows.net/<servername>
. - Initial Catalog: The name of the Analysis Services database you want to connect to.
Tip:
For security best practices, it is recommended to use Azure Active Directory (Azure AD) authentication (formerly Office 365 or Microsoft account) instead of username/password authentication where possible.
Connecting with SQL Server Management Studio (SSMS)
- Open SQL Server Management Studio.
- In the 'Connect to Server' dialog, select 'Analysis Services' for the 'Server type'.
- Enter your Azure Analysis Services server name in the 'Server name' field (e.g.,
asazure://eastus.asazure.windows.net/My AAS Server
). - For authentication, you can choose 'Windows Authentication' if your Azure AD account is configured for integrated authentication, or 'Azure Active Directory - Universal with MFA' or 'Azure Active Directory - Password' for Azure AD authentication.
- Click 'Connect'.
Connecting with Power BI Desktop
- Open Power BI Desktop.
- On the 'Home' tab, click 'Get Data'.
- Select 'Azure' and then 'Azure Analysis Services database'.
- Enter your Azure Analysis Services server name in the 'Server' field.
- Choose the 'Connect live' option for a live connection.
- Click 'OK'.
- You will be prompted to authenticate using your Azure AD credentials.
Connecting with Tabular Editor
Tabular Editor is a popular third-party tool for working with Analysis Services models.
- Open Tabular Editor.
- Click 'File' > 'Open' > 'From server...'.
- Enter your server name in the 'Server Name' field.
- Select your authentication method and provide credentials.
- Click 'Connect'.
Connecting with Visual Studio (for model development)
You can connect to Azure Analysis Services directly from Visual Studio to develop and deploy tabular models.
- In Visual Studio, select 'File' > 'Open' > 'Project/Solution'.
- If you have an existing tabular project, open it. If not, create a new 'Analysis Services Tabular Project'.
- In the 'Solution Explorer', right-click on 'Data Sources' and select 'Add Data Source'.
- Choose 'Analysis Services' as the data source type.
- Enter your Azure Analysis Services server name in the 'Server Name' field.
- Follow the prompts to authenticate.
Connecting with DAX Studio
DAX Studio is a tool for writing and executing DAX queries.
- Download and open DAX Studio.
- Click the 'Connect' button.
- Select 'Azure Analysis Services' from the dropdown.
- Enter your server name.
- Choose your authentication method.
- Click 'Connect'.
Note:
When connecting to Azure Analysis Services, ensure that your network firewall rules and Azure AD access permissions are correctly configured to allow access from your client machine or application.
Programmatic Connection (e.g., C# with AMO/ADOMD.NET)
You can also connect programmatically using libraries like AMO (Analysis Services Management Objects) or ADOMD.NET.
ADOMD.NET Example:
using Microsoft.AnalysisServices.AdomdClient;
string connectionString = "Provider=MSOLAP;Data Source=asazure://eastus.asazure.windows.net/MyAASServer;Initial Catalog=MyDatabase;";
using (var client = new AdomdConnection(connectionString))
{
client.AccessToken = GetMyAzureADAccessToken(); // Implement this method to get a valid token
client.Open();
// Perform operations using the client object
Console.WriteLine($"Connected to server: {client.ServerInfo.ProductName}");
}
// Implement GetMyAzureADAccessToken() to acquire a token for Azure AD authentication
// This typically involves using MSAL (Microsoft Authentication Library)
public string GetMyAzureADAccessToken()
{
// ... implementation to get token ...
return "your_access_token";
}
Important:
When using programmatic connections with Azure AD, you will need to register an application in Azure AD and obtain appropriate permissions for your application to access Azure Analysis Services.