Uredi

Deli z drugimi prek


Deploy resources with ARM templates and Azure portal

Learn how to use the Azure portal with Azure Resource Manager templates (ARM templates) to deploy your Azure resources. To learn about managing your resources, see Manage Azure resources by using the Azure portal.

Deploying Azure resources by using the Azure portal usually involves two steps:

  • Create a resource group.
  • Deploy resources to the resource group.

Also, you can create a customized ARM template to deploy Azure resources.

This article shows both methods.

Create a resource group

  1. To create a new resource group, select Resource groups from the Azure portal.

    Screenshot of selecting resource groups in Azure portal

  2. Under Resource groups, select Add.

    Screenshot of adding a resource group in Azure portal

  3. Select or enter the following property values:

    • Subscription: Select an Azure subscription.
    • Resource group: Give the resource group a name.
    • Region: Specify an Azure location. This location is where 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 be. Using the same location can simplify your template.

    Screenshot of setting resource group property values in Azure portal

  4. Select Review + create.

  5. Review the values, and then select Create.

  6. Select Refresh before you can see the new resource group in the list.

Deploy resources to a resource group

After you create a resource group, you can deploy resources to the group from the Marketplace. The Marketplace provides pre-defined solutions for common scenarios.

  1. To start a deployment, select Create a resource from the Azure portal.

    Screenshot of creating a new resource in Azure portal

  2. Find the type of resource you would like to deploy. The resources are organized in categories. If you don't see the particular solution you would like to deploy, you can search the Marketplace for it. The following screenshot shows that Ubuntu Server is selected.

    Screenshot of selecting a resource type in Azure portal

  3. 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. The following image shows how to create a Linux virtual machine and deploy it to the resource group you created.

    Screenshot of creating a Linux virtual machine and deploying it to a resource group in Azure portal

    You can decide to create a resource group when deploying your resources. Select Create new and give the resource group a name.

  4. Your deployment begins. The deployment could take several minutes. Some resources take longer time than other resources. When the deployment has finished, you see a notification. Select Go to resource to open

    Screenshot of viewing deployment notification in Azure portal

  5. After deploying your resources, you can add more resources to the resource group by selecting Add.

    Screenshot of adding a resource to a resource group in Azure portal

Although you didn't see it, the portal used an ARM template to deploy the resources you selected. You can find the template from the deployment history. For more information, see Export template after deployment.

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. To learn about creating templates, see Understand the structure and syntax of ARM templates.

Note

The portal interface doesn't support referencing a secret from a Key Vault. 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, search for template. and then select Template deployment.

    Screenshot of searching for template deployment in Azure portal

  2. Select Create.

  3. You see several options for creating a template:

    • Build your own template in editor: Create your own template in the portal template editor.
    • Common templates: Select from common solutions.
    • Load a GitHub quickstart template: Select from quickstart templates.

    Screenshot of template creation options in Azure portal

    This tutorial provides the instruction for loading a quickstart template.

  4. Under Load a GitHub quickstart template, type or select storage-account-create.

    You have two options:

    • Select template: deploy the template.
    • Edit template: edit the quickstart template before you deploy it.
  5. Select Edit template to explore the portal template editor. The template is loaded in the editor. Notice there are two parameters: storageAccountType and location.

    Screenshot of editing a JSON template in Azure portal

  6. Make a minor change to the template. For example, update the storageAccountName variable to:

    "storageAccountName": "[format('azstore{0}', uniquestring(resourceGroup().id))]"
    
  7. Select Save. Now you see the portal template deployment interface. Notice the two parameters that you defined in the template.

  8. Enter or select the property values:

    • Subscription: Select an Azure subscription.
    • Resource group: Select Create new and give a name.
    • Location: Select an Azure location.
    • Storage Account Type: Use the default value. The camel-cased parameter name, storageAccountType, defined in the template is turned into a space-separated string when displayed on the portal.
    • Location: Use the default value.
    • I agree to the terms and conditions stated above: (select)
  9. Select Purchase.

Next steps