从 Visual Studio 部署模型Deploy a model from Visual Studio

在 Azure 订阅中创建服务器之后,便可以开始将表格模型数据库部署到其中。Once you've created a server in your Azure subscription, you're ready to deploy a tabular model database to it. 可以将 Visual Studio 与 Analysis Services 项目一起使用,以生成和部署要处理的表格模型项目。You can use Visual Studio with Analysis Services projects to build and deploy a tabular model project you're working on.

先决条件Prerequisites

要开始,需要:To get started, you need:

提示

在部署之前,请确保可以在表中处理数据。Before you deploy, make sure you can process the data in your tables. 在 Visual Studio 中,单击“模型” > “处理” > “全部处理”。In Visual Studio, click Model > Process > Process All. 如果处理失败,将无法成功部署。If processing fails, you cannot successfully deploy.

获取服务器名称Get the server name

Azure 门户 中,单击“服务器”>“概述” > “服务器名称”,并复制服务器名称。In Azure portal > server > Overview > Server name, copy the server name.

在 Azure 中获取服务器名称

从 Visual Studio 部署To deploy from Visual Studio

  1. 在 Visual Studio >“解决方案资源管理器”中,右键单击项目,并选择“属性”。In Visual Studio > Solution Explorer, right-click the project > Properties. 在“部署” > “服务器”中,粘贴服务器名称。 Then in Deployment > Server paste the server name.

    将服务器名称粘贴到部署服务器属性

  2. 在“解决方案资源管理器”中,右键单击“属性”,并单击“部署”。In Solution Explorer, right-click Properties, then click Deploy. 系统可能会提示登录到 Azure。You may be prompted to sign in to Azure.

    部署到服务器

    部署状态会在“输出”窗口和“部署”中显示。Deployment status appears in both the Output window and in Deploy.

    部署状态

就是这么简单!That's all there is to it!

故障排除Troubleshooting

如果部署元数据时部署失败,可能是因为 Visual Studio 无法连接到服务器。If deployment fails when deploying metadata, it's likely because Visual Studio couldn't connect to your server. 确保可以使用 SQL Server Management Studio (SSMS) 连接到服务器。Make sure you can connect to your server using SQL Server Management Studio (SSMS). 确保项目的“部署服务器”属性正确。Then make sure the Deployment Server property for the project is correct.

如果部署在表上失败,可能是因为服务器无法连接到数据源。If deployment fails on a table, it's likely because your server couldn't connect to a data source. 如果数据源位于组织网络中的本地位置,请务必安装本地数据网关If your data source is on-premises in your organization's network, be sure to install an On-premises data gateway.

后续步骤Next steps

现在,已将表格模型部署到服务器,可以与其进行连接了。Now that you have your tabular model deployed to your server, you're ready to connect to it. 可以使用 SQL Server Management Studio (SSMS) 连接到该服务器以对其进行管理。You can connect to it with SQL Server Management Studio (SSMS) to manage it. 并且,可以使用客户端工具连接到它,如 Power BI、Power BI Desktop 或 Excel,并开始创建报表。And, you can connect to it using a client tool like Power BI, Power BI Desktop, or Excel, and start creating reports.

若要了解高级部署方法,请参阅表格模型解决方案部署To learn about advanced deployment methods, see Tabular model solution deployment.