<p>I'm using the Azure Kubernetes Service to deploy a web application on k8s and I'm using the <a href="https://learn.microsoft.com/en-gb/azure/application-gateway/ingress-controller-overview" rel="nofollow noreferrer">Application Gateway Ingress Controller</a> to forward the requests from the outside of the k8s cluster.</p>
<p>I defined the Ingress in this way:</p>
<pre><code>apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: my-ingress
  annotations:
    kubernetes.io/ingress.class: azure/application-gateway
    appgw.ingress.kubernetes.io/backend-path-prefix: /
    appgw.ingress.kubernetes.io/use-private-ip: &quot;true&quot;
    appgw.ingress.kubernetes.io/ssl-redirect: &quot;true&quot;
spec:
  tls:
  - hosts:
    - my.hostname.com
    secretName: my-cert
  rules:
  - host: my.hostname.com
    http:
      paths:
      - backend:
          serviceName: my-backend
          servicePort: 80
</code></pre>
<p><code>my-cert</code> is a secret I created that contains a SSL certificate my company bought some time ago that is valid for all the names <code>*.hostname.com</code> (is an example).</p>
<p>Now, if I apply this YAML the AGIC gets configured with the secret (I can see from the AGIC's pod logs that everything is fine) but I cannot access my application at the URL <code>my.hostname.com</code>, neither via HTTP nor via HTTPS.</p>
<p>If, instead, I drop the line <code>host: my.hostname.com</code> from the Ingress definition I can access the application via the Application Gateway's private IP.</p>
<p>Do you know if I have to perform some special operations to assign the hostname to my Application Gateway when using AGIC?</p>

gvdm
<p>Ok, I found the problem/solution. I only had to assign the <code>my.hostname.com</code> hostname to the private network's IP in the company Domain Controller. This way in the company network the hostname is resolvable to the IP</p>
