title | titleSuffix | description | services | author | ms.service | ms.topic | ms.date | ms.author | ms.custom |
---|---|---|---|---|---|---|---|---|---|
Quickstart: Direct web traffic using a Resource Manager template |
Azure Application Gateway |
In this quickstart, you learn how to use a Resource Manager template to create an Azure Application Gateway that directs web traffic to virtual machines in a backend pool. |
application-gateway |
vhorne |
application-gateway |
quickstart |
08/27/2020 |
victorh |
mvc |
In this quickstart, you use an Azure Resource Manager template (ARM template) to create an Azure Application Gateway. Then you test the application gateway to make sure it works correctly.
[!INCLUDE About Azure Resource Manager]
You can also complete this quickstart using the Azure portal, Azure PowerShell, or Azure CLI.
[!INCLUDE updated-for-az]
If your environment meets the prerequisites and you're familiar with using ARM templates, select the Deploy to Azure button. The template will open in the Azure portal.
- An Azure account with an active subscription. Create an account for free.
For the sake of simplicity, this template creates a simple setup with a public front-end IP, a basic listener to host a single site on the application gateway, a basic request routing rule, and two virtual machines in the backend pool.
The template used in this quickstart is from Azure Quickstart Templates
:::code language="json" source="~/quickstart-templates/ag-docs-qs/azuredeploy.json":::
Multiple Azure resources are defined in the template:
- Microsoft.Network/applicationgateways
- Microsoft.Network/publicIPAddresses : one for the application gateway, and two for the virtual machines.
- Microsoft.Network/networkSecurityGroups
- Microsoft.Network/virtualNetworks
- Microsoft.Compute/virtualMachines : two virtual machines
- Microsoft.Network/networkInterfaces : two for the virtual machines
- Microsoft.Compute/virtualMachine/extensions : to configure IIS and the web pages
Deploy the ARM template to Azure:
-
Select Deploy to Azure to sign in to Azure and open the template. The template creates an application gateway, the network infrastructure, and two virtual machines in the backend pool running IIS.
-
Select or create your resource group, type the virtual machine administrator user name and password.
-
Select Review + Create and then select Create.
The deployment can take 20 minutes or longer to complete.
Although IIS isn't required to create the application gateway, it's installed to verify if Azure successfully created the application gateway. Use IIS to test the application gateway:
-
Find the public IP address for the application gateway on its Overview page.
Or, you can select All resources, enter myAGPublicIPAddress in the search box, and then select it in the search results. Azure displays the public IP address on the Overview page.
-
Copy the public IP address, and then paste it into the address bar of your browser to browse that IP address.
-
Check the response. A valid response verifies that the application gateway was successfully created and can successfully connect with the backend.
Refresh the browser multiple times and you should see connections to both myVM1 and myVM2.
When you no longer need the resources that you created with the application gateway, delete the resource group. This removes the application gateway and all the related resources.
To delete the resource group, call the Remove-AzResourceGroup
cmdlet:
Remove-AzResourceGroup -Name <your resource group name>
[!div class="nextstepaction"] Manage web traffic with an application gateway using the Azure CLI