~ ➜ showcreds
╒═════════════════════════════╤════════════════════════════════════════════════════════════════════╕
│ Name │ Value │
╞═════════════════════════════╪════════════════════════════════════════════════════════════════════╡
│ Azure Console URL │ Microsoft Azure │
(APP CREDENTIALS DELETED FORM YOUR POST. PLEASE, PLEASE PLEASE, NEVER NEVER PUT THIS IN A POST ON THE PUBLIC INTERNET!!!)
│ Azure Session End Time │ Tue Jun 30 16:22:10 UTC 2026 │
╘═════════════════════════════╧════════════════════════════════════════════════════════════════════╛
ALSO DELETED
az group list -o table
Login OK
Name Location Status
kml_rg_main-0b677f1872df4452 eastus Succeeded
~ ➜ RG=$(az group list --query “[0].name” -o tsv)
LOCATION=eastus
VNET=xfusion-vnet
VM_SUBNET=xfusion-subnet
APGW_SUBNET=xfusion-apgw-subnet
VM1=xfusion-vm1
VM2=xfusion-vm2
ADMIN_USER=azureuser
ADMIN_PASS=KKELabs2024Secure
echo “RG=$RG”
az network vnet create --resource-group $RG --name $VNET --location $LOCATION
–address-prefix 10.0.0.0/16 --subnet-name $VM_SUBNET --subnet-prefix 10.0.1.0/24 --output table
az network vnet subnet create --resource-group $RG --vnet-name $VNET
–name $APGW_SUBNET --address-prefix 10.0.2.0/24 --output table
printf ‘#!/bin/bash\napt-get update -y\napt-get install -y nginx\necho “Welcome to KKE Labs:Version 1” > /var/www/html/index.html\nsystemctl enable nginx\nsystemctl start nginx\n’ > /tmp/init1.sh
printf ‘#!/bin/bash\napt-get update -y\napt-get install -y nginx\necho “Welcome to KKE Labs:Version 2” > /var/www/html/index.html\nsystemctl enable nginx\nsystemctl start nginx\n’ > /tmp/init2.sh
az vm create -g $RG -n $VM1 --location $LOCATION --size Standard_B1s --image Ubuntu22echo “VM1=$VM1_IP VM2=$VM2_IP”$VM2 --show-details --query privateIps -o tsv) Ubuntu22
RG=kml_rg_main-0b677f1872df4452
AddressPrefix Name PrivateEndpointNetworkPolicies PrivateLinkServiceNetworkPolicies ProvisioningState ResourceGroup
10.0.2.0/24 xfusion-apgw-subnet Disabled Enabled Succeeded kml_rg_main-0b677f1872df4452
ResourceGroup PowerState PublicIpAddress Fqdns PrivateIpAddress MacAddress Location Zones
kml_rg_main-0b677f1872df4452 VM running 10.0.1.4 00-0D-3A-9D-9B-25 eastus
ResourceGroup PowerState PublicIpAddress Fqdns PrivateIpAddress MacAddress Location Zones
kml_rg_main-0b677f1872df4452 VM running 10.0.1.5 7C-1E-52-7F-FF-AB eastus
VM1=10.0.1.4 VM2=10.0.1.5
~ ➜ RG=kml_rg_main-0b677f1872df4452
LOCATION=eastus
VNET=xfusion-vnet
APGW_SUBNET=xfusion-apgw-subnet
APGW=xfusion-apgw
APGW_PIP=xfusion-apgw-pip
VM1_IP=10.0.1.4
VM2_IP=10.0.1.5
Create public IP
az network public-ip create --resource-group $RG --name $APGW_PIP
–location $LOCATION --sku Standard --allocation-method Static --output table
[Coming breaking change] In the coming release, the default behavior will be changed as follows when sku is Standard and zone is not provided: For zonal regions, you will get a zone-redundant IP indicated by zones:[“1”,“2”,“3”]; For non-zonal regions, you will get a non zone-redundant IP indicated by zones:null.
~ ➜ SUBNET_ID=$(az network vnet subnet show -g $RG --vnet-name $VNET -n $APGW_SUBNET --query id -o tsv)
PIP_ID=$(az network public-ip show -g $RG -n $APGW_PIP --query id -o tsv)
SUB_ID=$(az account show --query id -o tsv)
echo “SUBNET_ID=$SUBNET_ID”
echo “PIP_ID=$PIP_ID”
echo “SUB_ID=$SUB_ID”
SUBNET_ID=/subscriptions/f0c3bcdd-5ce2-4fa0-8cf3-41559747512b/resourceGroups/kml_rg_main-0b677f1872df4452/providers/Microsoft.Network/virtualNetworks/xfusion-vnet/subnets/xfusion-apgw-subnet
PIP_ID=/subscriptions/f0c3bcdd-5ce2-4fa0-8cf3-41559747512b/resourceGroups/kml_rg_main-0b677f1872df4452/providers/Microsoft.Network/publicIPAddresses/xfusion-apgw-pip
SUB_ID=f0c3bcdd-5ce2-4fa0-8cf3-41559747512b
~ ➜ python3 -c "
import json
subnet_id = ‘’‘$SUBNET_ID’‘’
pip_id = ‘’‘$PIP_ID’‘’
vm1_ip = ‘’‘$VM1_IP’‘’
vm2_ip = ‘’‘$VM2_IP’‘’
body = {
‘location’: ‘eastus’,
‘properties’: {
‘sku’: {‘name’: ‘Basic’, ‘tier’: ‘Basic’, ‘capacity’: 1},
‘gatewayIPConfigurations’: [
{‘name’: ‘appGatewayIpConfig’, ‘properties’: {‘subnet’: {‘id’: subnet_id}}}
],
‘frontendIPConfigurations’: [
{‘name’: ‘xfusion-apgw-ip’, ‘properties’: {‘privateIPAllocationMethod’: ‘Dynamic’, ‘publicIPAddress’: {‘id’: pip_id}}}
],
‘frontendPorts’: [
{‘name’: ‘port80’, ‘properties’: {‘port’: 80}}
],
‘backendAddressPools’: [
{‘name’: ‘backendPool’, ‘properties’: {‘backendAddresses’: [{‘ipAddress’: vm1_ip}, {‘ipAddress’: vm2_ip}]}}
],
‘backendHttpSettingsCollection’: [
{‘name’: ‘httpSettings’, ‘properties’: {‘port’: 80, ‘protocol’: ‘Http’, 'cookie"rint(‘Body written OK’)ndent=2) ‘w’) as f:s/xfusion-apgw/backendHttpSettingsCollecti
Body written OK
~ ➜ # Deploy via direct REST API call (PUT)
az rest --method put
–uri “https://management.azure.com/subscriptions/$SUB_ID/resourceGroups/$RG/providers/Microsoft.Network/applicationGateways/$APGW?api-version=2023-04-01”
–body @/tmp/apgw-body.json
–output json
{
“etag”: “W/"5466949c-e0f0-4a79-8c5c-dd304ae406ad"”,
“id”: “/subscriptions/f0c3bcdd-5ce2-4fa0-8cf3-41559747512b/resourceGroups/kml_rg_main-0b677f1872df4452/providers/Microsoft.Network/applicationGateways/xfusion-apgw”,
“location”: “eastus”,
“name”: “xfusion-apgw”,
“properties”: {
“backendAddressPools”: [
{
“etag”: “W/"5466949c-e0f0-4a79-8c5c-dd304ae406ad"”,
“id”: “/subscriptions/f0c3bcdd-5ce2-4fa0-8cf3-41559747512b/resourceGroups/kml_rg_main-0b677f1872df4452/providers/Microsoft.Network/applicationGateways/xfusion-apgw/backendAddressPools/backendPool”,
“name”: “backendPool”,
“properties”: {
“backendAddresses”: [
{
“ipAddress”: “10.0.1.4”
},
{
“ipAddress”: “10.0.1.5”
}
],
“provisioningState”: “Updating”,
“requestRoutingRules”: [
{
“id”: “/subscriptions/f0c3bcdd-5ce2-4fa0-8cf3-41559747512b/resourceGroups/kml_rg_main-0b677f1872df4452/providers/Microsoft.Network/applicationGateways/xfusion-apgw/requestRoutingRules/routingRule”
}
]
},
“type”: “Microsoft.Network/applicationGateways/backendAddressPools”
}
],
“backendHttpSettingsCollection”: [
{
“etag”: “W/"5466949c-e0f0-4a79-8c5c-dd304ae406ad"”,
“id”: “/subscriptions/f0c3bcdd-5ce2-4fa0-8cf3-41559747512b/resourceGroups/kml_rg_main-0b677f1872df4452/providers/Microsoft.Network/applicationGateways/xfusion-apgw/backendHttpSettingsCollection/httpSettings”,
“name”: “httpSettings”,
“properties”: {
“cookieBasedAffinity”: “Disabled”,
“pickHostNameFromBackendAddress”: false,
“port”: 80,
“protocol”: “Http”,
“provisioningState”: “Updating”,
“requestRoutingRules”: [
{
“id”: “/subscriptions/f0c3bcdd-5ce2-4fa0-8cf3-41559747512b/resourceGroups/kml_rg_main-0b677f1872df4452/providers/Microsoft.Network/applicationGateways/xfusion-apgw/requestRoutingRules/routingRule”
}
],
“requestTimeout”: 30
},
“type”: “Microsoft.Network/applicationGateways/backendHttpSettingsCollection”
}
],
“defaultPredefinedSslPolicy”: “AppGwSslPolicy20220101”,
“frontendIPConfigurations”: [
{
“etag”: “W/"5466949c-e0f0-4a79-8c5c-dd304ae406ad"”,
“id”: “/subscriptions/f0c3bcdd-5ce2-4fa0-8cf3-41559747512b/resourceGroups/kml_rg_main-0b677f1872df4452/providers/Microsoft.Network/applicationGateways/xfusion-apgw/frontendIPConfigurations/xfusion-apgw-ip”,
“name”: “xfusion-apgw-ip”,
“properties”: {
“httpListeners”: [
{
“id”: “/subscriptions/f0c3bcdd-5ce2-4fa0-8cf3-41559747512b/resourceGroups/kml_rg_main-0b677f1872df4452/providers/Microsoft.Network/applicationGateways/xfusion-apgw/httpListeners/httpListener”
}
],
“privateIPAllocationMethod”: “Dynamic”,
“provisioningState”: “Updating”,
“publicIPAddress”: {
“id”: “/subscriptions/f0c3bcdd-5ce2-4fa0-8cf3-41559747512b/resourceGroups/kml_rg_main-0b677f1872df4452/providers/Microsoft.Network/publicIPAddresses/xfusion-apgw-pip”
}
},
“type”: “Microsoft.Network/applicationGateways/frontendIPConfigurations”
}
],
“frontendPorts”: [
{
“etag”: “W/"5466949c-e0f0-4a79-8c5c-dd304ae406ad"”,
“id”: “/subscriptions/f0c3bcdd-5ce2-4fa0-8cf3-41559747512b/resourceGroups/kml_rg_main-0b677f1872df4452/providers/Microsoft.Network/applicationGateways/xfusion-apgw/frontendPorts/port80”,
“name”: “port80”,
“properties”: {
“httpListeners”: [
{
“id”: “/subscriptions/f0c3bcdd-5ce2-4fa0-8cf3-41559747512b/resourceGroups/kml_rg_main-0b677f1872df4452/providers/Microsoft.Network/applicationGateways/xfusion-apgw/httpListeners/httpListener”
}
],
“port”: 80,
“provisioningState”: “Updating”
},
“type”: “Microsoft.Network/applicationGateways/frontendPorts”
}
],
“gatewayIPConfigurations”: [
{
“etag”: “W/"5466949c-e0f0-4a79-8c5c-dd304ae406ad"”,
“id”: “/subscriptions/f0c3bcdd-5ce2-4fa0-8cf3-41559747512b/resourceGroups/kml_rg_main-0b677f1872df4452/providers/Microsoft.Network/applicationGateways/xfusion-apgw/gatewayIPConfigurations/appGatewayIpConfig”,
“name”: “appGatewayIpConfig”,
“properties”: {
“provisioningState”: “Updating”,
“subnet”: {
“id”: “/subscriptions/f0c3bcdd-5ce2-4fa0-8cf3-41559747512b/resourceGroups/kml_rg_main-0b677f1872df4452/providers/Microsoft.Network/virtualNetworks/xfusion-vnet/subnets/xfusion-apgw-subnet”
}
},
“type”: “Microsoft.Network/applicationGateways/gatewayIPConfigurations”
}
],
“httpListeners”: [
{
“etag”: “W/"5466949c-e0f0-4a79-8c5c-dd304ae406ad"”,
“id”: “/subscriptions/f0c3bcdd-5ce2-4fa0-8cf3-41559747512b/resourceGroups/kml_rg_main-0b677f1872df4452/providers/Microsoft.Network/applicationGateways/xfusion-apgw/httpListeners/httpListener”,
“name”: “httpListener”,
“properties”: {
“enableHttp3”: false,
“frontendIPConfiguration”: {
“id”: “/subscriptions/f0c3bcdd-5ce2-4fa0-8cf3-41559747512b/resourceGroups/kml_rg_main-0b677f1872df4452/providers/Microsoft.Network/applicationGateways/xfusion-apgw/frontendIPConfigurations/xfusion-apgw-ip”
},
“frontendPort”: {
“id”: “/subscriptions/f0c3bcdd-5ce2-4fa0-8cf3-41559747512b/resourceGroups/kml_rg_main-0b677f1872df4452/providers/Microsoft.Network/applicationGateways/xfusion-apgw/frontendPorts/port80”
},
“hostNames”: [],
“protocol”: “Http”,
“provisioningState”: “Updating”,
“requestRoutingRules”: [
{
“id”: “/subscriptions/f0c3bcdd-5ce2-4fa0-8cf3-41559747512b/resourceGroups/kml_rg_main-0b677f1872df4452/providers/Microsoft.Network/applicationGateways/xfusion-apgw/requestRoutingRules/routingRule”
}
],
“requireServerNameIndication”: false
},
“type”: “Microsoft.Network/applicationGateways/httpListeners”
}
],
“operationalState”: “Stopped”,
“probes”: [],
“provisioningState”: “Updating”,
“redirectConfigurations”: [],
“requestRoutingRules”: [
{
“etag”: “W/"5466949c-e0f0-4a79-8c5c-dd304ae406ad"”,
“id”: “/subscriptions/f0c3bcdd-5ce2-4fa0-8cf3-41559747512b/resourceGroups/kml_rg_main-0b677f1872df4452/providers/Microsoft.Network/applicationGateways/xfusion-apgw/requestRoutingRules/routingRule”,
“name”: “routingRule”,
“properties”: {
“backendAddressPool”: {
“id”: “/subscriptions/f0c3bcdd-5ce2-4fa0-8cf3-41559747512b/resourceGroups/kml_rg_main-0b677f1872df4452/providers/Microsoft.Network/applicationGateways/xfusion-apgw/backendAddressPools/backendPool”
},
“backendHttpSettings”: {
“id”: “/subscriptions/f0c3bcdd-5ce2-4fa0-8cf3-41559747512b/resourceGroups/kml_rg_main-0b677f1872df4452/providers/Microsoft.Network/applicationGateways/xfusion-apgw/backendHttpSettingsCollection/httpSettings”
},
“httpListener”: {
“id”: “/subscriptions/f0c3bcdd-5ce2-4fa0-8cf3-41559747512b/resourceGroups/kml_rg_main-0b677f1872df4452/providers/Microsoft.Network/applicationGateways/xfusion-apgw/httpListeners/httpListener”
},
“priority”: 100,
“provisioningState”: “Updating”,
“ruleType”: “Basic”
},
“type”: “Microsoft.Network/applicationGateways/requestRoutingRules”
}
],
“resourceGuid”: “e1e673c2-3394-48ab-90d7-e9aa0b804ac6”,
“rewriteRuleSets”: [],
“sku”: {
“capacity”: 1,
“family”: “Generation_1”,
“name”: “Basic”,
“tier”: “Basic”
},
“sslCertificates”: [],
“trustedRootCertificates”: [],
“urlPathMaps”: []
},
“type”: “Microsoft.Network/applicationGateways”
}
~ ➜ RG=kml_rg_main-0b677f1872df4452
APGW=xfusion-apgw
APGW_PIP=xfusion-apgw-pip
echo “Waiting for gateway to finish provisioning…”
az network application-gateway wait -g $RG -n $APGW --created --timeout 600
echo “Provisioning complete”
Waiting for gateway to finish provisioning…
Provisioning complete
~ ➜ az network application-gateway show -g $RG -n $APGW
–query “{provisioningState:provisioningState, operationalState:operationalState, sku:sku}” -o json
{
“operationalState”: “Running”,
“provisioningState”: “Succeeded”,
“sku”: {
“capacity”: 1,
“family”: “Generation_1”,
“name”: “Basic”,
“tier”: “Basic”
}
}
~ ➜ az network application-gateway frontend-ip list
–resource-group $RG --gateway-name $APGW --output table
Name PrivateIPAllocationMethod ProvisioningState ResourceGroup
xfusion-apgw-ip Dynamic Succeeded kml_rg_main-0b677f1872df4452
~ ➜ APGW_IP=$(az network public-ip show -g $RG -n $APGW_PIP --query ipAddress -o tsv)
echo “Gateway: http://$APGW_IP”
sleep 60
for i in 1 2 3 4 5 6; do
echo “Request $i: $(curl -s --max-time 15 http://$APGW_IP)”
sleep 3
done
Gateway: http://74.235.52.140
Request 1: Welcome to KKE Labs:Version 1
Request 2: Welcome to KKE Labs:Version 1
Request 3: Welcome to KKE Labs:Version 2
Request 4: Welcome to KKE Labs:Version 1
Request 5: Welcome to KKE Labs:Version 2
Request 6: Welcome to KKE Labs:Version 1
~ ➜