按可预见的方式在 Azure 中设置和部署微服务Provision and deploy microservices predictably in Azure

本教程演示如何通过使用 JSON 资源组模板和 PowerShell 脚本以一种可预见的方式,在 Azure 应用服务中由微服务构成的应用程序设置并部署为单个单元。This tutorial shows how to provision and deploy an application composed of microservices in Azure App Service as a single unit and in a predictable manner using JSON resource group templates and PowerShell scripting.

在设置和部署由高度分离的微服务构成的高扩展性应用程序时,可重复性和可预见性对成功至关重要。When provisioning and deploying high-scale applications that are composed of highly decoupled microservices, repeatability and predictability are crucial to success. 使用 Azure 应用服务,可以创建包括 Web 应用、移动后端和 API 应用在内的微服务。Azure App Service enables you to create microservices that include web apps, mobile back ends, and API apps. 使用 Azure 资源管理器,可以将所有微服务作为一个单元与资源依赖项(如数据库和源代码管理设置)一起进行管理。Azure Resource Manager enables you to manage all the microservices as a unit, together with resource dependencies such as database and source control settings. 现在,还可以使用 JSON 模板和简单的 PowerShell 脚本部署此类应用程序。Now, you can also deploy such an application using JSON templates and simple PowerShell scripting.

执行的操作What you will do

在教程中,将部署的应用程序包括:In the tutorial, you will deploy an application that includes:

  • 两个应用服务应用(即两个微服务)Two App Service apps (i.e. two microservices)
  • 后端 SQL 数据库A backend SQL Database
  • 应用设置、连接字符串和源代码管理App settings, connection strings, and source control
  • Application Insights、警报和自动缩放设置Application insights, alerts, autoscaling settings

将使用的工具Tools you will use

在本教程中,将使用以下工具。In this tutorial, you will use the following tools. 由于对工具的讨论并不全面,我将坚持使用端到端方案,并只为你提供每个方案的简要介绍及在哪里可找到它的详细信息。Since it's not comprehensive discussion on tools, I'm going to stick to the end-to-end scenario and just give you a brief intro to each, and where you can find more information on it.

Azure 资源管理器模板 (JSON)Azure Resource Manager templates (JSON)

例如,每次在 Azure 应用服务中创建应用时,Azure 资源管理器都将使用 JSON 模板来创建具有组件资源的整个资源组。Every time you create an app in Azure App Service, for example, Azure Resource Manager uses a JSON template to create the entire resource group with the component resources. Azure 市场中的复杂模板可以包含数据库、存储帐户、应用服务计划、应用本身、警报规则、应用设置、自动缩放设置等等,可以通过 PowerShell 使用所有这些模板。A complex template from the Azure Marketplace can include the database, storage accounts, the App Service plan, the app itself, alert rules, app settings, autoscale settings, and more, and all these templates are available to you through PowerShell. 有关 Azure 资源管理器模板的详细信息,请参阅创作 Azure 资源管理器模板For more information on the Azure Resource Manager templates, see Authoring Azure Resource Manager Templates.

Azure SDK 2.6 for Visual StudioAzure SDK 2.6 for Visual Studio

最新的 SDK 包含对 JSON 编辑器中 Resource Manager 模板支持的改进。The newest SDK contains improvements to the Resource Manager template support in the JSON editor. 可以使用它快速从头开始创建资源组模板,或打开现有 JSON 模板(例如下载的库模板)以进行修改、填充参数文件,甚至直接从 Azure 资源组解决方案部署资源组。You can use this to quickly create a resource group template from scratch or open an existing JSON template (such as a downloaded gallery template) for modification, populate the parameters file, and even deploy the resource group directly from an Azure Resource Group solution.

有关详细信息,请参阅 Azure SDK 2.6 for Visual StudioFor more information, see Azure SDK 2.6 for Visual Studio.

Azure PowerShell 0.8.0 或更高版本Azure PowerShell 0.8.0 or later

从版本 0.8.0 开始,Azure PowerShell 安装除了包括 Azure 模块外还包括 Azure 资源管理器模块。Beginning in version 0.8.0, the Azure PowerShell installation includes the Azure Resource Manager module in addition to the Azure module. 使用此新模块可以编写资源组部署的脚本。This new module enables you to script the deployment of resource groups.

有关详细信息,请参阅将 Azure PowerShell 与 Azure 资源管理器配合使用For more information, see Using Azure PowerShell with Azure Resource Manager

“部署到 Azure”按钮Deploy to Azure button

如果将 GitHub 用于源代码管理,则可将一个“部署到 Azure”按钮放入 README.MD,这会对 Azure 启用统包部署 UI。If you use GitHub for source control, you can put a Deploy to Azure button into your README.MD, which enables a turn-key deployment UI to Azure. 可为任何简单的应用执行此操作,同时可扩展这一操作,通过将 azuredeploy.json 文件放入存储库根来实现对整个资源组的部署。While you can do this for any simple app, you can extend this to enable deploying an entire resource group by putting an azuredeploy.json file in the repository root. “部署到 Azure”按钮将使用此包含资源组模板的 JSON 文件来创建资源组。This JSON file, which contains the resource group template, will be used by the Deploy to Azure button to create the resource group. 有关示例,请参阅会在本教程中使用的 ToDoApp 示例。For an example, see the ToDoApp sample, which you will use in this tutorial.

获取示例资源组模板Get the sample resource group template

现在让我们开始吧。So now let's get right to it.

  1. 导航到 ToDoApp 应用服务示例。Navigate to the ToDoApp App Service sample.

  2. 在 readme.md 中,单击“部署到 Azure” 。In readme.md, click Deploy to Azure.

  3. 会转到部署到 Azure 站点并需要输入部署参数。You're taken to the deploy-to-azure site and asked to input deployment parameters. 请注意大多数字段将填充以存储库名称和某些随机字符串。Notice that most of the fields are populated with the repository name and some random strings for you. 可以更改所有字段(如果想),但唯一一项必须输入的内容是 SQL Server 管理登录名和密码,并单击“下一步” 。You can change all the fields if you want, but the only things you have to enter are the SQL Server administrative login and the password, then click Next.

  4. 接下来,单击“部署” 启动部署进程。Next, click Deploy to start the deployment process. 进程运行至完成时,请单击 http://todoappXXXX.chinacloudsites.cn 链接以浏览部署的应用程序。Once the process runs to completion, click the http://todoappXXXX.chinacloudsites.cn link to browse the deployed application.

    首次浏览到 UI 时它的显示会慢些,因为应用刚刚启动,但应确信它是一个功能齐全运行正常的应用程序。The UI would be a little slow when you first browse to it because the apps are just starting up, but convince yourself that it's a fully-functional application.

  5. 返回到“部署”页,单击管理链接以查看 Azure 门户中的新应用程序。Back in the Deploy page, click the Manage link to see the new application in the Azure Portal.

  6. 在“必备” 下拉列表中,单击资源组链接。In the Essentials dropdown, click the resource group link. 还要注意,应用已连接到“外部项目”下的 GitHub 存储库 。Note also that the app is already connected to the GitHub repository under External Project.

  7. 在资源组边栏选项卡中,请注意资源组中已存在两个应用和一个 SQL 数据库。In the resource group blade, note that there are already two apps and one SQL Database in the resource group.

刚才在几分钟内看到的全部内容就是一个经过完全部署的由两个微服务构成的应用程序,以及所有组件、依赖项、设置、数据库和连续发布,均由 Azure 资源管理器中的自动化协调所设置。Everything that you just saw in a few short minutes is a fully deployed two-microservice application, with all the components, dependencies, settings, database, and continuous publishing, set up by an automated orchestration in Azure Resource Manager. 所有这一切均是通过两项内容完成:All this was done by two things:

  • “部署到 Azure”按钮The Deploy to Azure button
  • 存储库根中的 azuredeploy.jsonazuredeploy.json in the repo root

可数十、数百或数千次地部署此同一的应用程序,并且每次都具有完全相同的配置。You can deploy this same application tens, hundreds, or thousands of times and have the exact same configuration every time. 这种方法的可重复性和可预见性使你能够轻松、自信地部署高扩展性应用程序。The repeatability and the predictability of this approach enables you to deploy high-scale applications with ease and confidence.


现在让我们看看如何设置 GitHub 存储库。Now let's look at how the GitHub repository was set up. 将使用 Azure.NET SDK 中的 JSON 编辑器,所以如果尚未安装 Azure .NET SDK 2.6,请立刻安装。You will be using the JSON editor in the Azure .NET SDK, so if you haven't already installed Azure .NET SDK 2.6, do it now.

  1. 使用最喜欢的 git 工具克隆 ToDoApp 存储库。Clone the ToDoApp repository using your favorite git tool. 在下面的屏幕截图中,我会在 Visual Studio 2013 的团队资源管理器中执行此操作。In the screenshot below, I'm doing this in the Team Explorer in Visual Studio 2013.

  2. 在 Visual Studio 中从存储库根打开 azuredeploy.json。From the repository root, open azuredeploy.json in Visual Studio. 如果没有看到“JSON 概要”窗格,则需要安装 Azure.NET SDK。If you don't see the JSON Outline pane, you need to install Azure .NET SDK.

我不打算介绍 JSON 格式的每个细节,但 更多资源 部分包含可用于学习资源组模板语言的链接。I'm not going to describe every detail of the JSON format, but the More Resources section has links for learning the resource group template language. 在这里,我只打算向你展示有趣的功能,可帮助你开始制作自己的自定义模板来部署应用。Here, I'm just going to show you the interesting features that can help you get started in making your own custom template for app deployment.


看一看参数部分,会看到这些参数大都是“部署到 Azure” 按钮提示输入的内容。Take a look at the parameters section to see that most of these parameters are what the Deploy to Azure button prompts you to input. “部署到 Azure” 按钮背后的站点将使用 azuredeploy.json 中定义的参数填充输入 UI。The site behind the Deploy to Azure button populates the input UI using the parameters defined in azuredeploy.json. 这些参数用于整个资源定义,例如资源名称、属性值等。These parameters are used throughout the resource definitions, such as resource names, property values, etc.


在资源节点中,可以看到定义了 4 个顶级资源,包括一个 SQL Server 实例、一个应用服务计划和两个应用。In the resources node, you can see that 4 top-level resources are defined, including a SQL Server instance, an App Service plan, and two apps.

应用服务计划App Service plan

让我们以 JSON 中简单的根级别资源开始。Let's start with a simple root-level resource in the JSON. 在“JSON 概要”中,单击名为 [hostingPlanName] 的应用服务计划以突出显示相应的 JSON 代码。In the JSON Outline, click the App Service plan named [hostingPlanName] to highlight the corresponding JSON code.

请注意,type 元素指定应用服务计划(很久很久以前称之为服务器场)的字符串,而其他元素和属性使用 JSON 文件中定义的参数填写,并且此资源不具有任何嵌套的资源。Note that the type element specifies the string for an App Service plan (it was called a server farm a long, long time ago), and other elements and properties are filled in using the parameters defined in the JSON file, and this resource doesn't have any nested resources.


另请注意,apiVersion 的值会告知 Azure 哪个版本的 REST API 将与 JSON 资源定义一起使用,并且会影响资源在 {} 内应采用的格式化方式。Note also that the value of apiVersion tells Azure which version of the REST API to use the JSON resource definition with, and it can affect how the resource should be formatted inside the {}.

SQL ServerSQL Server

接下来,单击“JSON 概要”中名为 SQLServer 的 SQL Server 资源。Next, click on the SQL Server resource named SQLServer in the JSON Outline.

请注意以下有关突出显示的 JSON 代码的内容:Note the following about the highlighted JSON code:

  • 使用参数可确保已创建资源的命名和配置方式使其与其他资源保持一致。The use of parameters ensures that the created resources are named and configured in a way that makes them consistent with one another.

  • SQLServer 资源具有两个嵌套的资源,而每个具有不同的 type 值。The SQLServer resource has two nested resources, each has a different value for type.

  • "resources": […] 内(其中定义了数据库和防火墙规则)的嵌套资源具有 dependsOn 元素,后者指定根级别 SQLServer 资源的资源 ID。The nested resources inside "resources": […], where the database and the firewall rules are defined, have a dependsOn element that specifies the resource ID of the root-level SQLServer resource. 这将告知 Azure Resource Manager:“创建此资源之前,另一个资源必须已经存在;如果在模板中定义了另一个资源,则先创建该资源。”This tells Azure Resource Manager, "before you create this resource, that other resource must already exist; and if that other resource is defined in the template, then create that one first".


    有关如何使用 resourceId() 函数的详细信息,请参阅 Azure 资源管理器模板功能For detailed information on how to use the resourceId() function, see Azure Resource Manager Template Functions.

  • dependsOn 元素的影响在于让 Azure 资源管理器能够知道哪些资源可以并行创建,哪些资源必须按顺序创建。The effect of the dependsOn element is that Azure Resource Manager can know which resources can be created in parallel and which resources must be created sequentially.

应用服务应用App Service app

现在,让我们继续,看看实际应用本身,这更加复杂。Now, let's move on to the actual apps themselves, which are more complicated. 在“JSON 边框”中单击“[variables('apiSiteName')]”应用以突出显示其 JSON 代码。Click the [variables('apiSiteName')] app in the JSON Outline to highlight its JSON code. 你会注意到内容正在变得更加有趣。You'll notice that things are getting much more interesting. 为此,我将一个一个地讨论功能:For this purpose, I'll talk about the features one by one:

根资源Root resource

应用依赖于两个不同的资源。The app depends on two different resources. 这意味着只有在创建应用服务计划和 SQL Server 实例后,Azure 资源管理器才会创建应用。This means that Azure Resource Manager will create the app only after both the App Service plan and the SQL Server instance are created.

应用设置App settings

应用设置也被定义为嵌套资源。The app settings are also defined as a nested resource.

propertiesconfig/appsettings 元素中,具有两个 "<name>" : "<value>" 格式的应用设置。In the properties element for config/appsettings, you have two app settings in the format "<name>" : "<value>".

  • PROJECTKUDU 设置,它告诉 Azure 部署在多项目的 Visual Studio 解决方案中使用哪个项目。PROJECT is a KUDU setting that tells Azure deployment which project to use in a multi-project Visual Studio solution. 稍后我将向你演示如何配置源代码管理,但由于 ToDoApp 代码位于多项目 Visual Studio 解决方案中,我们需要此设置。I will show you later how source control is configured, but since the ToDoApp code is in a multi-project Visual Studio solution, we need this setting.
  • clientUrl 只是应用程序代码使用的应用设置。clientUrl is simply an app setting that the application code uses.
连接字符串Connection strings

连接字符串也被定义为嵌套资源。The connection strings are also defined as a nested resource.

propertiesconfig/connectionstrings 元素中,每个连接字符串也定义为具有特定的 "<name>" : {"value": "…", "type": "…"} 格式的 name:value 对。In the properties element for config/connectionstrings, each connection string is also defined as a name:value pair, with the specific format of "<name>" : {"value": "…", "type": "…"}. 对于 type 元素,可能的值为 MySqlSQLServerSQLAzureCustomFor the type element, possible values are MySql, SQLServer, SQLAzure, and Custom.


若要获取连接字符串类型的最终列表,请在 Azure PowerShell 中运行以下命令:[Enum]::GetNames("Microsoft.WindowsAzure.Commands.Utilities.Websites.Services.WebEntities.DatabaseType")For a definitive list of the connection string types, run the following command in Azure PowerShell: [Enum]::GetNames("Microsoft.WindowsAzure.Commands.Utilities.Websites.Services.WebEntities.DatabaseType")

源代码管理Source control

源代码管理设置也被定义为嵌套资源。The source control settings are also defined as a nested resource. Azure 资源管理器使用此资源来配置连续发布(稍后请参阅 IsManualIntegration 上的注意事项),并且还可在 JSON 文件的处理过程中自动启动应用程序代码的部署。Azure Resource Manager uses this resource to configure continuous publishing (see caveat on IsManualIntegration later) and also to kick off the deployment of application code automatically during the processing of the JSON file.

RepoUrlbranch 应该是非常直观的,且应指向 Git 存储库和分支(从其发布)的名称。RepoUrl and branch should be pretty intuitive and should point to the Git repository and the name of the branch to publish from. 同样,这些由输入参数定义。Again, these are defined by input parameters.

请注意,在 dependsOn 元素中,除应用资源本身外,sourcecontrols/web 还依赖于 config/appsettingsconfig/connectionstringsNote in the dependsOn element that, in addition to the app resource itself, sourcecontrols/web also depends on config/appsettings and config/connectionstrings. 这是因为一旦配置 sourcecontrols/web 后,Azure 部署进程会自动尝试部署、构建和启动应用程序代码。This is because once sourcecontrols/web is configured, the Azure deployment process will automatically attempt to deploy, build, and start the application code. 因此,插入此依赖项可帮助你确保在运行应用程序代码之前,应用程序有权访问所需的应用设置和连接字符串。Therefore, inserting this dependency helps you make sure that the application has access to the required app settings and connection strings before the application code is run.


另请注意,IsManualIntegration 设置为 trueNote also that IsManualIntegration is set to true. 此属性在本教程中是必需的,由于你实际上并不拥有 GitHub 存储库,因此不能实际授权 Azure 配置从 ToDoApp 的连续发布(即,将自动存储库更新推送到 Azure)。This property is necessary in this tutorial because you do not actually own the GitHub repository, and thus cannot actually grant permission to Azure to configure continuous publishing from ToDoApp (i.e. push automatic repository updates to Azure). 仅当之前已在 falseAzure 门户中配置了所有者的 GitHub 凭据时,才可将默认值 用于指定的存储库。You can use the default value false for the specified repository only if you have configured the owner's GitHub credentials in the Azure portal before. 换言之,如果之前已在 Azure 门户中使用用户凭据为任何应用将源代码管理设置到 GitHub 或 BitBucket,则 Azure 将记住凭据并在将来每当从 GitHub 或 BitBucket 部署任何应用时使用这些凭据。In other words, if you have set up source control to GitHub or BitBucket for any app in the Azure Portal previously, using your user credentials, then Azure will remember the credentials and use them whenever you deploy any app from GitHub or BitBucket in the future. 但是,如果尚未执行此操作,则当 Azure 资源管理器尝试配置应用的源代码管理设置时,JSON 模板的部署将失败,因为它无法使用存储库所有者的凭据登录 GitHub 或 BitBucket。However, if you haven't done this already, deployment of the JSON template will fail when Azure Resource Manager tries to configure the app's source control settings because it cannot log into GitHub or BitBucket with the repository owner's credentials.

自己部署资源组模板Deploy the resource group template yourself

“部署到 Azure” 按钮太好用了,但是只有当已将 azuredeploy.json 推送到 GitHub 时,它才允许部署 azuredeploy.json 中的资源组模板。The Deploy to Azure button is great, but it allows you to deploy the resource group template in azuredeploy.json only if you have already pushed azuredeploy.json to GitHub. Azure.NET SDK 还提供了工具,使你能够直接从本地计算机部署任何 JSON 模板文件。The Azure .NET SDK also provides the tools for you to deploy any JSON template file directly from your local machine. 为此,请执行以下步骤:To do this, follow the steps below:

  1. 在 Visual Studio 中,单击“文件” > “新建” > “项目” 。In Visual Studio, click File > New > Project.

  2. 单击“Visual C#” > “云” > “Azure 资源组” ,并单击“确定” 。Click Visual C# > Cloud > Azure Resource Group, then click OK.

  3. 在“选择 Azure 模板” 中,选择“空白模板” ,并单击“确定” 。In Select Azure Template, select Blank Template and click OK.

  4. 将 azuredeploy.json 拖动到新项目的“模板” 文件夹。Drag azuredeploy.json into the Template folder of your new project.

  5. 从解决方案资源管理器中打开复制的 azuredeploy.json。From Solution Explorer, open the copied azuredeploy.json.

  6. 为方便演示,现在单击“添加资源”,将一些标准 Application Insight 资源添加到 JSON 文件。 Just for the sake of the demonstration, let's add some standard Application Insight resources to our JSON file, by clicking Add Resource. 如果只对部署 JSON 文件感兴趣,请跳至部署步骤。If you're just interested in deploying the JSON file, skip to the deploy steps.

  7. 选择“适用于 Web 应用的 Application Insights”,确保选择了现有应用服务计划和应用,并单击“添加” 。Select Application Insights for Web Apps, then make sure an existing App Service plan and app is selected, and then click Add.

    现在,你将能够看到几个新的资源,它们依赖于应用服务计划或应用,具体取决于资源及其功能。You'll now be able to see several new resources that, depending on the resource and what it does, have dependencies on either the App Service plan or the app. 这些资源不由其现有定义启用,而要对此进行更改。These resources are not enabled by their existing definition and you're going to change that.

  8. 在“JSON 概要”中,单击“appInsights AutoScale” 以突出显示其 JSON 代码。In the JSON Outline, click appInsights AutoScale to highlight its JSON code. 这是针对应用服务计划的缩放设置。This is the scaling setting for your App Service plan.

  9. 在突出显示的 JSON 代码中,找到 locationenabled 属性并对其进行如下设置。In the highlighted JSON code, locate the location and enabled properties and set them as shown below.

  10. 在“JSON 概要”中,单击“CPUHigh appInsights” 以突出显示其 JSON 代码。In the JSON Outline, click CPUHigh appInsights to highlight its JSON code. 这是一个警报。This is an alert.

  11. 找到 locationisEnabled 属性并对其进行如下设置。Locate the location and isEnabled properties and set them as shown below. 对其他三个警报(紫色警报)执行相同的操作。Do the same for the other three alerts (purple bulbs).

  12. 现在可以开始部署了。You're now ready to deploy. 右键单击该项目,并选择“部署” > “新部署” 。Right-click the project and select Deploy > New Deployment.

  13. 如果尚未执行该操作,则登录到 Azure 帐户。Log into your Azure account if you haven't already done so.

  14. 选择订阅中的现有资源组或创建一个新资源组,选择“azuredeploy.json” ,并单击“编辑参数” 。Select an existing resource group in your subscription or create a new one, select azuredeploy.json, and then click Edit Parameters.

    现在即可在一张不错的表中编辑在模板文件中定义的所有参数。You'll now be able to edit all the parameters defined in the template file in a nice table. 定义默认值的参数将已具有其默认值,并且定义允许值的列表的参数会显示为下拉列表。Parameters that define defaults will already have their default values, and parameters that define a list of allowed values will be shown as dropdowns.

  15. 填写所有空参数,并使用 repoUrl 中的 ToDoApp 的 GitHub 存储库地址Fill in all the empty parameters, and use the GitHub repo address for ToDoApp in repoUrl. 然后,单击“保存” 。Then, click Save.


    自动缩放是标准层或更高层中提供的一项功能,而计划级别警报是基本层或更高层中提供的功能,需要将 sku 参数设置为标准或高级,以突出显示所有新的 App Insights 资源。 Autoscaling is a feature offered in Standard tier or higher, and plan-level alerts are features offered in Basic tier or higher, you'll need to set the sku parameter to Standard or Premium in order to see all your new App Insights resources light up.

  16. 单击“部署”。 Click Deploy. 如果选择了“保存密码” ,密码将以纯文本格式保存在参数文件中。If you selected Save passwords, the password will be saved in the parameter file in plain text. 否则需要在部署过程中输入数据库密码。Otherwise, you'll be asked to input the database password during the deployment process.

就这么简单!That's it! 现在只需转到 Azure 门户即可看到添加到 JSON 部署的应用程序中的新警报和自动缩放设置。Now you just need to go to the Azure Portal to see the new alerts and autoscale settings added to your JSON deployed application.

这部分中的步骤主要完成了以下内容:Your steps in this section mainly accomplished the following:

  1. 准备模板文件Prepared the template file
  2. 创建参数文件以搭配模板文件Created a parameter file to go with the template file
  3. 使用参数文件部署模板文件Deployed the template file with the parameter file

最后一步通过 PowerShell cmdlet 轻松完成。The last step is easily done by a PowerShell cmdlet. 若要查看当 Visual Studio 部署应用程序时所执行的操作,请打开 Scripts\Deploy-AzureResourceGroup.ps1。To see what Visual Studio did when it deployed your application, open Scripts\Deploy-AzureResourceGroup.ps1. 存在大量的代码,但我只突出显示使用参数文件部署模板文件所需的所有相关代码。There's a lot of code there, but I'm just going to highlight all the pertinent code you need to deploy the template file with the parameter file.

最后一个 cmdlet,New-AzureResourceGroup,实际执行了该操作。The last cmdlet, New-AzureResourceGroup, is the one that actually performs the action. 所有这一切向你展示了,借助工具可相对简单地以可预见的方式部署云应用程序。All this should demonstrate to you that, with the help of tooling, it is relatively straightforward to deploy your cloud application predictably. 每当你使用相同的参数文件在相同的模板上运行该 cmdlet 时,都会获得相同的结果。Every time you run the cmdlet on the same template with the same parameter file, you're going to get the same result.


在 DevOps 中,可重复性和可预见性对成功部署由微服务构成的高扩展性应用程序至关重要。In DevOps, repeatability and predictability are keys to any successful deployment of a high-scale application composed of microservices. 在本教程中,已经通过使用 Azure 资源管理器模板将一个由两个微服务构成的应用程序作为单个资源组部署到 Azure。In this tutorial, you have deployed a two-microservice application to Azure as a single resource group using the Azure Resource Manager template. 但愿这已提供所需的知识,使你能够在 Azure 中开始将应用程序转换为模板,并且能够以可预见的方式设置和部署它。Hopefully, it has given you the knowledge you need in order to start converting your application in Azure into a template and can provision and deploy it predictably.

更多资源More resources

后续步骤Next steps

要了解本文中部署的资源类型的 JSON 语法和属性,请参阅:To learn about the JSON syntax and properties for resource types deployed in this article, see: