You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何通过TFS 2015命令行自动部署SSAS Cube项目?

Deploying SSAS Cube Projects to SQL Server 2016 via TFS 2015 (Command Line)

Great question! Since you're already comfortable using sqlpackage.exe for traditional database deployments, SSAS Cube projects rely on a dedicated tool for command-line automation: Microsoft.AnalysisServices.Deployment.exe. This utility is designed specifically for SSAS deployments and integrates seamlessly with TFS 2015 build pipelines.

Core Command Line Syntax

The basic structure for deploying an SSAS project directly via command line looks like this:

Microsoft.AnalysisServices.Deployment.exe "<PathToYourASDatabaseFile>" /s:"<PathToDeploymentSettings>" /d

Key Parameter Breakdown

  • <PathToYourASDatabaseFile>: This targets the .asdatabase file generated when you build your SSAS project. You’ll find this in your project’s bin\Debug or bin\Release directory (e.g., C:\SSASProjects\SalesCube\bin\Release\SalesCube.asdatabase).
  • /s:"<PathToDeploymentSettings>": Optional but highly recommended. This points to a deployment settings file (usually .xmla) that stores critical configurations: target SSAS server name, cube database name, processing options, security roles, and more. Generate this file via the SSAS Deployment Wizard in Visual Studio, or edit it manually to match your environment.
  • /d: Triggers immediate deployment to the target server. Omit this flag if you only want to generate the deployment XMLA script without executing it.

Additional Useful Parameters

  • /a:<OperationType>: Defines the action to perform. Valid values include:
    • Deploy: Default option, deploys the cube to the server.
    • Script: Generates the XMLA deployment script without running it (great for auditing or manual execution).
    • Validate: Checks the project for errors without deploying or scripting.
  • /o:<PathToOutputXMLA>: Specifies a path to save the generated XMLA script (handy for documentation or offline deployments).
  • /config:<ConfigName>: Lets you specify a build configuration (e.g., Release or Debug) to use, overriding the project’s default settings.

Example for TFS 2015 Builds

In your TFS 2015 build definition, add a Command Line task with this command (adjust paths to match your project):

"C:\Program Files (x86)\Microsoft SQL Server\130\Tools\Binn\ManagementStudio\Microsoft.AnalysisServices.Deployment.exe" "$(Build.ArtifactStagingDirectory)\SalesCubeProject\bin\Release\SalesCubeProject.asdatabase" /s:"$(Build.SourcesDirectory)\SalesCubeProject\DeploymentSettings.xmla" /d
  • $(Build.ArtifactStagingDirectory) and $(Build.SourcesDirectory) are TFS build variables that automatically point to your compiled artifacts and source code respectively.

Critical Notes

  • Ensure your TFS build agent has SQL Server Management Studio (SSMS) installed (or at least the Analysis Services Deployment Tools). For SQL Server 2016, the tool lives in C:\Program Files (x86)\Microsoft SQL Server\130\Tools\Binn\ManagementStudio\.
  • The service account running the TFS build needs sufficient permissions on the target SSAS server—this could be server admin access, or granular permissions to create/modify cubes and process data.
  • Customize your deployment settings file to control processing modes (incremental vs. full), partition management, and security roles—this gives you the same level of control as a publish profile for regular databases.

内容的提问来源于stack exchange,提问作者user11156893

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.12 04:52:48