I am going a bit nuts here, as I can't get it to work properly.
Environment:
- App Gateway v2 (WAF)
- App Service with custom domain
- End 2 End SSL
Goals:
- Manage external SSL Certificate on App Gateway only
- Self-signed SSL on App Service
- End2End SSL
Setup:
- BackendPool set to App Service (*.azurewebsites.net)
- FronendIP configured externally
- Custom Probe with external Hostname set, Https
- SSL Listener with FrontendIp/Port(443), host name and external valid certificate
- Imported the self-signed certificate (cer) into the Trusted Root Authorities in App Gateway (powershell)
- Http Settings -> Https, Port 443, timeout 30, custom probe, host name set to external address, TrustedRootCertificate assigned (powershell)
- Basic Rule with SSL listener, Backend pool, Http Setting applied (powershell!)
- Now this is probably the bit that throws me off, because:
- Powershell says backend http settings are applied
- The portal says so too on the "overview" page of the Rule
- When editing the rule however, the "Http setting" field is empty, and there is a red exclamation mark:
- Now this is probably the bit that throws me off, because:
"There are no http settings with pick host name from backend address set. Create a new http setting with pick host name from backend address set and then try again."
However, I don't want this setting, because that would access the back-end as "*.azurewebsites.net", right? I need the backend to be accessed by the external hostname (*.mydomain.com).
Symptoms:
- Backend health in Portal "Healthy"
- Accessing the external hostname -> 502 Bad Gateway
I had this working by using "pick host name from backend" and using the azure hostname (*.azurewebsites.net) for internal access, unfortunately our application really needs the external name (and for context: when finished, there will be multiple external names pointing to the same application, and the application changes behavior depending on which hostname is used)
More notes:
- The App Service is configured with SSL, the self-signed certificate is only assigned to the custom hostname with "SNI"