从 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:
- Azure 中的 Analysis Services 服务器。Analysis Services server in Azure. 若要了解详细信息,请参阅创建 Azure Analysis Services 服务器。To learn more, see Create an Azure Analysis Services server.
- Visual Studio 中的 表格模型项目 或兼容级别为 1200 或更高的现有表格模型。Tabular model project in Visual Studio or an existing tabular model at the 1200 or higher compatibility level. 从未创建过?Never created one? 尝试 Adventure Works Internet 销售表格建模教程。Try the Adventure Works Internet sales tabular modeling tutorial.
- 本地网关 - 如果组织的网络中有一个或多个本地数据源,则需要安装 本地数据网关。On-premises gateway - If one or more data sources are on-premises in your organization's network, you need to install an On-premises data gateway. 网关对于云中的服务器是必需的,可帮助服务器连接到本地数据源,以在模型中处理和刷新数据。The gateway is necessary for your server in the cloud connect to your on-premises data sources to process and refresh data in the model.
提示
在部署之前,请确保可以在表中处理数据。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.
从 Visual Studio 部署To deploy from Visual Studio
在 Visual Studio >“解决方案资源管理器”中,右键单击项目,并选择“属性”。In Visual Studio > Solution Explorer, right-click the project > Properties. 在“部署” > “服务器”中,粘贴服务器名称。 Then in Deployment > Server paste the server name.
在“解决方案资源管理器”中,右键单击“属性”,并单击“部署”。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.