Setup custom DNS at application gateway for multi-tenant solution at a sub-domain level

Pranab Karmakar 0 Reputation points
2024-03-26T10:58:02.93+00:00

image

  • In AKS we have UI running in a pod which is exposed by ingress controller on port 80, this is common for all tenants.
  • In a VM which is multi-tenant, we have two applications running on port 8180 and 8230.
  • Our requirement is http://example.com should route to AKS ingress controller for all tenants.
  • Client1 which is http://client1.example.com should route it to 8230 port of the VM.
  • Client2 which is http://client2.example.com should route it to 8180 port of the VM.

Our current configuration of application gateway is as follows -

  • Three listeners on port 443 L_UI, L_CLIENT1 and L_CLIENT2
    For L_UI host type is configured as Single
    For L_CLIENT1 host type is configured as Single
    For L_CLIENT2 host type is configured as Single

For L_UI host name is configured as http://example.com
For L_CLIENT1 host name is configured as http://client1.example.com
For L_CLIENT2 host name is configured as http://client2.exmple.com

  • Three backend pools pool_ui, pool_client1 and pool_client2
  • Three rules rule_ui, rule_client1 and rule_client2 which is attached to respective backend target and backend settings
  • Three backend settings as mentioned below:

backendsetting_ui on port 80

backendsetting_client1 on 8180

backendsetting_client2 on 8230

  • One front end configurations with type public and associated listeners are L_UI, L_CLIENT1 and L_CLIENT2

Above is our requirement and approaches for multi-tenant solution by sub-domain, as we don't have domain and sub-domain like example.com.

Configuring the host name at application gateway listener will not work as there is no domain and sub-domain.

Do we need to create domain and sub-domain?

Azure Application Gateway
Azure Application Gateway
An Azure service that provides a platform-managed, scalable, and highly available application delivery controller as a service.
Azure Kubernetes Service
Azure Kubernetes Service
An Azure service that provides serverless Kubernetes, an integrated continuous integration and continuous delivery experience, and enterprise-grade security and governance.
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. ChaitanyaNaykodi-MSFT 27,661 Reputation points Microsoft Employee Moderator
    2024-03-27T03:12:47.1933333+00:00

    @Pranab Karmakar

    Thank you for reaching out.

    Based on my understanding, of you question above.

    I wonder if you have considered configuring a multi-site listener for your application GAteway here for example like *.contoso.com and this way you can host multiple subdomains of the same parent domain on the same application gateway deployment. For example, you can host http://blog.contoso.com and http://app.contoso.com on a single application gateway deployment. Then use request routing rules to direct traffic to appropriate backend pool and port number. You can find more details here .

    Please let me know if you have any additional question here. Thank you!

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.