Manage Data Sources

This document provides guidance on how to manage data sources within Azure Analysis Services. Properly configured data sources are crucial for connecting your models to the underlying data. This includes understanding connection strings, credentials, and data source types.

Understanding Data Source Objects

In Azure Analysis Services, a data source object represents a connection to a single data source, such as a SQL Server database, Azure SQL Database, or an Azure Blob Storage file. You can define multiple data sources within a single Analysis Services model.

Creating a Data Source

You can create data sources using tools like Visual Studio with SQL Server Data Tools (SSDT) or by scripting with AMO (Analysis Management Objects) or TOM (Tabular Object Model).

Using Visual Studio (SSDT)

  1. Open your Azure Analysis Services project in Visual Studio.
  2. In Solution Explorer, right-click on the Data Sources folder and select Add Data Source.
  3. The Data Source Wizard will appear.
  4. Select the appropriate data source type from the Type dropdown. Common types include:
    • SQL Server
    • Azure SQL Database
    • Azure Blob Storage
    • Oracle
    • Teradata
  5. Enter the server name and database name (if applicable).
  6. Configure authentication settings. You can use Windows authentication or a specific user account. For cloud sources, you might use Azure Active Directory authentication.
  7. Test the connection to ensure it's valid.
  8. Click Finish to create the data source.

Editing an Existing Data Source

To modify an existing data source:

  1. In Solution Explorer, double-click the data source you want to edit.
  2. The Data Source Editor will open.
  3. You can update the server name, database name, or authentication details.
  4. Click OK to save your changes.

Data Source Types and Connection Strings

The connection string is a critical component of a data source object. It specifies how Analysis Services connects to the data provider. Here are some common examples:

SQL Server Connection String Example

Provider=SQLNCLI11;Server=YourServerName;Database=YourDatabaseName;UID=YourUsername;PWD=YourPassword;

Azure SQL Database Connection String Example

Provider=SQLNCLI11;Server=tcp:your_azure_sql_server.database.windows.net,1433;Database=your_database;Uid=your_admin_login@your_azure_sql_server;Pwd=your_password;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;

Azure Blob Storage Connection String Example

Provider=Microsoft.Mashup.OleDb.1;Data Source=https://yourstorageaccount.blob.core.windows.net/yourcontainer;Initial Catalog=;Persist Security Info=False;

When using Azure Blob Storage, you will typically provide credentials through the UI or manage them separately.

Note: It's recommended to use secure methods for storing and managing credentials, such as Azure Key Vault or Windows Integrated Authentication where possible, rather than hardcoding passwords directly in connection strings.

Managing Credentials

Credentials can be managed in several ways:

Configuring Azure AD Authentication

For Azure data sources like Azure SQL Database or Azure Data Lake Storage, configuring Azure AD authentication is the preferred method:

  1. Ensure your Analysis Services instance and the data source are configured for Azure AD authentication.
  2. When creating or editing a data source, select Azure Active Directory as the authentication type.
  3. You will typically need to specify the Tenant ID, Client ID (for a service principal), and optionally a Client Secret or Certificate.
  4. Alternatively, you can use the Analysis Services service identity if it's granted permissions to the data source.
Tip: Regularly review and update credentials, especially if using hardcoded passwords or expiring keys. Automating this process with Azure Key Vault can significantly enhance security.

Data Source Views

Data Source Views (DSVs) provide a logical layer over the physical data sources. They allow you to rename columns, define relationships, and hide sensitive information before it's exposed to the model. When you create a data source, you will often create a DSV based on it.

Best Practices

Important: Changes to data source connections, especially in production, should be planned and tested thoroughly to avoid disruption to your reporting and analytics.