<p>In Nginx, we can set up basic auth by adding annotation in the ingress.</p>
<pre><code>nginx.ingress.kubernetes.io/auth-realm: Authentication Required
nginx.ingress.kubernetes.io/auth-secret: basic-auth
nginx.ingress.kubernetes.io/auth-type: basic
</code></pre>
<p>But if we are using azure application gateway instead of Nginx how can we set up basic auth.
<a href="https://i.stack.imgur.com/Qiynp.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Qiynp.png" alt="enter image description here" /></a></p>

<p>Unfortunately <strong>Azure Application Gateway</strong> doesn't support <strong>basic auth</strong> and I would say using an <strong>ingress controller</strong> like <strong>nginx-ingress</strong> is the proper choice in a scenario where you need this feature. The lack of support for authentication in <strong>Azure Application Gateway</strong> was already reported in <a href="https://feedback.azure.com/forums/217313-networking/suggestions/19473664-authentication-support-for-application-gateway" rel="nofollow noreferrer">this thread</a>.</p>
