|
| 1 | +--- |
| 2 | +title: Create a .... by using Azure Resource Manager template |
| 3 | +description: Learn how to create an Azure ... by using Azure Resource Manager template. |
| 4 | +services: azure-resource-manager |
| 5 | +author: your-github-account-name |
| 6 | +ms.service: azure-resource-manager |
| 7 | +ms.topic: quickstart |
| 8 | +ms.custom: subject-armqs |
| 9 | +ms.author: your-msft-alias |
| 10 | +ms.date: 03/17/22 |
| 11 | +--- |
| 12 | + |
| 13 | +<!-- ms.topic and ms.custom in the metadata section are required --> |
| 14 | + |
| 15 | +# The H1 heading must include words "Resource Manager template" |
| 16 | + |
| 17 | +<!-- The second paragraph must be the following include file. You might need to change the file path of the include file depending on your content structure. This include is a paragraph that consistently introduces ARM concepts before doing a deployment and includes all our desired links to ARM content.--> |
| 18 | + |
| 19 | +[!INCLUDE [About Azure Resource Manager](../../includes/resource-manager-quickstart-introduction.md)] |
| 20 | + |
| 21 | +If you don't have an Azure subscription, create a [free](https://azure.microsoft.com/free/) account before you begin. |
| 22 | + |
| 23 | +## Prerequisites |
| 24 | + |
| 25 | +<!-- If there aren't any prerequisites, just place "None" in the section. --> |
| 26 | + |
| 27 | +## Create a ... |
| 28 | + |
| 29 | +<!-- The second H2 must start with "Create a". For example, 'Create a Key Vault', 'Create a virtual machine', etc. --> |
| 30 | + |
| 31 | +### Review the template |
| 32 | + |
| 33 | +<!-- The first sentence must be the following sentence. The link is the quickstart template from GitHub. The link must begin with https://github.com/Azure/azure-quickstart-templates/. --> |
| 34 | + |
| 35 | +The template used in this quickstart is from [Azure Quickstart templates](). |
| 36 | + |
| 37 | +<!-- After the first sentence, add a JSON codefence that links to the quickstart template. Customers have provided feedback that they prefer to see the whole template; therefore, we recommend you include the whole template in your article. If your template is too long to show in the quickstart, you can instead add a sentence that says "The template for this article is too long to show here. To view the template, see ..." |
| 38 | +
|
| 39 | +The syntax for the codefence is: --> |
| 40 | + |
| 41 | +:::code language="json" source="~/quickstart-templates/<TEMPLATE NAME>/azuredeploy.json" range="000-000" highlight="000-000"::: |
| 42 | + |
| 43 | +<!-- After the JSON codefence, a list of each resourceType from the JSON must exist with a link to the template reference starting with /azure/templates. For example: |
| 44 | +
|
| 45 | +* [**Microsoft.KeyVault/vaults**](/azure/templates/microsoft.keyvault/vaults): create an Azure key vault. |
| 46 | +* [**Microsoft.KeyVault/vaults/secrets**](/azure/templates/microsoft.keyvault/vaults/secrets): create an key vault secret. |
| 47 | +
|
| 48 | +The URL usually appears as, for example, https://docs.microsoft.com/en-us/azure/templates/Microsoft.Network/2019-11-01/loadBalancers for loadbalancer of Microsoft.Network. Remove the API version from the URL, the URL redirects the users to the latest version. |
| 49 | +--> |
| 50 | + |
| 51 | +* [Azure resource type](link to the template reference) |
| 52 | +* [Azure resource type](link to the template reference) |
| 53 | + |
| 54 | +<!-- List additional quickstart templates. For example: [Azure Quickstart Templates](https://azure.microsoft.com/resources/templates/?resourceType=Microsoft.Keyvault&pageNumber=1&sort=Popular). |
| 55 | +Notice the resourceType and sort elements in the URL. |
| 56 | +--> |
| 57 | + |
| 58 | +## Deploy the template |
| 59 | + |
| 60 | +<!-- |
| 61 | + One of the following options must be included: |
| 62 | +
|
| 63 | + - **CLI**: In an Azure CLI Interactive codefence must contain **az group deployment create**. For example: |
| 64 | +
|
| 65 | + ```azurecli-interactive |
| 66 | + read -p "Enter a project name that is used for generating resource names:" projectName && |
| 67 | + read -p "Enter the location (i.e. centralus):" location && |
| 68 | + templateUri="https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/101-storage-account-create/azuredeploy.json" && |
| 69 | + resourceGroupName="${projectName}rg" && |
| 70 | + az group create --name $resourceGroupName --location "$location" && |
| 71 | + az group deployment create --resource-group $resourceGroupName --template-uri $templateUri |
| 72 | + echo "Press [ENTER] to continue ..." && |
| 73 | + read |
| 74 | + ``` |
| 75 | +
|
| 76 | + - **PowerShell**: In an Azure PowerShell Interactive codefence must contain **New-AzResourceGroupDeployment**. For example: |
| 77 | +
|
| 78 | + ```azurepowershell-interactive |
| 79 | + $projectName = Read-Host -Prompt "Enter a project name that is used for generating resource names" |
| 80 | + $location = Read-Host -Prompt "Enter the location (i.e. centralus)" |
| 81 | + $templateUri = "https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/101-storage-account-create/azuredeploy.json" |
| 82 | +
|
| 83 | + $resourceGroupName = "${projectName}rg" |
| 84 | +
|
| 85 | + New-AzResourceGroup -Name $resourceGroupName -Location "$location" |
| 86 | + New-AzResourceGroupDeployment -ResourceGroupName $resourceGroupName -TemplateUri $templateUri |
| 87 | +
|
| 88 | + Read-Host -Prompt "Press [ENTER] to continue ..." |
| 89 | +
|
| 90 | + For an example, see Add a description. Press tab when you are done. |
| 91 | + ``` |
| 92 | +
|
| 93 | + - **Portal**: A button with description **Deploy Resource Manager template to Azure**, with image **/media/<QUICKSTART FILE NAME>/deploy-to-azure.png*, must exist and have a link that starts with **https://portal.azure.com/#create/Microsoft.Template/uri/**: |
| 94 | +
|
| 95 | + ```markdown |
| 96 | + [](https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2FAzure%2Fazure-quickstart-templates%2Fmaster%2F101-key-vault-create%2Fazuredeploy.json) |
| 97 | + ``` |
| 98 | +
|
| 99 | + To get the standard button image and find more information about this deployment option, see [Use a deployment button to deploy templates from GitHub repository](/azure/azure-resource-manager/templates/deploy-to-azure-button.md). |
| 100 | + --> |
| 101 | + |
| 102 | +## Review deployed resources |
| 103 | + |
| 104 | +<!-- You can also use the title "Validate the deployment"--> |
| 105 | + |
| 106 | +## Clean up resources |
| 107 | + |
| 108 | +When no longer needed, delete the resource group, which deletes the resources in the resource group. |
| 109 | + |
| 110 | +<!-- |
| 111 | +
|
| 112 | +Choose Azure CLI, Azure PowerShell, or Azure portal to delete the resource group. Use [Zone pivots](https://review.docs.microsoft.com/help/contribute/zone-pivots?branch=master) if you want to use multiple options. Here are the samples for Azure CLI and Azure PowerShell: |
| 113 | +
|
| 114 | +```azurecli-interactive |
| 115 | +echo "Enter the Resource Group name:" && |
| 116 | +read resourceGroupName && |
| 117 | +az group delete --name $resourceGroupName && |
| 118 | +echo "Press [ENTER] to continue ..." |
| 119 | +``` |
| 120 | +
|
| 121 | +```azurepowershell-interactive |
| 122 | +$resourceGroupName = Read-Host -Prompt "Enter the Resource Group name" |
| 123 | +Remove-AzResourceGroup -Name $resourceGroupName |
| 124 | +Write-Host "Press [ENTER] to continue..." |
| 125 | +``` |
| 126 | +
|
| 127 | +--> |
| 128 | + |
| 129 | +## Next steps |
| 130 | + |
| 131 | +<!-- You can either make the next steps similar to the next steps in your other quickstarts, or point users to the following tutorial.--> |
| 132 | + |
| 133 | +For a step-by-step tutorial that guides you through the process of creating a template, see: |
| 134 | + |
| 135 | +> [!div class="nextstepaction"] |
| 136 | +> [ Tutorial: Create and deploy your first Azure Resource Manager template](/azure/azure-resource-manager/templates/template-tutorial-create-first-template.md) |
0 commit comments