Manage Models
This document provides guidance on how to manage models in Azure Analysis Services. Managing models involves tasks such as creating, deploying, updating, and deleting tabular or multidimensional models.
Using Visual Studio with Analysis Services Projects
The primary tool for developing and managing Analysis Services models is Visual Studio with the SQL Server Data Tools (SSDT) extension. This allows you to create, modify, and deploy your models.
- Open Visual Studio and create a new Analysis Services project (either Tabular or Multidimensional).
- Design your model by adding data sources, tables, relationships, and calculations (e.g., DAX measures for Tabular, MDX for Multidimensional).
- Deploy the model: Right-click on the project in Solution Explorer and select "Deploy". You will be prompted to enter the server name.
- Update the model: Make changes to your model in Visual Studio and redeploy. You can choose to update existing tables or entire databases.
Using SQL Server Management Studio (SSMS)
SQL Server Management Studio (SSMS) can be used to connect to your Azure Analysis Services server and perform administrative tasks, including managing models.
- Connect to your Azure Analysis Services server using SSMS.
- Navigate to the Databases folder to see your deployed models (databases).
- You can perform operations like backup, restore, and scripting of existing models.
Using Tabular Editor
Tabular Editor is a popular third-party tool that provides an advanced way to work with tabular models. It offers a rich object model editor, scripting capabilities, and integration with source control.
- Download and install Tabular Editor.
- Connect to your Azure Analysis Services server.
- Edit model objects, write C# scripts for automation, and deploy changes directly.
Common Model Management Tasks
Deploying a Model
Deployment typically involves publishing your model project from Visual Studio to an Azure Analysis Services instance. Ensure you have the correct server name and permissions.
Updating a Model
When you need to make changes, update your model in Visual Studio or your chosen tool. During deployment, you'll have options to:
- Update the entire database: Replaces the existing model with the new version.
- Update specific tables: Refreshes only the selected tables, preserving other model elements.
Refreshing Data
After deploying or updating a model, you'll likely need to refresh the data within the model. This can be done:
- Through Visual Studio: Right-click on a table and select "Refresh".
- Through SSMS: Right-click on the database, navigate to "Data sources", right-click on a data source, and select "Refresh".
- Using the TOM (Tabular Object Model) API: Programmatically trigger data refreshes.
- Using Azure Data Factory or Power BI dataflows: Schedule data refreshes as part of a data pipeline.
Backup and Restore
Regular backups are crucial for disaster recovery and version control. You can perform backups and restores using:
- SSMS: Right-click on the database and select "Tasks" -> "Backup" or "Restore".
- PowerShell cmdlets: Use the
New-ASAzureBackupandRestore-ASAzureBackupcmdlets. - Azure portal: Configure automated backups.
Deleting a Model
To delete a model (database) from your Azure Analysis Services server:
- Connect using SSMS, right-click on the database, and select "Delete".
- Use PowerShell cmdlets like
Remove-ASAzureModel. - Utilize the Azure portal interface.
Permissions and Role Management
Access to models and their management capabilities is controlled by permissions. Ensure users have the appropriate roles assigned to manage specific models or the entire Analysis Services instance.
Considerations for Large Models
For very large models, consider the following:
- Optimize data sources and queries to reduce processing time.
- Implement incremental refresh strategies where possible.
- Monitor server performance and resource utilization.
- Partitioning large tables can improve performance and manageability.