Quickstart: Create an Application Gateway with SSL Termination
This guide will walk you through the essential steps to deploy an Azure Application Gateway with SSL termination enabled. Application Gateway is a web traffic load balancer that enables you to manage traffic to your web applications.
Prerequisites
- An Azure subscription. If you don't have one, create a free account.
- Azure CLI installed or access to Azure Cloud Shell.
Step 1: Create a Resource Group
First, create a resource group to hold your Application Gateway and related resources. A resource group is a logical container for your Azure resources.
Step 2: Create a Virtual Network (VNet) and Subnet
Application Gateway requires a dedicated subnet within your virtual network. This subnet cannot contain any other Azure resources.
Create the VNet:
Create the subnet for Application Gateway:
Step 3: Create the Application Gateway
Now, create the Application Gateway itself. This command specifies the SKU (Standard_v2), instance count, and the subnet created in the previous step. We'll also configure it to use SSL termination by providing a certificate.
Generate a self-signed SSL certificate (for testing purposes):
You will have two files: appgw.key
and appgw.cer
.
Create the Application Gateway using the certificate:
This process can take several minutes to complete.
Step 4: Configure Listener and Backend Pool
Application Gateway needs a listener to accept incoming traffic and a backend pool to route that traffic to. For simplicity, we'll configure a basic HTTP listener and a default backend pool pointing to an imaginary web server.
Create a backend address pool:
Create an HTTP setting (defines how traffic is sent to backend servers):
Create a listener for HTTPS traffic on port 443, referencing the SSL certificate:
Create a rule to tie the listener, backend pool, and HTTP settings together:
Step 5: Verify Deployment
Once the commands complete, your Application Gateway will be deployed and configured. You can retrieve its public IP address to test access.
Copy the IP address returned. You can then navigate to https://<your-app-gateway-ip>
in your browser. You will likely see a certificate warning because it's self-signed, but the connection should establish.
Next Steps
- Explore advanced routing rules.
- Configure health probes for your backend servers.
- Learn about Web Application Firewall (WAF) capabilities.
- Integrate with Azure Monitor for diagnostics and logging.