Processing and Deployment

Analysis Services Tutorials - Microsoft Developer Network

This tutorial covers the essential steps involved in processing and deploying your Microsoft SQL Server Analysis Services (SSAS) multidimensional or tabular models. Proper processing ensures your data is up-to-date, and effective deployment makes your models accessible to users and applications.

Understanding Processing

Processing is the act of populating an Analysis Services object (such as a database, cube, dimension, or measure group) with data from its underlying data sources. SSAS supports various processing modes to manage data refresh efficiently.

Processing Modes

When to Process

Processing is typically performed after:

Note: For large models, consider processing objects individually or in a specific order to optimize performance and manage dependencies.

Deployment Strategies

Deploying your Analysis Services model makes it available for querying by client applications like Power BI, Excel, or custom applications. You can deploy models directly from Visual Studio or use deployment utilities.

Deploying from Visual Studio

The most common method for deploying SSAS models is directly from the SQL Server Data Tools (SSDT) project within Visual Studio:

  1. Right-click on the SSAS project in Solution Explorer.
  2. Select "Deploy".
  3. In the "Analysis Services Deployment Wizard", specify the server name and database name for the target environment.
  4. Configure deployment options, such as processing options and connection strings.
  5. Review the summary and click "Finish" to start the deployment.

Deployment Wizard and Configuration Files

The Deployment Wizard creates an XMLA (XML for Analysis) deployment script. You can customize this script or generate it independently to control deployment parameters:

Tip: Use SQL Server Management Studio (SSMS) to execute the generated XMLA deployment script for more granular control or automation.

Automating Processing and Deployment

For production environments, automating processing and deployment is crucial for timely data refreshes and consistent model availability.

SQL Server Agent Jobs

You can schedule SQL Server Agent jobs to execute SSAS processing and deployment tasks:

PowerShell Scripts

PowerShell offers powerful scripting capabilities for managing SSAS:


# Example: Deploying an SSAS model using PowerShell
$deployPath = "C:\Path\To\Your\SSASProject\bin\Development\"
$serverName = "YourAnalysisServicesServer"
$databaseName = "YourDatabaseName"

& "C:\Program Files (x86)\Microsoft SQL Server\150\Tools\Binn\Microsoft.AnalysisServices.Deployment.exe" `
    /s:`"$deployPath\Model.asdatabase`" `
    /a:`"$deployPath\deploymentscript.xmla`" `
    /d:`"$serverName`" `
    /DatabaseName:`"$databaseName`" `
    /ConfigurationFile:`"$deployPath\DeploymentConfiguration.deploymentoptions`"
            

Best Practices