您现在访问的是微软AZURE全球版技术文档网站,若需要访问由世纪互联运营的MICROSOFT AZURE中国区技术文档网站,请访问 https://docs.azure.cn.

使用 Resource Manager 模板和 Azure 门户部署资源Deploy resources with Resource Manager templates and Azure portal

本文说明如何将 Azure 门户Azure 资源管理器配合使用来部署 Azure 资源。This article shows how to use the Azure portal with Azure Resource Manager to deploy your Azure resources. 若要了解有关管理资源的信息,请参阅通过门户管理 Azure 资源To learn about managing your resources, see Manage Azure resources through portal.

创建资源组Create resource group

  1. 若要创建空资源组,请选择“资源组”。To create an empty resource group, select Resource groups.

    选择资源组

  2. 在“资源组”下,选择“添加”。Under Resource groups, select Add.

    添加资源组

  3. 为其命名并指定位置,如有必要,选择一个订阅。Give it a name and location, and, if necessary, select a subscription. 需要提供资源组的位置,因为资源组存储与资源有关的元数据。You need to provide a location for the resource group because the resource group stores metadata about the resources. 出于合规目的,你可能需要指定该元数据的存储位置。For compliance reasons, you may want to specify where that metadata is stored. 一般情况下,建议指定大部分资源将驻留的位置。In general, we recommend that you specify a location where most of your resources will reside. 使用相同位置可简化模板。Using the same location can simplify your template.

    设置组的值

    完成属性设置后,选择“创建”。When you have finished setting the properties, select Create.

  4. 若要查看新资源组,选择“刷新”。To see your new resource group, select Refresh.

    刷新资源组

从市场部署资源Deploy resources from Marketplace

创建资源组后,可以从市场将资源部署到资源组。After you create a resource group, you can deploy resources to it from the Marketplace. 市场为常见方案提供预定义的解决方案。The Marketplace provides pre-defined solutions for common scenarios.

  1. 若要开始部署,请选择“创建资源”。To start a deployment, select Create a resource.

    新建资源

  2. 查找希望部署的资源类型。Find the type of resource you would like to deploy.

    选择“资源类型”

  3. 如果看不到想要部署的特定解决方案,可以在市场中搜索。If you don't see the particular solution you would like to deploy, you can search the Marketplace for it. 例如,若要查找 Wordpress 解决方案,开始键入 Wordpress 并选择所需选项。For example, to find a Wordpress solution, start typing Wordpress and select the option you want.

    在市场中搜索

  4. 根据所选资源的类型,需要在部署之前设置相关属性的集合。Depending on the type of selected resource, you have a collection of relevant properties to set before deployment. 对于所有类型,必须选择目标资源组。For all types, you must select a destination resource group. 以下映像演示了如何创建 Web 应用并将其部署到创建的资源组。The following image shows how to create a web app and deploy it to the resource group you created.

    创建资源组

    也可以在部署资源时创建资源组。Alternatively, you can decide to create a resource group when deploying your resources. 选择“新建”并为资源组指定名称。Select Create new and give the resource group a name.

    新建资源组

  5. 部署开始。Your deployment begins. 部署可能需要几分钟的时间。The deployment could take a few minutes. 完成部署后,会看到一条通知。When the deployment has finished, you see a notification.

    查看通知

  6. 部署资源后,可以通过选择“添加”将更多资源添加到资源组。After deploying your resources, you can add more resources to the resource group by selecting Add.

    添加资源

从自定义模板部署资源Deploy resources from custom template

如果想要执行部署,但不使用市场中的任何模板,可以创建自定义模板来针对解决方案定义基础结构。If you want to execute a deployment but not use any of the templates in the Marketplace, you can create a customized template that defines the infrastructure for your solution. 若要了解如何创建模板,请参阅了解 Azure 资源管理器模板的结构和语法To learn about creating templates, see Understand the structure and syntax of Azure Resource Manager templates.

备注

门户界面不支持引用来自 Key Vault 的密码The portal interface doesn't support referencing a secret from a Key Vault. 请改用 PowerShellAzure CLI,从本地或从外部 URI 部署模板。Instead, use PowerShell or Azure CLI to deploy your template locally or from an external URI.

  1. 若要通过门户部署自定义模板,请选择“创建资源”,并搜索“模板部署”,直至可以从选项中选择它。To deploy a customized template through the portal, select Create a resource, and search for Template Deployment until you can select it from the options.

    搜索模板部署

  2. 选择创建Select Create.

    选择“创建”

  3. 此时,会看到用于创建模板的几个选项。You see several options for creating a template. 选择“在编辑器中生成自己的模板”。Select Build your own template in the editor.

    视图选项

  4. 你已具有可用于自定义的空白模板。You have a blank template that is available for customizing.

    创建模板

  5. 可以手动编辑 JSON 语法,也可以从模板库快速入门中选择预建模板。You can edit the JSON syntax manually, or select a pre-built template from the Quickstart template gallery. 但是,本文使用的是“添加资源”选项。However, for this article, you use the Add resource option.

    编辑模板

  6. 选择“存储帐户”并为其提供名称。Select Storage account and provide a name. 完成提供值后,选择“确定”。When finished providing values, select OK.

    选择存储帐户

  7. 编辑器会自动为资源类型添加 JSON。The editor automatically adds JSON for the resource type. 请注意,它包含用于定义存储帐户类型的参数。Notice that it includes a parameter for defining the type of storage account. 选择“保存”。Select Save.

    显示模板

  8. 现在,可以选择部署模板中定义的资源。Now, you have the option to deploy the resources defined in the template. 若要部署,请同意条款和条件,然后选择“购买”。To deploy, agree to the terms and conditions, and select Purchase.

    部署模板

从保存到帐户中的模板部署资源Deploy resources from a template saved to your account

通过此门户,可将模板保存到 Azure 帐户,以便以后重新部署它。The portal enables you to save a template to your Azure account, and redeploy it later. 有关模板的详细信息,请参阅创建和部署第一个 Azure 资源管理器模板For more information on templates, see Create and deploy your first Azure Resource Manager template.

  1. 若要查找已保存模板,请选择“更多服务”。To find your saved templates, select More services.

    其他服务

  2. 搜索模板并选择该选项。Search for templates and select that option.

    搜索模板

  3. 从已保存到帐户的模板列表中,选择要使用的模板。From the list of templates saved to your account, select the one you wish to work on.

    已保存模板

  4. 选择“部署”以重新部署该已保存模板。Select Deploy to redeploy this saved template.

    部署已保存模板

后续步骤Next steps