Question:
Hi everyone,
I'm fairly new to using Azure Application Gateway and need some assistance with a setup involving Prometheus, Grafana, and Loki on a single Azure VM. I want to expose these services securely over HTTPS through distinct subdomains (e.g., prometheus.example.com, grafana.example.com, loki.example.com) and manage DNS with AWS Route 53.
My Setup:
Azure VM: Hosting Prometheus, Grafana, and Loki.
Azure Application Gateway: To route traffic based on subdomains.
HTTPS: Enforce HTTPS only for all services.
DNS: Managed by AWS Route 53.
Objectives:
Prometheus: Accessible via https://prometheus.example.com
on port 9090
.
Grafana: Accessible via https://grafana.example.com
on port 3000
.
Loki: Accessible via https://loki.example.com
on port 3100
.
Scalability: Plan to add more applications using the same Azure Application Gateway.
Current Progress:
VM Setup: Created an Azure VM and installed Prometheus, Grafana, and Loki.
Networking: Configured Azure VNet and NSG to manage network traffic.
Application Gateway: Set up with listeners and backend pools.
DNS: Managed via AWS Route 53 to point subdomains to the Application Gateway's public IP.
Challenges I'm Facing:
Routing Traffic: Need guidance on configuring Azure Application Gateway to correctly route traffic to Prometheus, Grafana, and Loki based on subdomains.
HTTPS Enforcement: How to ensure HTTP requests are redirected to HTTPS for all subdomains.
Health Probes: Best practices for setting up health probes for these services.
SSL Certificate Management: Does Azure have a certificate manager like AWS Certificate Manager? How can I manage SSL certificates in Azure, without manually created certificates or using Let's Encrypt?
Here’s my current configuration:
Application Gateway Listeners:
Listener for prometheus.example.com
on port 443
Listener for grafana.example.com
on port 443
Listener for loki.example.com
on port 443
Backend Pools:
HTTP Settings:
Prometheus: http://<VM private IP>:9090
Grafana: http://<VM private IP>:3000
Loki: http://<VM private IP>:3100
DNS Records in AWS Route 53:
A
records pointing subdomains to the Azure Application Gateway’s public IP.Specific Questions:
Routing Configuration: How do I configure Azure Application Gateway to route traffic correctly to Prometheus, Grafana, and Loki based on subdomains?
Health Probes: What are the best practices for setting up health probes for these services?
HTTPS Redirection: How can I ensure that HTTP requests are redirected to HTTPS for all subdomains?
SSL Certificate Management: Does Azure have a built-in certificate manager similar to AWS Certificate Manager? If so, how can I use it to manage my SSL certificates? Alternatively, how can I manage SSL certificates without manually created certificates or using Let's Encrypt?
Additional Context:
I’m excited about leveraging Azure Application Gateway for this setup, as it will allow me to add more applications easily in the future. Any guidance, step-by-step instructions, or examples would be greatly appreciated!
Thank you in advance for your help!
...configuring Azure Application Gateway to correctly route traffic to Prometheus, Grafana, and Loki based on subdomains.
Assuming you have configured the listeners for the frontend for each application (differentiated by port), you should also have different backend pools corresponding to each frontend.
/
, and you must specify in the condition that the host header must match the domain name for that particular application.What are the best practices for setting up health probes for these services?
You need to choose a strategy, either from the product documentation or by devising one yourself. Usually, a probe configured to do GET /
is sufficient to verify that the host is accessible, and that the web server is responding fine. If the root redirects with 301 or 302, use the path it redirects to instead. For example, /login.php
. You should be probing for a 20x HTTP response code.
How can I ensure that HTTP requests are redirected to HTTPS for all subdomains?
Does Azure have a built-in certificate manager similar to AWS Certificate Manager? If so, how can I use it to manage my SSL certificates? Alternatively, how can I manage SSL certificates without manually created certificates or using Let's Encrypt?
Not quite. There is Azure Managed Certificates for App Services, and Azure KeyVault supports generating private keys and CSRs, but you need a public CA to sign your certificate, such as GlobalSign, Digicert etc. If you already have a wildcard cert for *.example.com
you can use this. Or, indeed you could use Let's Encrypt with DNS01 verification. Ultimately, you can upload your signed PFX format certificate chain (must include intermediates and root CA) and private key directly to App Gateway, or reference an existing certificate in KeyVault (which you would need to create or upload). I won't cover the KeyVault steps here because it's bordering going off topic.
The upshot is, there isn't currently any out-of-box functionality for certificate issuance or renewal. You could however use a cert issues in AWS Certificate Manager.