Microsoft Docs

Connect to Azure Analysis Services

This document outlines the various methods and tools you can use to connect to your Azure Analysis Services (AAS) server. Understanding these connection methods is crucial for interacting with your tabular models, whether for administration, development, or data analysis.

Connection String Formats

The primary way to connect to an Azure Analysis Services server is by using a connection string. The format of the connection string depends on the client tool or application you are using.

General Format

The most common format involves specifying the server name:

"Provider=MSOLAP;Data Source=.asazure.windows.net;"

Authentication Methods

Azure Analysis Services supports several authentication methods:

  • Azure Active Directory (Azure AD) Authentication: This is the recommended and most secure method. You can authenticate using your Azure AD user credentials, a service principal, or managed identity.
  • SQL Server Management Studio (SSMS): When connecting from SSMS, you can typically use "Azure Active Directory - Universal with MFA" or "Azure Active Directory - Password".
  • Power BI Desktop: Power BI Desktop seamlessly integrates with Azure AD for authentication.
  • Visual Studio with Analysis Services Projects: Similar to SSMS, Visual Studio allows for Azure AD authentication.
Note: Always use Azure AD authentication for enhanced security and centralized identity management.

Connecting with Common Tools

1. SQL Server Management Studio (SSMS)

SSMS is a powerful tool for managing and querying Analysis Services. To connect:

  1. Open SSMS and select "Analysis Services" as the Server type.
  2. Enter your server name in the format <your_server_name>.asazure.windows.net.
  3. Choose an "Authentication" method. For Azure AD, select "Azure Active Directory - Universal with MFA".
  4. Click "Connect". You will be prompted to sign in with your Azure AD credentials.

2. Power BI Desktop

Connecting to Azure Analysis Services from Power BI is straightforward:

  1. In Power BI Desktop, go to Get data.
  2. Select Azure and then Azure Analysis Services database.
  3. Enter your server name.
  4. Choose the connection mode (Import or Live Connection). Live Connection is generally preferred for AAS.
  5. Click "OK". You will be prompted to sign in via Azure AD.

3. Visual Studio (Analysis Services Projects)

For developing tabular models, Visual Studio is the go-to tool:

  1. Create or open an Analysis Services Tabular Project.
  2. In the Server Explorer, right-click "Analysis Services" and select "Add Connection...".
  3. Enter your server name (e.g., <your_server_name>.asazure.windows.net).
  4. Choose your authentication method (e.g., Azure Active Directory).
  5. Click "Connect".

4. Programmatic Connections (Client Libraries)

You can connect programmatically using various client libraries:

  • AMO (Analysis Management Objects): For server administration tasks.
  • ADOMD.NET: For querying and data retrieval.
  • XMLA (XML for Analysis): The underlying protocol used by most clients.

Here's a C# example using ADOMD.NET:

using Microsoft.AnalysisServices.AdomdClient;

// ...

string serverName = ".asazure.windows.net";
string connectionString = $"Provider=MSOLAP;Data Source={serverName};";

using (var connection = new AdomdConnection(connectionString))
{
    try
    {
        connection.AccessToken = GetAzureADToken(); // Implement your token retrieval logic
        connection.Open();
        Console.WriteLine("Successfully connected to Azure Analysis Services!");
        // Perform queries or other operations
    }
    catch (Exception ex)
    {
        Console.WriteLine($"Connection failed: {ex.Message}");
    }
}

// Placeholder for token acquisition
string GetAzureADToken()
{
    // Implement logic to acquire an Azure AD token (e.g., using MSAL)
    return "YOUR_ACCESS_TOKEN";
}
Tip: Ensure your firewall rules on Azure Analysis Services are configured to allow connections from your IP address or virtual network.

Troubleshooting Connection Issues

  • Incorrect Server Name: Double-check the spelling and ensure you've included the .asazure.windows.net suffix.
  • Firewall Rules: Verify that your client's IP address is allowed in the AAS firewall settings.
  • Azure AD Permissions: Confirm that the user or service principal has the necessary permissions (e.g., database reader role) on the AAS database.
  • Authentication Errors: Ensure you are using the correct Azure AD credentials and that Multi-Factor Authentication (MFA) is handled appropriately.